TranslationText Class
- java.
lang. Object - com.
azure. ai. translation. text. models. TranslationText
- com.
Implements
public final class TranslationText
implements JsonSerializable<TranslationText>
Translation result.
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Translation |
fromJson(JsonReader jsonReader)
Reads an instance of Translation |
| Integer |
getInstructionTokenCount()
Get the instruction |
| String |
getLanguage()
Get the language property: A string representing the language code of the target language. |
| Integer |
getResponseTokenCount()
Get the response |
| Integer |
getSourceCharacterCount()
Get the source |
| Integer |
getSourceTokenCount()
Get the source |
| Integer |
getTargetTokenCount()
Get the target |
| String |
getText()
Get the text property: A string giving the translated text. |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Method Details
fromJson
public static TranslationText fromJson(JsonReader jsonReader)
Reads an instance of TranslationText from the JsonReader.
Parameters:
Returns:
Throws:
getInstructionTokenCount
public Integer getInstructionTokenCount()
Get the instructionTokenCount property: An integer indicating the number of tokens used in generating the translated text.
Returns:
getLanguage
public String getLanguage()
Get the language property: A string representing the language code of the target language.
Returns:
getResponseTokenCount
public Integer getResponseTokenCount()
Get the responseTokenCount property: An integer indicating the number of tokens used in the translation response.
Returns:
getSourceCharacterCount
public Integer getSourceCharacterCount()
Get the sourceCharacterCount property: An integer indicating the number of characters in the source text string.
Returns:
getSourceTokenCount
public Integer getSourceTokenCount()
Get the sourceTokenCount property: An integer indicating the number of tokens used in the source sentence.
Returns:
getTargetTokenCount
public Integer getTargetTokenCount()
Get the targetTokenCount property: An integer indicating the number of tokens used in the target sentence.
Returns:
getText
public String getText()
Get the text property: A string giving the translated text.
Returns: