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:
  • 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.