opennlp.tools.langdetect

## Class Language

- java.lang.Object
- - opennlp.tools.langdetect.Language

- All Implemented Interfaces:
    Serializable

      public class Language
      extends Object
      implements Serializable

  Class for holding the document language and its confidence
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Language(String lang)`
    `Language(String lang, double confidence)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `double` | `getConfidence()`
    `String` | `getLang()`
    `int` | `hashCode()`
    `String` | `toString()`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Language

          public Language(String lang)

    - #### Language

          public Language(String lang,
                          double confidence)

  - ### Method Detail

    - #### getLang

          public String getLang()

    - #### getConfidence

          public double getConfidence()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

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