ptrus / suffix-trees

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

STree matches on non-existent matches in edge cases #6

Closed vgm64 closed 6 years ago

vgm64 commented 7 years ago

I came across some spurious matches on my data. I've whittled down the text to reproduce, so here's a minimal example:

from suffix_trees.STree import STree
text = "name language w en url http w namelanguage en url http"
stree = STree(text)

print "STree finds 'law' at index:", stree.find_all('law')
print "'law' in text -->", 'law' in text

which outputs

STree finds 'law' at index: [5]
'law' in text --> False
ptrus commented 6 years ago

Thanks!

Fixed the bug.