public class GrefenstetteMain extends GenericMain
Grefenstette
algorithm from the
command line. This class provides several options:
-s
, --sentenceFile=FILE[,FILE...]
a file where each
line is a single sentence
-o
, --outputFormat=
text|binary} Specifies the
output formatting to use when generating the semantic space (.sspace
) file. See SemanticSpaceUtils
for format details.
-v
, --verbose
prints verbose output
-w
, --overwrite=BOOL
specifies whether to overwrite
the existing output
An invocation will produce one file as output greffenstette.sspace
.
If overwrite
was set to true
, this file will be replaced for
each new semantic space. Otherwise, a new output file of the format greffenstette<number>.sspace
will be created, where <number>
is a unique identifier for that program's invocation. The output
file will be placed in the directory specified on the command line.
Grefenstette
argOptions, EXT, isMultiThreaded, verbose
Modifier and Type | Method and Description |
---|---|
protected void |
addExtraOptions(ArgOptions options)
Currently adds no extra options
|
protected Iterator<Document> |
getDocumentIterator()
Returns the iterator for all of the documents specified on the command
line or throws an
Error if no documents are specified. |
SemanticSpace |
getSpace()
Returns an instance of the
Grefenstette algorithm. |
static void |
main(String[] args) |
protected ArgOptions |
setupOptions()
Adds the options for running the
Grefenstette algorithm |
addCorpusReaderIterators, addDocIterators, addFileIterators, getAlgorithmSpecifics, getSpaceFormat, handleExtraOptions, loadValidTermSet, parseDocumentsMultiThreaded, parseDocumentsSingleThreaded, postProcessing, processDocumentsAndSpace, run, saveSSpace, setupProperties, usage, verbose, verbose
protected ArgOptions setupOptions()
Grefenstette
algorithmsetupOptions
in class GenericMain
protected void addExtraOptions(ArgOptions options)
addExtraOptions
in class GenericMain
options
- the ArgOptions object which more main specific options can
be added to.GenericMain.handleExtraOptions()
protected Iterator<Document> getDocumentIterator() throws IOException
GenericMain
Error
if no documents are specified. If
subclasses should override either GenericMain.addFileIterators(java.util.Collection<java.util.Iterator<edu.ucla.sspace.text.Document>>, java.lang.String[])
or GenericMain.addDocIterators(java.util.Collection<java.util.Iterator<edu.ucla.sspace.text.Document>>, java.lang.String[])
if they use different file format. Alternatively,
oen can implement a CorpusReader
and use the
-R
option.getDocumentIterator
in class GenericMain
IOException
public SemanticSpace getSpace()
Grefenstette
algorithm.getSpace
in class GenericMain
public static void main(String[] args)
Copyright © 2012. All Rights Reserved.