Package opennlp.tools.langdetect
Class LanguageDetectorModel
java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.langdetect.LanguageDetectorModel
- All Implemented Interfaces:
Serializable
,ArtifactProvider
The
LanguageDetectorModel
is the model used by a learnable LanguageDetector
.- See Also:
-
Field Summary
Fields inherited from class opennlp.tools.util.model.BaseModel
TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY
-
Constructor Summary
ConstructorDescriptionLanguageDetectorModel
(File modelFile) Initializes aLanguageDetectorModel
instance via a validFile
.Initializes aLanguageDetectorModel
instance via a validInputStream
.LanguageDetectorModel
(URL modelURL) Initializes aLanguageDetectorModel
instance via a validURL
.LanguageDetectorModel
(MaxentModel langdetectModel, Map<String, String> manifestInfoEntries, LanguageDetectorFactory factory) Initializes aLanguageDetectorModel
instance via given parameters. -
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
Constructor Details
-
LanguageDetectorModel
public LanguageDetectorModel(MaxentModel langdetectModel, Map<String, String> manifestInfoEntries, LanguageDetectorFactory factory) Initializes aLanguageDetectorModel
instance via given parameters.- Parameters:
langdetectModel
- A validMaxentModel
.manifestInfoEntries
- Additional information kept in the manifest.factory
- TheLanguageDetectorFactory
for creating related objects.
-
LanguageDetectorModel
Initializes aLanguageDetectorModel
instance via a validInputStream
.- Parameters:
in
- TheInputStream
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
LanguageDetectorModel
Initializes aLanguageDetectorModel
instance via a validFile
.- Parameters:
modelFile
- TheFile
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
LanguageDetectorModel
Initializes aLanguageDetectorModel
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
LanguageDetectorFactory
.
-
getMaxentModel
- Returns:
- Retrieves a
MaxentModel
.
-