ParserEventStream (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.parser.chunking

## Class ParserEventStream

- java.lang.Object
- - opennlp.tools.util.AbstractEventStream<Parse>
  - - opennlp.tools.parser.AbstractParserEventStream
    - - opennlp.tools.parser.chunking.ParserEventStream

- All Implemented Interfaces:
    AutoCloseable, ObjectStream<Event>

      public class ParserEventStream
      extends AbstractParserEventStream

  Wrapper class for one of four parser event streams. The particular event stream is specified at construction.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParserEventStream(ObjectStream<Parse> d, HeadRules rules, ParserEventTypeEnum etype)`
    `ParserEventStream(ObjectStream<Parse> d, HeadRules rules, ParserEventTypeEnum etype, Dictionary dict)` Create an event stream based on the specified data stream of the specified type using the specified head rules.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Parse[]` | `reduceChunks(Parse[] chunks, int ci, 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 Detail

    - #### ParserEventStream

          public ParserEventStream(ObjectStream<Parse> d,
                                   HeadRules rules,
                                   ParserEventTypeEnum etype,
                                   Dictionary dict)

      Create an event stream based on the specified data stream of the specified type using the specified head rules.
      Parameters:
        `d` - A 1-parse-per-line Penn Treebank Style parse.
        `rules` - The head rules.
        `etype` - The type of events desired (tag, chunk, build, or check).
        `dict` - A tri-gram dictionary to reduce feature generation.

    - #### ParserEventStream

          public ParserEventStream(ObjectStream<Parse> d,
                                   HeadRules rules,
                                   ParserEventTypeEnum etype)

  - ### Method Detail

    - #### reduceChunks

          public static Parse[] reduceChunks(Parse[] chunks,
                                             int ci,
                                             Parse parent)

Copyright © 2026 The Apache Software Foundation. All rights reserved.