Need help with Python-Suffix-Tree?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

kvh
148 Stars 72 Forks MIT License 16 Commits 3 Opened issues

Description

Suffix tree for string searching

Services available

!
?

Need anything else?

Contributors list

# 203,878
Python
8 commits
# 15,455
Python
Shell
reactjs
Node.js
1 commit
# 121,404
CSS
Linux
speaker...
rnn-tra...
1 commit

Suffix Trees in Python

Based off of Mark Nelson's C++ implementation of Ukkonen's algorithm. Ukkonen's algorithm gives a O(n) + O(k) contruction time for a suffix tree, where n is the length of the string and k is the size of the alphabet of that string. Ukkonen's is an online algorithm, processing the input sequentially and producing a valid suffix tree at each character.

How to use

string = "I need to be searched!"
tree = SuffixTree(string)
index_of_need = tree.find_substring("need")

Usage note

This library is mostly an academic exercise. If you need an efficient library I would recommend a python-wrapped c implementation, such as this one.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.