NameContextGenerator (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.namefind

## Interface NameContextGenerator

- All Superinterfaces:
    BeamSearchContextGenerator<String>
  All Known Implementing Classes:
    DefaultNameContextGenerator

      public interface NameContextGenerator
      extends BeamSearchContextGenerator<String>

  Interface for generating the context for an name finder by specifying a set of geature generators.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addFeatureGenerator(AdaptiveFeatureGenerator generator)` Adds a feature generator to this set of feature generators.
    `void` | `clearAdaptiveData()` Informs all the feature generators for a name finder that the context of the adaptive data (typically a document) is no longer valid.
    `void` | `updateAdaptiveData(String[] tokens, String[] outcomes)` Informs all the feature generators for a name finder that the specified tokens have been classified with the coorisponds set of specified outcomes.

    - ### Methods inherited from interface opennlp.tools.util.BeamSearchContextGenerator

      `getContext`

- - ### Method Detail

    - #### addFeatureGenerator

          void addFeatureGenerator(AdaptiveFeatureGenerator generator)

      Adds a feature generator to this set of feature generators.
      Parameters:
        `generator` - The feature generator to add.

    - #### updateAdaptiveData

          void updateAdaptiveData(String[] tokens,
                                  String[] outcomes)

      Informs all the feature generators for a name finder that the specified tokens have been classified with the coorisponds set of specified outcomes.
      Parameters:
        `tokens` - The tokens of the sentence or other text unit which has been processed.
        `outcomes` - The outcomes associated with the specified tokens.

    - #### clearAdaptiveData

          void clearAdaptiveData()

      Informs all the feature generators for a name finder that the context of the adaptive data (typically a document) is no longer valid.

Copyright © 2026 The Apache Software Foundation. All rights reserved.