Package opennlp.tools.parser
Class ParserModel
java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.parser.ParserModel
- All Implemented Interfaces:
- Serializable,- ArtifactProvider
This is the default 
ParserModel implementation.- See Also:
- 
Field SummaryFields inherited from class opennlp.tools.util.model.BaseModelTRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY
- 
Constructor SummaryConstructorsConstructorDescriptionParserModel(File modelFile) Initializes aParserModelinstance via a validFile.Initializes aParserModelinstance via a validInputStream.ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType) Initializes aParserModelinstance via given parameters.ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType, Map<String, String> manifestInfoEntries) Initializes aParserModelinstance via given parameters.ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType type, Map<String, String> manifestInfoEntries) Initializes aParserModelinstance via given parameters.ParserModel(URL modelURL) Initializes aParserModelinstance via a validURL.ParserModel(Path modelPath) Initializes aParserModelinstance via a validPath.
- 
Method SummaryModifier and TypeMethodDescriptionbooleaninthashCode()updateBuildModel(MaxentModel buildModel) Instantiates a newParserModelinstance from the existing configuration with the specifiedbuildModelfor exchange.updateCheckModel(MaxentModel checkModel) Instantiates a newParserModelinstance from the existing configuration with the specifiedcheckModelfor exchange.updateChunkerModel(ChunkerModel chunkModel) Instantiates a newParserModelinstance from the existing configuration with the specifiedchunkModelfor exchange.updateTaggerModel(POSModel taggerModel) Instantiates a newParserModelinstance from the existing configuration with the specifiedtaggerModelfor exchange.Methods inherited from class opennlp.tools.util.model.BaseModelgetArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
- 
Constructor Details- 
ParserModelpublic ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType, Map<String, String> manifestInfoEntries) Initializes aParserModelinstance via given parameters.- Parameters:
- languageCode- An ISO conform language code.
- buildModel- A valid- MaxentModelused to build.
- checkModel- A valid- MaxentModelused to check.
- attachModel- A valid- MaxentModelused to attach.
- parserTagger- A valid- POSModelto parse.
- chunkerTagger- A valid- ChunkerModelto chunk.
- headRules- The- HeadRulesto to use for parsing.
- modelType- The- ParserTypeto use.
- manifestInfoEntries- Additional information kept in the manifest.
 
- 
ParserModelpublic ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType) Initializes aParserModelinstance via given parameters.- Parameters:
- languageCode- An ISO conform language code.
- buildModel- A valid- MaxentModelused to build.
- checkModel- A valid- MaxentModelused to check.
- parserTagger- A valid- POSModelto parse.
- chunkerTagger- A valid- ChunkerModelto chunk.
- headRules- The- HeadRulesto to use for parsing.
- modelType- The- ParserTypeto use.
 
- 
ParserModelpublic ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType type, Map<String, String> manifestInfoEntries) Initializes aParserModelinstance via given parameters.- Parameters:
- languageCode- An ISO conform language code.
- buildModel- A valid- MaxentModelused to build.
- checkModel- A valid- MaxentModelused to check.
- parserTagger- A valid- POSModelto parse.
- chunkerTagger- A valid- ChunkerModelto chunk.
- headRules- The- HeadRulesto to use for parsing.
- type- The- ParserTypeto use.
- manifestInfoEntries- Additional information kept in the manifest.
 
- 
ParserModelInitializes aParserModelinstance via a validInputStream.- Parameters:
- in- The- InputStreamused for loading the model.
- Throws:
- IOException- Thrown if IO errors occurred during initialization.
 
- 
ParserModelInitializes aParserModelinstance via a validFile.- Parameters:
- modelFile- The- Fileused for loading the model.
- Throws:
- IOException- Thrown if IO errors occurred during initialization.
 
- 
ParserModelInitializes aParserModelinstance via a validPath.- Parameters:
- modelPath- The- Pathused for loading the model.
- Throws:
- IOException- Thrown if IO errors occurred during initialization.
 
- 
ParserModelInitializes aParserModelinstance via a validURL.- Parameters:
- modelURL- The- URLused for loading the model.
- Throws:
- IOException- Thrown if IO errors occurred during initialization.
 
 
- 
- 
Method Details- 
getParserType- Returns:
- Retrieves the ParserTypeas configured in the manifest.
 
- 
getBuildModel- Returns:
- Retrieves the build modelas configured in the manifest.
 
- 
getCheckModel- Returns:
- Retrieves the check modelas configured in the manifest.
 
- 
getAttachModel- Returns:
- Retrieves the attach modelas configured in the manifest.
 
- 
getParserTaggerModel- Returns:
- Retrieves the POSModelas configured in the manifest.
 
- 
getParserChunkerModel- Returns:
- Retrieves the ChunkerModelas configured in the manifest.
 
- 
getHeadRules- Returns:
- Retrieves the HeadRulesas configured in the manifest.
 
- 
updateBuildModelInstantiates a newParserModelinstance from the existing configuration with the specifiedbuildModelfor exchange.- Parameters:
- buildModel- A valid- MaxentModelused to build.
- Returns:
- A valid ParserModel.
 
- 
updateCheckModelInstantiates a newParserModelinstance from the existing configuration with the specifiedcheckModelfor exchange.- Parameters:
- checkModel- A valid- MaxentModelused to check.
- Returns:
- A valid ParserModel.
 
- 
updateTaggerModelInstantiates a newParserModelinstance from the existing configuration with the specifiedtaggerModelfor exchange.- Parameters:
- taggerModel- A valid- POSModelused to tag.
- Returns:
- A valid ParserModel.
 
- 
updateChunkerModelInstantiates a newParserModelinstance from the existing configuration with the specifiedchunkModelfor exchange.- Parameters:
- chunkModel- A valid- ChunkerModelused to tag.
- Returns:
- A valid ParserModel.
 
- 
hashCodepublic int hashCode()
- 
equals
 
-