[Tutor] Advanced String Search using operators AND, OR etc..

Kent Johnson kent37 at tds.net
Mon May 4 22:22:47 CEST 2009


On Mon, May 4, 2009 at 8:45 AM, Alex Feddor <alex.feddor at gmail.com> wrote:
> Hi
>
> I am looking for method enables advanced text string search. Method
> string.find() or re module seems no  supporting what I am looking for. The
> idea is as follows:
>
> Text ="FDA meeting was successful. New drug is approved for whole sale
> distribution!"
>
> I would like to scan the text using AND and OR operators and gets -1 or
> other value if the searching elements haven't found in the text.

There are some Python search engines that will do this. They might be
overkill unless you have a lot of text to search:
http://whoosh.ca/
http://lucene.apache.org/pylucene/
http://pypi.python.org/pypi/pyswish/20080920

Kent


More information about the Tutor mailing list