TranslateInputItem Class
- java.
lang. Object - com.
azure. ai. translation. text. models. TranslateInputItem
- com.
Implements
public final class TranslateInputItem
implements JsonSerializable<TranslateInputItem>
Element containing the text for translation.
Constructor Summary
| Constructor | Description |
|---|---|
| TranslateInputItem(String text, List<TranslationTarget> translationTargets) |
Creates an instance of Translate |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Translate |
fromJson(JsonReader jsonReader)
Reads an instance of Translate |
| String |
getLanguage()
Get the language property: Specifies the language of the input text. |
| String |
getScript()
Get the script property: Specifies the script of the input text. |
| String |
getText()
Get the text property: Text to translate. |
|
Text |
getTextType()
Get the text |
|
List<Translation |
getTranslationTargets()
Get the translation |
|
Translate |
setLanguage(String language)
Set the language property: Specifies the language of the input text. |
|
Translate |
setScript(String script)
Set the script property: Specifies the script of the input text. |
|
Translate |
setTextType(TextType textType)
Set the text |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Constructor Details
TranslateInputItem
public TranslateInputItem(String text, List<TranslationTarget> translationTargets)
Creates an instance of TranslateInputItem class.
Parameters:
Method Details
fromJson
public static TranslateInputItem fromJson(JsonReader jsonReader)
Reads an instance of TranslateInputItem from the JsonReader.
Parameters:
Returns:
Throws:
getLanguage
public String getLanguage()
Get the language property: Specifies the language of the input text. Find which languages are available to translate by looking up supported languages using the translation scope. If the language parameter isn't specified, automatic language detection is applied to determine the source language. You must use the language parameter rather than autodetection when using the dynamic dictionary feature. Note: the dynamic dictionary feature is case-sensitive.
Returns:
getScript
public String getScript()
Get the script property: Specifies the script of the input text.
Returns:
getText
public String getText()
Get the text property: Text to translate.
Returns:
getTextType
public TextType getTextType()
Get the textType property: Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Possible values are: plain (default) or html.
Returns:
getTranslationTargets
public List<TranslationTarget> getTranslationTargets()
Get the translationTargets property: Translation target parameters.
Returns:
setLanguage
public TranslateInputItem setLanguage(String language)
Set the language property: Specifies the language of the input text. Find which languages are available to translate by looking up supported languages using the translation scope. If the language parameter isn't specified, automatic language detection is applied to determine the source language. You must use the language parameter rather than autodetection when using the dynamic dictionary feature. Note: the dynamic dictionary feature is case-sensitive.
Parameters:
Returns:
setScript
public TranslateInputItem setScript(String script)
Set the script property: Specifies the script of the input text.
Parameters:
Returns:
setTextType
public TranslateInputItem setTextType(TextType textType)
Set the textType property: Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed, complete element. Possible values are: plain (default) or html.
Parameters:
Returns: