Class FragDiscardingPennTreeReader
- java.lang.Object
-
- edu.stanford.nlp.trees.PennTreeReader
-
- edu.stanford.nlp.trees.international.pennchinese.FragDiscardingPennTreeReader
-
- All Implemented Interfaces:
TreeReader,Closeable,AutoCloseable
public class FragDiscardingPennTreeReader extends PennTreeReader
- Author:
- Galen Andrew
-
-
Constructor Summary
Constructors Constructor Description FragDiscardingPennTreeReader(Reader in, TreeFactory tf, TreeNormalizer tn, Tokenizer<String> tk)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TreereadTree()Reads a single tree in standard Penn Treebank format from the input stream.-
Methods inherited from class edu.stanford.nlp.trees.PennTreeReader
close, main
-
-
-
-
Constructor Detail
-
FragDiscardingPennTreeReader
public FragDiscardingPennTreeReader(Reader in, TreeFactory tf, TreeNormalizer tn, Tokenizer<String> tk)
-
-
Method Detail
-
readTree
public Tree readTree() throws IOException
Description copied from class:PennTreeReaderReads a single tree in standard Penn Treebank format from the input stream. The method supports additional parentheses around the tree (an unnamed ROOT node) so long as they are balanced. If the token stream ends before the current tree is complete, then the method will throw anIOException.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
IOExceptionwill eventually be thrown.- Specified by:
readTreein interfaceTreeReader- Overrides:
readTreein classPennTreeReader- Returns:
- A single tree, or
nullat end of token stream. - Throws:
IOException- If I/O problem
-
-