LanguageIdentification

  • LanguageIdentification is the entry point to get a LanguageIdentifier for identifying language in text.

  • A LanguageIdentifier instance can be obtained using getClient() with or without options.

  • The getClient() method provides a LanguageIdentifier to identify the language of a given text input.

  • Resources associated with a LanguageIdentifier should be released by calling close() when no longer needed.

public class LanguageIdentification extends Object

Entry point to get a LanguageIdentifier that identifies language for a given text input.

A LanguageIdentifier is created via getClient(LanguageIdentificationOptions) or getClient() if you wish to use the default options. For example, the code below creates a LanguageIdentifier with default options.

Example:

LanguageIdentifier languageIdentifier = LanguageIdentification.getClient();
 

Public Method Summary

static LanguageIdentifier
getClient (LanguageIdentificationOptions options)
Gets an instance of LanguageIdentifier , which identifies the language for a given text input, with the given options .
static LanguageIdentifier
getClient ()
Gets an instance of LanguageIdentifier , which identifies the language for a given text input.

Inherited Method Summary

From class java.lang.Object
Object
clone()
boolean
equals(Object arg0)
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 static LanguageIdentifier getClient (LanguageIdentificationOptions options)

Gets an instance of LanguageIdentifier , which identifies the language for a given text input, with the given options .

To release the resources associated with an LanguageIdentifier , you should ensure that LanguageIdentifier.close() is called on the resulting LanguageIdentifier instance once it will no longer be used.

public static LanguageIdentifier getClient ()

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.