Package opennlp.tools.postag
Klasse ConfigurablePOSContextGenerator
java.lang.Object
opennlp.tools.postag.ConfigurablePOSContextGenerator
- Alle implementierten Schnittstellen:
POSContextGenerator
,BeamSearchContextGenerator<String>
A configurable
context generator
for a POSTagger
.
This implementation makes use of AdaptiveFeatureGenerator
.- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungConfigurablePOSContextGenerator
(int cacheSize, AdaptiveFeatureGenerator featureGenerator) Initializes aConfigurablePOSContextGenerator
instance.ConfigurablePOSContextGenerator
(AdaptiveFeatureGenerator featureGenerator) Initializes aConfigurablePOSContextGenerator
instance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungString[]
getContext
(int index, String[] tokens, String[] tags, Object[] additionalContext) Returns the context for making a postag decision at the specified tokenindex
given the specifiedtokens
and previoustags
.
-
Konstruktordetails
-
ConfigurablePOSContextGenerator
Initializes aConfigurablePOSContextGenerator
instance. A cache size of0
will be used as default.- Parameter:
featureGenerator
- TheAdaptiveFeatureGenerator
to be used.
-
ConfigurablePOSContextGenerator
Initializes aConfigurablePOSContextGenerator
instance.- Parameter:
cacheSize
- The size of theCache
to set. Must be greater than0
to have an effect.featureGenerator
- TheAdaptiveFeatureGenerator
to be used.
-
-
Methodendetails
-
getContext
Returns the context for making a postag decision at the specified tokenindex
given the specifiedtokens
and previoustags
.- Angegeben von:
getContext
in SchnittstelleBeamSearchContextGenerator<String>
- Angegeben von:
getContext
in SchnittstellePOSContextGenerator
- Parameter:
index
- The index of the token for which the context is provided.tokens
- The tokens representing a sentence.tags
- The tags assigned to the previous words in the sentence.additionalContext
- The context for additional information.- Gibt zurück:
- The context for making a postag decision at the specified token
index
given the specifiedtokens
and previoustags
.
-