Python bindings and utilities created with ctypes for wrapping a C implementation of the Wu Manber search algorithm
Switch branches/tags
Nothing to show
Pull request Compare This branch is even with cfarrell1980:master.
Latest commit fa147b4 Sep 28, 2011 @cfarrell1980 cfarrell1980 Fix zypper link


Use `zypper in python-pywumanber`. Currently, this lives in home:babelworx:python

**Using pywumanbver**
The following code should do an easy search:

from pywumanber import WuManber
wm = WuManber(['list','of','keywords','you','want','to','find'],"text in which you want to search")

When you initialise a WuManber object you must pass the keywords and the string. This can be done in
a number of ways.

To pass the keywords you can use:
 - a list
 - a comma separated string
 - a file with one keyword per line

To pass the text you can use:
 - a file (absolute path to file)
 - a URL (uses urllib to get the contents)
 - a string

**Using the pywu script**
To make usage of pywumanber a little easier and to provide a demo a script called pywu is included
in python-pywumanber. This is installed to /usr/bin by the rpm. Use it like this:

``pywu 'gesetz,recht,freiheit' /your/text/file.txt``

``pywu /your/keyword/file.txt /your/text/file.txt``

``pywu /your/keyword/file.txt "a string can also be passed directly on the commandline"``

``pywu 'gesetz,recht,freiheit'``

You can also modify the behaviour of the search engine with flags such as -v and -c. The flags are:
 -v,--verbose Use this to actually return the results found
 -c,--case-sensitive Use this to make the search case sensitive

**Copyright, License, Authors**
# Copyright (c) 2011 Ciaran Farrell, Juergen Weigert
# All Rights Reserved.

# This program is free software; you can redistribute it and/ormodify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, see the followig website: