Class BuildContextGenerator
java.lang.Object
opennlp.tools.parser.AbstractContextGenerator
opennlp.tools.parser.chunking.BuildContextGenerator
Generates predictive contexts for deciding how constituents should be combined.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]private Dictionaryprivate String[]private String[]Fields inherited from class AbstractContextGenerator
EOS, punctSet, useLabel, zeroBackOff -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates aBuildContextGeneratorfor making decisions about combining constituents.Instantiates aBuildContextGeneratorfor making decisions about combining constituents using aDictionary. -
Method Summary
Modifier and TypeMethodDescriptionString[]getContext(Object o) String[]getContext(Parse[] constituents, int index) Finds the predictive context used to determine how constituent at the specifiedindexshould be combined with other constituents.Methods inherited from class AbstractContextGenerator
checkcons, checkcons, cons, cons2, cons3, consbo, getFrontierNodes, production, punct, punctbo, surround
-
Field Details
-
dict
-
unigram
-
bigram
-
trigram
-
-
Constructor Details
-
BuildContextGenerator
public BuildContextGenerator()Instantiates aBuildContextGeneratorfor making decisions about combining constituents. -
BuildContextGenerator
Instantiates aBuildContextGeneratorfor making decisions about combining constituents using aDictionary.- Parameters:
dict- ADictionaryto be used during context generation.
-
-
Method Details
-
getContext
-
getContext
Finds the predictive context used to determine how constituent at the specifiedindexshould be combined with other constituents.- Parameters:
constituents- Theconstituentswhich have yet to be combined into new constituents.index- The index of the constituent which is being considered.- Returns:
- The context for building constituents at the specified
index.
-