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 Summary
Fields inherited from class opennlp.tools.util.model.BaseModel
TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionParserModel(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 Summary
Modifier 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.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
Constructor Details
-
ParserModel
public 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 validMaxentModelused to build.checkModel- A validMaxentModelused to check.attachModel- A validMaxentModelused to attach.parserTagger- A validPOSModelto parse.chunkerTagger- A validChunkerModelto chunk.headRules- TheHeadRulesto to use for parsing.modelType- TheParserTypeto use.manifestInfoEntries- Additional information kept in the manifest.
-
ParserModel
public 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 validMaxentModelused to build.checkModel- A validMaxentModelused to check.parserTagger- A validPOSModelto parse.chunkerTagger- A validChunkerModelto chunk.headRules- TheHeadRulesto to use for parsing.modelType- TheParserTypeto use.
-
ParserModel
public 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 validMaxentModelused to build.checkModel- A validMaxentModelused to check.parserTagger- A validPOSModelto parse.chunkerTagger- A validChunkerModelto chunk.headRules- TheHeadRulesto to use for parsing.type- TheParserTypeto use.manifestInfoEntries- Additional information kept in the manifest.
-
ParserModel
Initializes aParserModelinstance via a validInputStream.- Parameters:
in- TheInputStreamused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
ParserModel
Initializes aParserModelinstance via a validFile.- Parameters:
modelFile- TheFileused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
ParserModel
Initializes aParserModelinstance via a validPath.- Parameters:
modelPath- ThePathused for loading the model.- Throws:
IOException- Thrown if IO errors occurred during initialization.
-
ParserModel
Initializes aParserModelinstance via a validURL.- Parameters:
modelURL- TheURLused 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.
-
updateBuildModel
Instantiates a newParserModelinstance from the existing configuration with the specifiedbuildModelfor exchange.- Parameters:
buildModel- A validMaxentModelused to build.- Returns:
- A valid
ParserModel.
-
updateCheckModel
Instantiates a newParserModelinstance from the existing configuration with the specifiedcheckModelfor exchange.- Parameters:
checkModel- A validMaxentModelused to check.- Returns:
- A valid
ParserModel.
-
updateTaggerModel
Instantiates a newParserModelinstance from the existing configuration with the specifiedtaggerModelfor exchange.- Parameters:
taggerModel- A validPOSModelused to tag.- Returns:
- A valid
ParserModel.
-
updateChunkerModel
Instantiates a newParserModelinstance from the existing configuration with the specifiedchunkModelfor exchange.- Parameters:
chunkModel- A validChunkerModelused to tag.- Returns:
- A valid
ParserModel.
-
hashCode
public int hashCode() -
equals
-