LanguageIdentification
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Method Summary
From class java.lang.Object
Public Methods
Gets an instance of LanguageIdentifier
,
which identifies the language for a given text input.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eLanguageIdentification\u003c/code\u003e is the entry point for identifying the language of a given text input.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to get a \u003ccode\u003eLanguageIdentifier\u003c/code\u003e instance, either with custom options or default settings.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLanguageIdentifier\u003c/code\u003e is used to perform the actual language identification.\u003c/p\u003e\n"],["\u003cp\u003eResources associated with a \u003ccode\u003eLanguageIdentifier\u003c/code\u003e should be released using \u003ccode\u003eLanguageIdentifier.close()\u003c/code\u003e when no longer needed.\u003c/p\u003e\n"]]],["The `LanguageIdentification` class provides access to a `LanguageIdentifier` for text language identification. Obtain a `LanguageIdentifier` instance using `getClient()` for default options, or `getClient(LanguageIdentificationOptions)` to customize them. After using the `LanguageIdentifier`, release its resources by calling `close()`. The `LanguageIdentifier` is designed to determine the language of a given text input and it is possible to create this with or without specific options.\n"],null,["# LanguageIdentification\n\npublic class **LanguageIdentification** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nEntry point to get a [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier)\nthat identifies language for a given text input.\n\nA [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier)\nis created via [getClient(LanguageIdentificationOptions)](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentification#getClient(com.google.mlkit.nl.languageid.LanguageIdentificationOptions)) or [getClient()](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentification#getClient())\nif you wish to use the default options. For example, the code below creates a [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier)\nwith default options.\n\nExample: \n\n LanguageIdentifier languageIdentifier = LanguageIdentification.getClient();\n \n### Public Method Summary\n\n|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier) | [getClient](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentification#getClient(com.google.mlkit.nl.languageid.LanguageIdentificationOptions))([LanguageIdentificationOptions](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentificationOptions) options) Gets an instance of [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier), which identifies the language for a given text input, with the given [options](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentificationOptions). |\n| static [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier) | [getClient](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentification#getClient())() Gets an instance of [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier), which identifies the language for a given text input. |\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 static [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier)\n**getClient** ([LanguageIdentificationOptions](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentificationOptions) options)\n\nGets an instance of [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier),\nwhich identifies the language for a given text input, with the given [options](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentificationOptions).\n\nTo release the resources associated with an [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier),\nyou should ensure that [LanguageIdentifier.close()](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier#close())\nis called on the resulting [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier)\ninstance once it will no longer be used. \n\n#### public static [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier)\n**getClient** ()\n\nGets an instance of [LanguageIdentifier](/android/reference/com/google/mlkit/nl/languageid/LanguageIdentifier),\nwhich identifies the language for a given text input."]]