Class ParserFactory
java.lang.Object
opennlp.tools.parser.ParserFactory
-
Method Summary
Modifier and TypeMethodDescriptionstatic opennlp.tools.parser.Parsercreate(ParserModel model) Instantiates aParservia a givenmodeland default configuration parameters (see:AbstractBottomUpParser).static opennlp.tools.parser.Parsercreate(ParserModel model, int beamSize, double advancePercentage) Instantiates aParservia a givenmodeland other configuration parameters.static opennlp.tools.parser.Parsercreate(ParserModel model, opennlp.tools.postag.POSTagger tagger, opennlp.tools.chunker.Chunker chunker, int beamSize, double advancePercentage) Instantiates aParserfor theParserTypeof a givenmodelthat tags and chunks with a caller-suppliedPOSTaggerandChunker.
-
Method Details
-
create
public static opennlp.tools.parser.Parser create(ParserModel model, int beamSize, double advancePercentage) Instantiates aParservia a givenmodeland other configuration parameters.- Parameters:
model- TheParserModelto use. Must not benull.beamSize- The number of different parses kept during parsing. Must be at least1.advancePercentage- The minimal amount of probability mass which advanced outcomes must represent. Only outcomes which contribute to the topadvancePercentagewill be explored. Must be greater than0and at most1.- Returns:
- A valid
Parserinstance. - Throws:
IllegalArgumentException- Thrown ifmodelisnullor a parameter is out of range.IllegalStateException- Thrown if theParserTypeis not supported.- See Also:
-
create
public static opennlp.tools.parser.Parser create(ParserModel model, opennlp.tools.postag.POSTagger tagger, opennlp.tools.chunker.Chunker chunker, int beamSize, double advancePercentage) Instantiates aParserfor theParserTypeof a givenmodelthat tags and chunks with a caller-suppliedPOSTaggerandChunker. The build, attach and check models and the head rules are taken frommodel; its tagger and chunker models are not used.- Parameters:
model- TheParserModelto use. Must not benull.tagger- ThePOSTaggerused to tag. Must not benull.chunker- TheChunkerused to chunk. Must not benull.beamSize- The number of different parses kept during parsing. Must be at least1.advancePercentage- The minimal amount of probability mass which advanced outcomes must represent. Only outcomes which contribute to the topadvancePercentagewill be explored. Must be greater than0and at most1.- Returns:
- A valid
Parserinstance. - Throws:
IllegalArgumentException- Thrown if a parameter isnullor out of range.IllegalStateException- Thrown if theParserTypeis not supported.- Since:
- 3.0.0
- See Also:
-
create
Instantiates aParservia a givenmodeland default configuration parameters (see:AbstractBottomUpParser).- Parameters:
model- TheParserModelto use.- Returns:
- A valid
Parserinstance. - Throws:
IllegalArgumentException- Thrown ifmodelisnull.IllegalStateException- Thrown if theParserTypeis not supported.- See Also:
-