Partilhar via


DocumentLanguage Class

  • java.lang.Object
    • com.azure.ai.documentintelligence.models.DocumentLanguage

Implements

public final class DocumentLanguage
implements JsonSerializable<DocumentLanguage>

An object representing the detected language for a given text span.

Method Summary

Modifier and Type Method and Description
static DocumentLanguage fromJson(JsonReader jsonReader)

Reads an instance of DocumentLanguage from the JsonReader.

double getConfidence()

Get the confidence property: Confidence of correctly identifying the language.

String getLocale()

Get the locale property: Detected language.

List<DocumentSpan> getSpans()

Get the spans property: Location of the text elements in the concatenated content the language applies to.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static DocumentLanguage fromJson(JsonReader jsonReader)

Reads an instance of DocumentLanguage from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of DocumentLanguage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getConfidence

public double getConfidence()

Get the confidence property: Confidence of correctly identifying the language.

Returns:

the confidence value.

getLocale

public String getLocale()

Get the locale property: Detected language. Value may an ISO 639-1 language code (ex. "en", "fr") or BCP 47 language tag (ex. "zh-Hans").

Returns:

the locale value.

getSpans

public List getSpans()

Get the spans property: Location of the text elements in the concatenated content the language applies to.

Returns:

the spans value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to