IdentifiedLanguage
Stay organized with collections
Save and categorize content based on your preferences.
Public Method Summary
boolean |
equals( Object o)
Indicates whether some other object is "equal to" this one.
|
float |
getConfidence()
Returns the confidence score associated with the language.
|
String
|
|
int |
hashCode()
Returns a hash code value for the object.
|
String
|
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
public boolean equals (Object o)
Indicates whether some other object is "equal to" this one.
public float getConfidence ()
public String getLanguageTag ()
public int hashCode ()
Returns a hash code value for the object.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eIdentifiedLanguage\u003c/code\u003e objects represent languages identified by the ML Kit Language Identifier.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003eIdentifiedLanguage\u003c/code\u003e has a language tag (BCP 47 format), a confidence score, and methods for comparison and hashing.\u003c/p\u003e\n"],["\u003cp\u003eConfidence scores range from 0 to 1, reflecting the likelihood of the identified language being correct.\u003c/p\u003e\n"],["\u003cp\u003eIf no language is detected, the language tag will be \u003ccode\u003eLanguageIdentifier.UNDETERMINED_LANGUAGE_TAG\u003c/code\u003e.\u003c/p\u003e\n"]]],["`IdentifiedLanguage` represents a language identified by `LanguageIdentifier`. Key actions include: `equals()` to compare objects, `getConfidence()` to retrieve a language's confidence score (0-1), and `getLanguageTag()` to obtain the BCP 47 language tag. The methods `hashCode()` and `toString()` return a hash code and string representation of the object. It can be determined if any language is detected. Also, inherited methods, including `clone`, and `wait`, are available.\n"],null,["# IdentifiedLanguage\n\npublic final class **IdentifiedLanguage** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nA language identified by [LanguageIdentifier.identifyPossibleLanguages(String)](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier#identifyPossibleLanguages(java.lang.String)). \n\n### Public Method Summary\n\n|-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/mlkit/nl/languageid/IdentifiedLanguage#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) o) Indicates whether some other object is \"equal to\" this one. |\n| float | [getConfidence](/android/reference/com/google/mlkit/nl/languageid/IdentifiedLanguage#getConfidence())() Returns the confidence score associated with the language. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getLanguageTag](/android/reference/com/google/mlkit/nl/languageid/IdentifiedLanguage#getLanguageTag())() Returns the [BCP 47](//tools.ietf.org/html/bcp47) language tag for the language. |\n| int | [hashCode](/android/reference/com/google/mlkit/nl/languageid/IdentifiedLanguage#hashCode())() Returns a hash code value for the object. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/mlkit/nl/languageid/IdentifiedLanguage#toString())() |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) o)\n\nIndicates whether some other object is \"equal to\" this one. \n\n#### public float **getConfidence** ()\n\nReturns the confidence score associated with the language. The value is between 0\nand 1, and greater or equal to the confidence threshold specified for [LanguageIdentifier.identifyPossibleLanguages(String)](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier#identifyPossibleLanguages(java.lang.String)) in [LanguageIdentificationOptions](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentificationOptions). \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getLanguageTag** ()\n\nReturns the [BCP 47](//tools.ietf.org/html/bcp47) language tag for the\nlanguage.\n\nReturns [LanguageIdentifier.UNDETERMINED_LANGUAGE_TAG](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier#UNDETERMINED_LANGUAGE_TAG) if no language is detected. \n\n#### public int **hashCode** ()\n\nReturns a hash code value for the object. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()"]]