How to check if any item from a list of strings is in a big string?

denis denis-bz-gg at t-online.de
Wed Jul 15 06:46:23 EDT 2009


Sure, Aho-Corasick is fast for fixed strings; but without real
numbers / a concrete goal
> > Matt, how many words are you looking for, in how long a string ?

a simple solution is good enough, satisficing.  Matt asked "how to
make that function look nicer?"
but "nice" has many dimensions -- bicycles are nice for some tasks,
Ferraris for others.

Bytheway http://en.wikipedia.org/wiki/Aho-Corasick_algorithm has a
link to a Python implementation,
also http://en.wikipedia.org/wiki/Worse_is_Better is fun.




More information about the Python-list mailing list