Efficient way of testing for substring being one of a set?

Pop User popuser at christest2.dc.k12us.com
Thu Apr 3 15:24:14 EDT 2008


bearophileHUGS at lycos.com wrote:
 > Dennis Benzinger:
 >> You could use the Aho-Corasick algorithm <http://en.wikipedia.org/wiki/
 >> Aho-Corasick_algorithm>.
 >> I don't know if there's a Python implementation yet.
 >
 > http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/
 >

http://nicolas.lehuen.com/download/pytst/ can do it as well.



More information about the Python-list mailing list