AttachContextGenerator (Apache OpenNLP Tools 2.5.9 API)
Description: declaration: package: opennlp.tools.parser.treeinsert, class: AttachContextGenerator

# Class AttachContextGenerator

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

public class AttachContextGenerator extends AbstractContextGenerator
Generates predictive contexts for deciding how constituents should be attached.

See Also:
  - `AbstractContextGenerator`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AttachContextGenerator(Set<String> punctSet)`
  Instantiates an `AttachContextGenerator` for making decisions about attachments.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String[]`
  `getContext(Object o)`
  `String[]`
  `getContext(Parse[] constituents, int index, List<Parse> rightFrontier, int rfi)`
  Finds the predictive contextual features about an attachment.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### AttachContextGenerator

    public AttachContextGenerator(Set<String> punctSet)
    Instantiates an `AttachContextGenerator` for making decisions about attachments.

- ## Method Details

  - ### getContext

    public String[] getContext(Object o)

  - ### getContext

    public String[] getContext(Parse[] constituents, int index, List<Parse> rightFrontier, int rfi)
    Finds the predictive contextual features about an attachment.
    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.