Package opennlp.tools.parser.treeinsert
Class Parser
java.lang.Object
opennlp.tools.parser.AbstractBottomUpParser
opennlp.tools.parser.treeinsert.Parser
- All Implemented Interfaces:
- Parser
A built-attach 
Parser implementation.
 Nodes are built when their left-most child is encountered. Subsequent children are attached as daughters. Attachment is based on node in the right-frontier of the tree. After each attachment or building, nodes are assessed as either complete or incomplete. Complete nodes are no longer eligible for daughter attachment.
Complex modifiers which produce additional node levels of the same type are attached with sister-adjunction. Attachment can not take place higher in the right-frontier than an incomplete node.
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringOutcome used when a node should be attached as a daughter to another node.static final StringOutcome used when a node should be attached as a sister to another node.static final StringLabel used to distinguish build nodes from non-built nodes.static final StringOutcome used when a constituent needs an no additional parent node/building.static final StringOutcome used when a node should not be attached to another node.Fields inherited from class opennlp.tools.parser.AbstractBottomUpParserCOMPLETE, CONT, defaultAdvancePercentage, defaultBeamSize, INC_NODE, INCOMPLETE, OTHER, START, TOK_NODE, TOP_NODE
- 
Constructor SummaryConstructorsConstructorDescriptionParser(ParserModel model) Instantiates aParservia a givenmodel.Parser(ParserModel model, int beamSize, double advancePercentage) Instantiates aParservia a givenmodeland other configuration parameters.
- 
Method SummaryModifier and TypeMethodDescriptiongetRightFrontier(Parse root, Set<String> punctSet) Returns the right frontier of the specifiedtreewith nodes ordered from deepest to shallowest.static ParserModeltrain(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, int iterations, int cutoff) Starts a training of aParserModel.static ParserModeltrain(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, TrainingParameters mlParams) Starts a training of aParserModel.Methods inherited from class opennlp.tools.parser.AbstractBottomUpParserbuildDictionary, buildDictionary, collapsePunctuation, parse, parse, setErrorReporting, setParents
- 
Field Details- 
DONEOutcome used when a constituent needs an no additional parent node/building.- See Also:
 
- 
ATTACH_SISTEROutcome used when a node should be attached as a sister to another node.- See Also:
 
- 
ATTACH_DAUGHTEROutcome used when a node should be attached as a daughter to another node.- See Also:
 
- 
NON_ATTACHOutcome used when a node should not be attached to another node.- See Also:
 
- 
BUILTLabel used to distinguish build nodes from non-built nodes.- See Also:
 
 
- 
- 
Constructor Details- 
ParserInstantiates aParservia a givenmodeland other configuration parameters. Uses the default implementations ofPOSTaggerMEandChunkerME.- Parameters:
- model- The- ParserModelto use.
- beamSize- The number of different parses kept during parsing.
- advancePercentage- The minimal amount of probability mass which advanced outcomes must represent. Only outcomes which contribute to the top- advancePercentagewill be explored.
- Throws:
- IllegalStateException- Thrown if the- ParserTypeis not supported.
- See Also:
 
- 
ParserInstantiates aParservia a givenmodel. Uses the default implementations ofPOSTaggerMEandChunkerMEand default values forbeamSizeandadvancePercentage.- Parameters:
- model- The- ParserModelto use.
- Throws:
- IllegalStateException- Thrown if the- ParserTypeis not supported.
- See Also:
 
 
- 
- 
Method Details- 
getRightFrontierReturns the right frontier of the specifiedtreewith nodes ordered from deepest to shallowest.- Parameters:
- root- The- rootof the parse tree.
- punctSet- A set of punctuation symbols to be used.
- Returns:
- The right frontier of the specified parse tree.
 
- 
trainpublic static ParserModel train(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, TrainingParameters mlParams) throws IOException Starts a training of aParserModel.- Parameters:
- languageCode- An ISO conform language code.
- parseSamples- The- samplesas input.
- rules- The- HeadRulesto use.
- mlParams- The- parametersfor training.
- Returns:
- A valid ParserModel.
- Throws:
- IOException- Thrown if IO errors occurred during training.
 
- 
trainpublic static ParserModel train(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, int iterations, int cutoff) throws IOException Starts a training of aParserModel.- Parameters:
- languageCode- An ISO conform language code.
- parseSamples- The- samplesas input.
- rules- The- HeadRulesto use.
- iterations- The number of iterations to be conducted.
- cutoff- The cut-off parameter to be used.
- Returns:
- A valid ParserModel.
- Throws:
- IOException- Thrown if IO errors occurred during training.
 
 
-