目录

class info
com.huawei.hms.mlsdk.langdetect.MLDetectedLang
Represents the language detection result.

Public Constructor Summary

Constructor name
MLDetectedLang(float probability, String langCode)Creates a language detection result instance.

Public Method Summary

Return typeMethod name
booleanequals(Object obj)
StringgetLangCode()
floatgetProbability()
inthashCode()
StringtoString()

Public Constructors

Method
public MLDetectedLang(float probability, String langCode)
Creates a language detection result instance.

Parameters

Parameter nameParameter desc
probabilityConfidence.
langCodeLanguage code (ISO 639-1 standard code).

Public Methods

Method
public boolean equals(Object obj)
Checks whether two language detection result instances are equal.

Parameters

Parameter nameParameter desc
objLanguage detection result instance to be compared.


Return

Typedesc
booleantrue: The two language detection result instances are equal.false: The two language detection result instances are not equal.
Method
public String getLangCode()
Obtains the language code in the language detection result.

Return

Typedesc
StringReturns the language code (ISO 639-1 standard code) in the language detection result.
Method
public float getProbability()
Obtains the confidence of the language detection result.

Return

Typedesc
floatReturns the confidence of the language detection result.
Method
public int hashCode()
Calculates the hash value of the language detection result instance.

Return

Typedesc
intReturns the hash value of the language detection result instance.
Method
public String toString()
Converts a language detection result instance into a character string.

Return

Typedesc
StringReturns a character string converted from a language detection result instance.