Class AdditionalContextFeatureGenerator

java.lang.Object
opennlp.tools.util.featuregen.AdditionalContextFeatureGenerator
All Implemented Interfaces:
opennlp.tools.util.featuregen.AdaptiveFeatureGenerator

@ThreadSafe public class AdditionalContextFeatureGenerator extends Object implements opennlp.tools.util.featuregen.AdaptiveFeatureGenerator
The AdditionalContextFeatureGenerator generates the context from the passed in additional context.
  • Constructor Details

    • AdditionalContextFeatureGenerator

      public AdditionalContextFeatureGenerator()
  • Method Details

    • createFeatures

      public void createFeatures(List<String> features, String[] tokens, int index, String[] preds)
      Specified by:
      createFeatures in interface opennlp.tools.util.featuregen.AdaptiveFeatureGenerator
    • setCurrentContext

      public void setCurrentContext(String[][] context)
    • clearForCurrentThread

      public void clearForCurrentThread()
      Releases the calling thread's per-thread context slot. Call when a worker thread is being returned to a pool, or when the enclosing component is being disposed in a container with classloader isolation, to avoid pinning the thread's context classloader via the ThreadLocal entry.

      Same lifecycle contract as the clearThreadLocalState() methods on the ME classes that embed this generator (currently NameFinderME).