Class ParserEventStream

java.lang.Object
opennlp.tools.util.AbstractEventStream<opennlp.tools.parser.Parse>
opennlp.tools.parser.AbstractParserEventStream
opennlp.tools.parser.chunking.ParserEventStream
All Implemented Interfaces:
AutoCloseable, opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event>

public class ParserEventStream extends AbstractParserEventStream
Wrapper class for one of four shift-reduce parser event streams. The particular event type is specified at construction.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ParserEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.parser.Parse> d, opennlp.tools.parser.HeadRules rules, opennlp.tools.parser.ParserEventTypeEnum etype)
    Instantiates a ParserEventStream based on the specified data stream of the type using head rules.
    ParserEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.parser.Parse> d, opennlp.tools.parser.HeadRules rules, opennlp.tools.parser.ParserEventTypeEnum etype, Dictionary dict)
    Instantiates a ParserEventStream based on the specified data stream of the type using head rules.
  • Method Summary

    Modifier and Type
    Method
    Description
    static opennlp.tools.parser.Parse[]
    reduceChunks(opennlp.tools.parser.Parse[] chunks, int ci, opennlp.tools.parser.Parse parent)
     

    Methods inherited from class opennlp.tools.parser.AbstractParserEventStream

    getInitialChunks

    Methods inherited from class opennlp.tools.util.AbstractEventStream

    close, read, reset

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParserEventStream

      public ParserEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.parser.Parse> d, opennlp.tools.parser.HeadRules rules, opennlp.tools.parser.ParserEventTypeEnum etype, Dictionary dict)
      Instantiates a ParserEventStream based on the specified data stream of the type using head rules.
      Parameters:
      d - A 1-parse-per-line Penn Treebank Style parse.
      rules - The head rules to use.
      etype - The type of events desired.
      dict - A tri-gram Dictionary to reduce feature generation.
      See Also:
      • ParserEventTypeEnum
    • ParserEventStream

      public ParserEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.parser.Parse> d, opennlp.tools.parser.HeadRules rules, opennlp.tools.parser.ParserEventTypeEnum etype)
      Instantiates a ParserEventStream based on the specified data stream of the type using head rules.
      Parameters:
      d - A 1-parse-per-line Penn Treebank Style parse.
      rules - The head rules to use.
      etype - The type of events desired.
      See Also:
      • ParserEventTypeEnum
  • Method Details

    • reduceChunks

      public static opennlp.tools.parser.Parse[] reduceChunks(opennlp.tools.parser.Parse[] chunks, int ci, opennlp.tools.parser.Parse parent)