|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.stanford.nlp.trees.TreeReader
A TreeReader adds functionality to another Reader
by reading in Trees, or some descendant class. Like other standard
classes, this class does not provide buffering, so for high
performance, a typical invocation of TreeReader would be
something like:
TreeReader tr = new TreeReader(new BufferedReader(new FileReader(file)),
myTreeFactory);
| Constructor Summary | |
TreeReader(Reader in)
Read parse trees from a Reader. |
|
TreeReader(Reader in,
TreeFactory tf)
Read parse trees from a Reader |
|
TreeReader(Reader in,
TreeFactory tf,
TreeNormalizer tn)
Read parse trees from a Reader |
|
TreeReader(Reader in,
TreeFactory tf,
TreeNormalizer tn,
StreamTokenizer st)
Read parse trees from a stream |
|
| Method Summary | |
void |
close()
Close the Reader behind this TreeReader |
static void |
main(String[] args)
Loads treebank data from first argument and prints it. |
Tree |
readTree()
Returns a single tree, which is in standard Penn Treebank format, with or without an additional set of parens around it (an unnamed ROOT node). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TreeReader(Reader in)
Reader.
For the defaulted arguments, you get a
SimpleTreeFactory, no TreeNormalizer, and
a PennTreebankStreamTokenizer.
in - the Reader
public TreeReader(Reader in,
TreeFactory tf)
Reader
in - the Readertf - TreeFactory -- factory to create some kind of Tree
public TreeReader(Reader in,
TreeFactory tf,
TreeNormalizer tn)
in - input streamtf - TreeFactory -- factory to create some kind of Treetn - the method of normalizing trees
public TreeReader(Reader in,
TreeFactory tf,
TreeNormalizer tn,
StreamTokenizer st)
in - input streamtf - TreeFactory -- factory to create some kind of Treetn - the method of normalizing treesst - StreamTokenizer that divides up InputStream| Method Detail |
public Tree readTree()
throws IOException
IOException
public void close()
throws IOException
TreeReader
IOExceptionpublic static void main(String[] args)
args - array of command-line arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||