public class BaselineContextGenerator extends Object implements opennlp.tools.postag.POSContextGenerator
@DefaultPOSContextGenerator. These extra features require at least
2GB memory to train, more if training data is large.| Constructor and Description |
|---|
BaselineContextGenerator(opennlp.tools.dictionary.Dictionary aDict)
Initializes the current instance.
|
BaselineContextGenerator(int cacheSize,
opennlp.tools.dictionary.Dictionary aDict)
Initializes the current instance.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
getContext(int index,
Object[] tokens,
String[] tags)
Returns the context for making a pos tag decision at the specified token
index given the specified tokens and previous tags.
|
String[] |
getContext(int index,
String[] sequence,
String[] priorDecisions,
Object[] additionalContext) |
protected static String[] |
getPrefixes(String lex)
Obtain prefixes for each token.
|
protected static String[] |
getSuffixes(String lex)
Obtain suffixes for each token.
|
public BaselineContextGenerator(opennlp.tools.dictionary.Dictionary aDict)
aDict - the dictionarypublic BaselineContextGenerator(int cacheSize,
opennlp.tools.dictionary.Dictionary aDict)
cacheSize - the cache sizeaDict - the dictionaryprotected static String[] getPrefixes(String lex)
lex - the current wordprotected static String[] getSuffixes(String lex)
lex - the wordpublic final String[] getContext(int index, String[] sequence, String[] priorDecisions, Object[] additionalContext)
getContext in interface opennlp.tools.postag.POSContextGeneratorgetContext in interface opennlp.tools.util.BeamSearchContextGenerator<String>public final String[] getContext(int index, Object[] tokens, String[] tags)
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.Copyright © 2016 IXA pipes. All rights reserved.