-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathREADME
61 lines (44 loc) · 2.14 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
**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