magpy 0.3.0
Sponsored Links
magpy 0.3.0 Ranking & Summary
File size:
0.32 MB
Platform:
Any Platform
License:
GPL (GNU General Public License)
Price:
Downloads:
1332
Date added:
2006-03-01
Publisher:
Matthias Kramm
magpy 0.3.0 description
Magpy is a Python wrapper for the mg search engine.
magpy module features fast full text sarch, indexing and boolean queries.
Both mg and magpy are released under the GPL (General Public License).
Installation:
To install magpy from source, extract the archive magpy-*.tar.gz, and run the following commands:
./configure
python setup.py build
python setup.py install
Usage:
The following script demonstrates a simple search frontend:
#!/usr/bin/python
import mgindexer
import mgquery
import sys
store = mgquery.MGSearchStore("/tmp/data","alice")
while 1:
query = sys.stdin.readline()
q = store.newQuery(query)
print "Searching for",query,"(words",q.words(),")"
for docnum,ranking in q.execute():
print "Document",docnum,"matches (Ranking",ranking,")"
Before this works, you first have to create search store at (here) the location
"/tmp/data", with the name "alice".
The following script creates such a store from a raw text file, which it splits into individual documents by splitting it into paragraphs.
#!/usr/bin/python
import mgindexer
fi = open("alice13a.txt", "rb")
fo = open("alice13a.splitted.txt", "wb")
for line in fi.readlines():
# split the file on the paragraph boundaries
if line.strip() == "":
fo.write(mgindexer.SEPARATOR)
else:
fo.write(line)
fo.close()
fi.close()
mgindexer.makeindex("alice13a.splitted.txt", "/tmp/data/", "alice")
If you have many individual documents you would like to run a search on, the following script is probably closer to what you need (notice it creates a new collection of the name "files", so you have to substitute "alice" by "files" in the example query script above):
#!/usr/bin/python
import mgindexer
import os
PATH = "files/"
fo = open("searchdata.txt", "wb")
for file in os.listdir(PATH):
if os.path.isfile(PATH + file):
# copy file
fi = open(PATH + file, "rb")
for line in fi.readlines():
fo.write(line)
# write document boundary
fo.write(mgindexer.SEPARATOR)
fo.close()
mgindexer.makeindex("searchdata.txt", "/tmp/data", "files")
Enhancements:
- This release adds support for wildcard search (truncation).
- Document types that have delimiters different from whitespace are now supported.
magpy module features fast full text sarch, indexing and boolean queries.
Both mg and magpy are released under the GPL (General Public License).
Installation:
To install magpy from source, extract the archive magpy-*.tar.gz, and run the following commands:
./configure
python setup.py build
python setup.py install
Usage:
The following script demonstrates a simple search frontend:
#!/usr/bin/python
import mgindexer
import mgquery
import sys
store = mgquery.MGSearchStore("/tmp/data","alice")
while 1:
query = sys.stdin.readline()
q = store.newQuery(query)
print "Searching for",query,"(words",q.words(),")"
for docnum,ranking in q.execute():
print "Document",docnum,"matches (Ranking",ranking,")"
Before this works, you first have to create search store at (here) the location
"/tmp/data", with the name "alice".
The following script creates such a store from a raw text file, which it splits into individual documents by splitting it into paragraphs.
#!/usr/bin/python
import mgindexer
fi = open("alice13a.txt", "rb")
fo = open("alice13a.splitted.txt", "wb")
for line in fi.readlines():
# split the file on the paragraph boundaries
if line.strip() == "":
fo.write(mgindexer.SEPARATOR)
else:
fo.write(line)
fo.close()
fi.close()
mgindexer.makeindex("alice13a.splitted.txt", "/tmp/data/", "alice")
If you have many individual documents you would like to run a search on, the following script is probably closer to what you need (notice it creates a new collection of the name "files", so you have to substitute "alice" by "files" in the example query script above):
#!/usr/bin/python
import mgindexer
import os
PATH = "files/"
fo = open("searchdata.txt", "wb")
for file in os.listdir(PATH):
if os.path.isfile(PATH + file):
# copy file
fi = open(PATH + file, "rb")
for line in fi.readlines():
fo.write(line)
# write document boundary
fo.write(mgindexer.SEPARATOR)
fo.close()
mgindexer.makeindex("searchdata.txt", "/tmp/data", "files")
Enhancements:
- This release adds support for wildcard search (truncation).
- Document types that have delimiters different from whitespace are now supported.
magpy 0.3.0 Screenshot
magpy 0.3.0 Keywords
Bookmark magpy 0.3.0
magpy 0.3.0 Copyright
WareSeeker periodically updates pricing and software information of magpy 0.3.0 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of magpy 0.3.0 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Mptn is a library providing a pattern matching mechanism similar to regular expressions. Free Download
ps3 is a utility for monitoring process activity on a Linux machine. Free Download
GvTags is a lightweight yet powerful tag library and template engine for the dynamic programming language Groovy. Free Download
GTKmonop project is a client for Rob Kapers monopd monopoly daemon. Free Download
libmng-py is a Python wrapper for libmng. Free Download
kdsing is a project that searches in words list (for translations). Free Download
jp2 is a wrapper for GNU cpp, Javac, and GCJ that runs cpp on .jaha files, converting them to .java. Free Download
JDJ is the music player for friends DJs. Free Download
Latest Software
Popular Software
Favourite Software