Package opennlp.tools.postag
Class ConfigurablePOSContextGenerator
java.lang.Object
opennlp.tools.postag.ConfigurablePOSContextGenerator
- All Implemented Interfaces:
POSContextGenerator,BeamSearchContextGenerator<String>
A context generator for the POS Tagger.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigurablePOSContextGenerator(int cacheSize, AdaptiveFeatureGenerator featureGenerator) Initializes the current instance.ConfigurablePOSContextGenerator(AdaptiveFeatureGenerator featureGenerator) Initializes the current instance. -
Method Summary
Modifier and TypeMethodDescriptionString[]getContext(int index, String[] tokens, String[] tags, Object[] additionalContext) Returns the context for making a pos tag decision at the specified token index given the specified tokens and previous tags.
-
Constructor Details
-
ConfigurablePOSContextGenerator
Initializes the current instance.- Parameters:
cacheSize-
-
ConfigurablePOSContextGenerator
Initializes the current instance.
-
-
Method Details
-
getContext
Returns the context for making a pos tag decision at the specified token index given the specified tokens and previous tags.- Specified by:
getContextin interfaceBeamSearchContextGenerator<String>- Specified by:
getContextin interfacePOSContextGenerator- Parameters:
index- The index of the token for which the context is provided.tokens- The tokens in the sentence.tags- The tags assigned to the previous words in the sentence.additionalContext- Any addition context specific to a class implementing this interface.- Returns:
- The context for making a pos tag decision at the specified token index given the specified tokens and previous tags.
-