makesamplecorpus
index
/home/max/LRApy/makesamplecorpus.py

Project: LRApy
Author: Max Jakob (max.jakob@web.de)
Module: makesamplecorpus
Module Description: Creates a small sample corpus, including index files,
for testing puposes.
 
Version: 1.0.1
Last change: 2007-01-13
 
Copyright 2007 by Max Jakob.
This code is released under the GNU GPL. See the accompanying LICENSE file.
 
Embedded documentation can be translated with the Python pydoc module.

 
Modules
       
indexCorpus
os
random
sys

 
Functions
       
getCorpusString(taskFile, corpusSize)
Returns a random corpus string for testing the LRA, using the word
pairs in <taskFile> as input. <corpusSize> is the number of times one
word pair occurs. To every word pair a random number (zero to four)
of intervening words (just three kinds of non-sense characters) is added.
The order of the two words is also random.
makeSampleCorpus(corpusDir, taskFile, corpusSize)
Makes a testing corpus including word and file indices in
<corpusDir>, using the word pairs in <taskFile> as input.
<corpusSize> is passed to getCorpusString.

 
Data
        CORPUS_DIR = 'samplecorpus'