Package opennlp.tools.postag
Klasse DefaultPOSContextGenerator
java.lang.Object
opennlp.tools.postag.DefaultPOSContextGenerator
- Alle implementierten Schnittstellen:
POSContextGenerator,BeamSearchContextGenerator<String>
A default
context generator for a POSTagger.- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefaultPOSContextGenerator(int cacheSize, Dictionary dict) Initializes aDefaultPOSContextGeneratorinstance.Initializes aDefaultPOSContextGeneratorinstance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungString[]getContext(int index, Object[] tokens, String[] tags) Returns the context for making a postag decision at the specified tokenindexgiven the specifiedtokensand previoustags.String[]getContext(int index, String[] sequence, String[] priorDecisions, Object[] additionalContext) Returns the context for making a postag decision at the specified tokenindexgiven the specifiedtokensand previoustags.
-
Konstruktordetails
-
DefaultPOSContextGenerator
Initializes aDefaultPOSContextGeneratorinstance. A cache size of0will be used as default.- Parameter:
dict- TheDictionaryto be used.
-
DefaultPOSContextGenerator
Initializes aDefaultPOSContextGeneratorinstance.- Parameter:
cacheSize- The size of theCacheto set. Must be greater than0to have an effect.dict- TheDictionaryto be used.
-
-
Methodendetails
-
getContext
public String[] getContext(int index, String[] sequence, String[] priorDecisions, Object[] additionalContext) Returns the context for making a postag decision at the specified tokenindexgiven the specifiedtokensand previoustags.- Angegeben von:
getContextin SchnittstelleBeamSearchContextGenerator<String>- Angegeben von:
getContextin SchnittstellePOSContextGenerator- Parameter:
index- The index of the token for which the context is provided.sequence- The token sequence representing a sentence.priorDecisions- 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
indexgiven the specifiedtokensand previoustags.
-
getContext
Returns the context for making a postag decision at the specified tokenindexgiven the specifiedtokensand previoustags.- 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.- Gibt zurück:
- The context for making a postag decision at the specified token
indexgiven the specifiedtokensand previoustags.
-