Class FragDiscardingPennTreeReader

    • Method Detail

      • readTree

        public Tree readTree()
                      throws IOException
        Description copied from class: PennTreeReader
        Reads 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 an 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.

        Specified by:
        readTree in interface TreeReader
        Overrides:
        readTree in class PennTreeReader
        Returns:
        A single tree, or null at end of token stream.
        Throws:
        IOException - If I/O problem