|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLBJ2.parse.FeatureVectorParser
public class FeatureVectorParser
This parser returns FeatureVectors deserialized out of the
first file passed to the constructor. In fact, this first file contains
only ints that index the features. The second file passed to
the constructor is the lexicon used to translate from ints to
Feature objects.
When run as a stand-alone program, this class takes the names of the
example and lexicon files as input on the command line and simply writes a
string representation of every example to STDOUT.
| Field Summary | |
|---|---|
protected java.lang.String |
exampleFileName
The name of the file to parse. |
protected java.io.DataInputStream |
in
Reader for file currently being parsed. |
protected Feature[] |
lexicon
The feature objects corresponding to the ints in the
example file. |
| Constructor Summary | |
|---|---|
protected |
FeatureVectorParser(java.lang.String exampleFile)
For internal use only. |
|
FeatureVectorParser(java.lang.String exampleFile,
Feature[] lexicon)
Creates the parser. |
|
FeatureVectorParser(java.lang.String exampleFile,
java.lang.String lexiconFile)
Creates the parser. |
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
Takes the names of the example and lexicon files as input on the command line and prints all the examples to STDOUT. |
java.lang.Object |
next()
Returns a FeatureVector deserialized out of the given file. |
void |
reset()
Resets the example file stream to the beginning. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.DataInputStream in
protected java.lang.String exampleFileName
protected Feature[] lexicon
ints in the
example file.
| Constructor Detail |
|---|
protected FeatureVectorParser(java.lang.String exampleFile)
exampleFile - The name of the file to parse.
public FeatureVectorParser(java.lang.String exampleFile,
Feature[] lexicon)
exampleFile - The name of the file to parse.lexicon - The lexicon.
public FeatureVectorParser(java.lang.String exampleFile,
java.lang.String lexiconFile)
exampleFile - The name of the file to parse.lexiconFile - The name of the lexicon file.| Method Detail |
|---|
public java.lang.Object next()
FeatureVector deserialized out of the given file.
next in interface Parserpublic void reset()
FeatureVectorParser with the same
constructor arguments, but this method avoids re-reading the lexicon.
reset in interface Parserpublic static void main(java.lang.String[] args)
STDOUT.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||