public class FragDiscardingPennTreeReader extends PennTreeReader
Constructor and Description |
---|
FragDiscardingPennTreeReader(Reader in,
TreeFactory tf,
TreeNormalizer tn,
Tokenizer<String> tk) |
Modifier and Type | Method and Description |
---|---|
Tree |
readTree()
Reads a single tree in standard Penn Treebank format from the
input stream.
|
close, main
public FragDiscardingPennTreeReader(Reader in, TreeFactory tf, TreeNormalizer tn, Tokenizer<String> tk)
public Tree readTree() throws IOException
PennTreeReader
IOException
.
Note that the method will skip malformed trees and attempt to
read additional trees from the input stream. It is possible, however,
that a malformed tree will corrupt the token stream. In this case,
an IOException
will eventually be thrown.
readTree
in interface TreeReader
readTree
in class PennTreeReader
null
at end of token stream.IOException
- If I/O problem