
Stefan Behnel wrote:
M.-A. Lemburg, 02.03.2010 23:09:
If you only need to search for a finite set of words, there are few good algorithms for this:
http://en.wikipedia.org/wiki/Aho-Corasick_algorithm * used in Unix fgrep * Python implementation: http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/
http://en.wikipedia.org/wiki/Rabin-Karp_string_search_algorithm#Rabin.E2.80....
* uses hashing
... and acora:
Nice :-) -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Mar 04 2010)
Python/Zope Consulting and Support ... http://www.egenix.com/ mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/