python - Find longest substring of text and pattern -
is there a function in python, returns index of longest common substring of text , given pattern in case pattern has start substring?
text = lorem ipsum dolor sit amet, consectetur adipisici elit pattern = amegt
22
you looking "suffix tree" algorithm: http://en.wikipedia.org/wiki/longest_common_substring_problem
your solution should this: https://github.com/kvh/python-suffix-tree
there example there on how use library. need far understand requirements.
let me know if need additional help.
cheers, alex
Comments
Post a Comment