Package opennlp.tools.parser.chunking

# Class BuildContextGenerator

java.lang.Object
opennlp.tools.parser.AbstractContextGenerator
opennlp.tools.parser.chunking.BuildContextGenerator

public class BuildContextGenerator extends AbstractContextGenerator
Generates predictive contexts for deciding how constituents should be combined.

See Also:
  - `AbstractContextGenerator`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BuildContextGenerator()`
  Instantiates a `BuildContextGenerator` for making decisions about combining constituents.
  `BuildContextGenerator(Dictionary dict)`
  Instantiates a `BuildContextGenerator` for making decisions about combining constituents using a `Dictionary`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String[]`
  `getContext(Object o)`
  `String[]`
  `getContext(Parse[] constituents, int index)`
  Finds the predictive context used to determine how constituent at the specified `index` should be combined with other constituents.

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

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

- ## Constructor Details

  - ### BuildContextGenerator

    public BuildContextGenerator()
    Instantiates a `BuildContextGenerator` for making decisions about combining constituents.

  - ### BuildContextGenerator

    public BuildContextGenerator(Dictionary dict)
    Instantiates a `BuildContextGenerator` for making decisions about combining constituents using a `Dictionary`.
    Parameters:
      `dict` - A `Dictionary` to be used during context generation.

- ## Method Details

  - ### getContext

    public String[] getContext(Object o)

  - ### getContext

    public String[] getContext(Parse[] constituents, int index)
    Finds the predictive context used to determine how constituent at the specified `index` should be combined with other constituents.
    Parameters:
      `constituents` - The `constituents` which have yet to be combined into new constituents.
      `index` - The index of the constituent which is being considered.
    Returns:
      The context for building constituents at the specified `index`.