SkillAgentSearch skills...

Pywumanber

Python bindings and utilities created with ctypes for wrapping a C implementation of the Wu Manber search algorithm

Install / Use

/learn @cfarrell1980/Pywumanber
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Installation

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") wm.search_text()

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' http://de.wikipedia.de/wiki/Gesetz

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

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

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:

https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

Related Skills

View on GitHub
GitHub Stars7
CategoryDevelopment
Updated1y ago
Forks9

Languages

C

Security Score

70/100

Audited on Jan 26, 2025

No findings