Package opennlp.tools.util.featuregen
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReleases the calling thread's per-thread context slot.voidcreateFeatures(List<String> features, String[] tokens, int index, String[] preds) voidsetCurrentContext(String[][] context) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface opennlp.tools.util.featuregen.AdaptiveFeatureGenerator
clearAdaptiveData, updateAdaptiveData
-
Constructor Details
-
AdditionalContextFeatureGenerator
public AdditionalContextFeatureGenerator()
-
-
Method Details
-
createFeatures
- Specified by:
createFeaturesin interfaceopennlp.tools.util.featuregen.AdaptiveFeatureGenerator
-
setCurrentContext
-
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 theThreadLocalentry.Same lifecycle contract as the
clearThreadLocalState()methods on the ME classes that embed this generator (currentlyNameFinderME).
-