ChunkContextGenerator (Apache OpenNLP :: Core :: Runtime 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.parser, class: ChunkContextGenerator

Package opennlp.tools.parser

# Class ChunkContextGenerator

java.lang.Object
opennlp.tools.parser.ChunkContextGenerator

All Implemented Interfaces:
  `opennlp.tools.chunker.ChunkerContextGenerator`, `opennlp.tools.util.BeamSearchContextGenerator<opennlp.tools.util.TokenTag>`

public class ChunkContextGenerator extends Object implements opennlp.tools.chunker.ChunkerContextGenerator
Creates predictive context for the pre-chunking phases of parsing.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ChunkContextGenerator()`
  Initializes a `ChunkContextGenerator` instance.
  `ChunkContextGenerator(int cacheSize)`
  Initializes a `ChunkContextGenerator` instance with a custom `cacheSize`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String[]`
  `getContext(int i, String[] words, String[] tags, String[] preds)`
  `String[]`
  `getContext(int index, opennlp.tools.util.TokenTag[] sequence, String[] priorDecisions, Object[] additionalContext)`

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

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

- ## Constructor Details

  - ### ChunkContextGenerator

    public ChunkContextGenerator()
    Initializes a `ChunkContextGenerator` instance.

  - ### ChunkContextGenerator

    public ChunkContextGenerator(int cacheSize)
    Initializes a `ChunkContextGenerator` instance with a custom `cacheSize`.
    Parameters:
      `cacheSize` - The cache size. Must be greater than `0` to have an effect.

- ## Method Details

  - ### getContext

    public String[] getContext(int i, String[] words, String[] tags, String[] preds)
    Specified by:
      `getContext` in interface `opennlp.tools.chunker.ChunkerContextGenerator`

  - ### getContext

    public String[] getContext(int index, opennlp.tools.util.TokenTag[] sequence, String[] priorDecisions, Object[] additionalContext)
    Specified by:
      `getContext` in interface `opennlp.tools.util.BeamSearchContextGenerator<opennlp.tools.util.TokenTag>`