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 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>