Class CheckContextGenerator
java.lang.Object
opennlp.tools.parser.AbstractContextGenerator
opennlp.tools.parser.treeinsert.CheckContextGenerator
Generates predictive context for deciding when a constituent is complete.
- See Also:
-
Field Summary
FieldsFields inherited from class AbstractContextGenerator
EOS, punctSet, useLabel, zeroBackOff -
Constructor Summary
ConstructorsConstructorDescriptionCheckContextGenerator(Set<String> punctSet) Instantiates aCheckContextGeneratorfor making decisions using apunctSet. -
Method Summary
Modifier and TypeMethodDescriptionString[]getContext(Object o) String[]getContext(Parse parent, Parse[] constituents, int index, boolean trimFrontier) Finds the predictive context used to determine how constituent at the specifiedindexshould be combined with aparentconstituent.Methods inherited from class AbstractContextGenerator
checkcons, checkcons, cons, cons2, cons3, consbo, getFrontierNodes, production, punct, punctbo, surround
-
Field Details
-
leftNodes
-
-
Constructor Details
-
CheckContextGenerator
Instantiates aCheckContextGeneratorfor making decisions using apunctSet.- Parameters:
punctSet- A set of punctuation symbols to be used during context generation.
-
-
Method Details
-
getContext
-
getContext
Finds the predictive context used to determine how constituent at the specifiedindexshould be combined with aparentconstituent.- Parameters:
parent- Theparentelement.constituents- Theconstituentswhich have yet to be combined into new constituents.index- The index of the constituent which is being considered.trimFrontier- Whether the frontier should be trimmed, or not.- Returns:
- The context for deciding whether a new constituent should be created.
-