ptrus / suffix-trees

Python implementation of Suffix Trees and Generalized Suffix Trees.
MIT License
122 stars 28 forks source link

Not Generalized Suffix Trees fro multiple strings. #21

Closed NidhiRustagi closed 4 years ago

NidhiRustagi commented 4 years ago

Hi! I tried using the code fro multiple strings, but it fails to give the correct answer. I believe the current implementation is only meant for a single string unless I made some mistake in the function call. Pasting my code below for your reference:

text = ["how are you doing?", "how are you?", "good morning", "good morning madam"] st = STree.STree(text) st.find("how are you?")

It will be really great if you could add the implementation for multiple strings as well.

ptrus commented 4 years ago

Hi! You should be also able to find multiple occurrences using the find_all method.

text = ["how are you doing?", "how are you?", "good morning", "good morning madam"]
st = STree.STree(text)
st.find_all("how are you")
{0, 19}