Package opennlp.tools.tokenize
Class TokenizerModel
java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.tokenize.TokenizerModel
- All Implemented Interfaces:
Serializable
,ArtifactProvider
The
TokenizerModel
is the model used
by a learnable Tokenizer
.- See Also:
-
Field Summary
Fields inherited from class opennlp.tools.util.model.BaseModel
TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY
-
Constructor Summary
ConstructorDescriptionTokenizerModel
(File modelFile) Initializes aTokenizerModel
instance via a validFile
.Initializes aTokenizerModel
instance via a validInputStream
.TokenizerModel
(URL modelURL) Initializes aTokenizerModel
instance via a validURL
.TokenizerModel
(Path modelPath) Initializes aTokenizerModel
instance via a validPath
.TokenizerModel
(MaxentModel tokenizerModel, Map<String, String> manifestInfoEntries, TokenizerFactory tokenizerFactory) Initializes aTokenizerModel
instance via aMaxentModel
and related resources. -
Method Summary
Methods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
Constructor Details
-
TokenizerModel
public TokenizerModel(MaxentModel tokenizerModel, Map<String, String> manifestInfoEntries, TokenizerFactory tokenizerFactory) Initializes aTokenizerModel
instance via aMaxentModel
and related resources.- Parameters:
tokenizerModel
- Themodel
to be used.manifestInfoEntries
- Additional information kept in the manifest.tokenizerFactory
- TheTokenizerFactory
to be used internally.
-
TokenizerModel
Initializes aTokenizerModel
instance via a validInputStream
.- Parameters:
in
- TheInputStream
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
TokenizerModel
Initializes aTokenizerModel
instance via a validFile
.- Parameters:
modelFile
- TheFile
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
TokenizerModel
Initializes aTokenizerModel
instance via a validPath
.- Parameters:
modelPath
- ThePath
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
TokenizerModel
Initializes aTokenizerModel
instance via a validURL
.- Parameters:
modelURL
- TheURL
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
-
Method Details
-
getFactory
- Returns:
- Retrieves the active
TokenizerFactory
.
-
getMaxentModel
- Returns:
- Retrieves the model as
MaxentModel
instance.
-
getAbbreviations
- Returns:
- Retrieves the active abbreviation
Dictionary
.
-
useAlphaNumericOptimization
public boolean useAlphaNumericOptimization()- Returns:
true
if alphanumeric optimization is active,false
otherwise.
-
hashCode
public int hashCode() -
equals
-