Giter Site home page Giter Site logo

luistung / pywumanber Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cfarrell1980/pywumanber

0.0 1.0 0.0 19 KB

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

Home Page: http://www.suse.com

License: GNU General Public License v2.0

Makefile 0.57% Python 31.94% C 67.48%

pywumanber's Introduction

**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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.