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