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

opennlp.tools.parser.treeinsert

## Class AttachContextGenerator

- java.lang.Object
- - opennlp.tools.parser.AbstractContextGenerator
  - - opennlp.tools.parser.treeinsert.AttachContextGenerator

-     public class AttachContextGenerator
      extends AbstractContextGenerator

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AttachContextGenerator(Set<String> punctSet)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String[]` | `getContext(Object o)`
    `String[]` | `getContext(Parse[] constituents, int index, List<Parse> rightFrontier, int rfi)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AttachContextGenerator

          public AttachContextGenerator(Set<String> punctSet)

  - ### Method Detail

    - #### getContext

          public String[] getContext(Object o)

    - #### getContext

          public String[] getContext(Parse[] constituents,
                                     int index,
                                     List<Parse> rightFrontier,
                                     int rfi)

      Parameters:
        `constituents` - The constituents as they have been constructed so far.
        `index` - The constituent index of the node being attached.
        `rightFrontier` - The nodes which have been not attach to so far.
      Returns:
        A set of contextual features about this attachment.

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