LanguageDetectorModel (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.langdetect

## Class LanguageDetectorModel

- java.lang.Object
- - opennlp.tools.util.model.BaseModel
  - - opennlp.tools.langdetect.LanguageDetectorModel

- All Implemented Interfaces:
    Serializable, ArtifactProvider

      public class LanguageDetectorModel
      extends BaseModel

  A model for language detection
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class opennlp.tools.util.model.BaseModel

      `TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LanguageDetectorModel(File modelFile)`
    `LanguageDetectorModel(InputStream in)`
    `LanguageDetectorModel(MaxentModel langdetectModel, Map<String,String> manifestInfoEntries, LanguageDetectorFactory factory)`
    `LanguageDetectorModel(URL modelURL)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `LanguageDetectorFactory` | `getFactory()`
    `MaxentModel` | `getMaxentModel()`

    - ### Methods inherited from class opennlp.tools.util.model.BaseModel

      `getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LanguageDetectorModel

          public LanguageDetectorModel(MaxentModel langdetectModel,
                                       Map<String,String> manifestInfoEntries,
                                       LanguageDetectorFactory factory)

    - #### LanguageDetectorModel

          public LanguageDetectorModel(InputStream in)
                                throws IOException

      Throws:
        `IOException`

    - #### LanguageDetectorModel

          public LanguageDetectorModel(File modelFile)
                                throws IOException

      Throws:
        `IOException`

    - #### LanguageDetectorModel

          public LanguageDetectorModel(URL modelURL)
                                throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### getFactory

          public LanguageDetectorFactory getFactory()

    - #### getMaxentModel

          public MaxentModel getMaxentModel()

Copyright © 2026 The Apache Software Foundation. All rights reserved.