Share via


TextTranslationSkill Class

public final class TextTranslationSkill
extends SearchIndexerSkill

A skill to translate text from one language to another.

Constructor Summary

Constructor Description
TextTranslationSkill(List<InputFieldMappingEntry> inputs, List<OutputFieldMappingEntry> outputs, TextTranslationSkillLanguage defaultToLanguageCode)

Creates an instance of TextTranslationSkill class.

Method Summary

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

Reads an instance of TextTranslationSkill from the JsonReader.

TextTranslationSkillLanguage getDefaultFromLanguageCode()

Get the defaultFromLanguageCode property: The language code to translate documents from for documents that don't specify the from language explicitly.

TextTranslationSkillLanguage getDefaultToLanguageCode()

Get the defaultToLanguageCode property: The language code to translate documents into for documents that don't specify the to language explicitly.

String getOdataType()

Get the odataType property: A URI fragment specifying the type of skill.

TextTranslationSkillLanguage getSuggestedFrom()

Get the suggestedFrom property: The language code to translate documents from when neither the fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is unsuccessful.

TextTranslationSkill setContext(String context)

Set the context property: Represents the level at which operations take place, such as the document root or document content (for example, /document or /document/content).

TextTranslationSkill setDefaultFromLanguageCode(TextTranslationSkillLanguage defaultFromLanguageCode)

Set the defaultFromLanguageCode property: The language code to translate documents from for documents that don't specify the from language explicitly.

TextTranslationSkill setDescription(String description)

Set the description property: The description of the skill which describes the inputs, outputs, and usage of the skill.

TextTranslationSkill setName(String name)

Set the name property: The name of the skill which uniquely identifies it within the skillset.

TextTranslationSkill setSuggestedFrom(TextTranslationSkillLanguage suggestedFrom)

Set the suggestedFrom property: The language code to translate documents from when neither the fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is unsuccessful.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from SearchIndexerSkill

Methods inherited from java.lang.Object

Constructor Details

TextTranslationSkill

public TextTranslationSkill(List<InputFieldMappingEntry> inputs, List<OutputFieldMappingEntry> outputs, TextTranslationSkillLanguage defaultToLanguageCode)

Creates an instance of TextTranslationSkill class.

Parameters:

inputs - the inputs value to set.
outputs - the outputs value to set.
defaultToLanguageCode - the defaultToLanguageCode value to set.

Method Details

fromJson

public static TextTranslationSkill fromJson(JsonReader jsonReader)

Reads an instance of TextTranslationSkill from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of TextTranslationSkill 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.

getDefaultFromLanguageCode

public TextTranslationSkillLanguage getDefaultFromLanguageCode()

Get the defaultFromLanguageCode property: The language code to translate documents from for documents that don't specify the from language explicitly.

Returns:

the defaultFromLanguageCode value.

getDefaultToLanguageCode

public TextTranslationSkillLanguage getDefaultToLanguageCode()

Get the defaultToLanguageCode property: The language code to translate documents into for documents that don't specify the to language explicitly.

Returns:

the defaultToLanguageCode value.

getOdataType

public String getOdataType()

Get the odataType property: A URI fragment specifying the type of skill.

Overrides:

TextTranslationSkill.getOdataType()

Returns:

the odataType value.

getSuggestedFrom

public TextTranslationSkillLanguage getSuggestedFrom()

Get the suggestedFrom property: The language code to translate documents from when neither the fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is unsuccessful. Default is `en`.

Returns:

the suggestedFrom value.

setContext

public TextTranslationSkill setContext(String context)

Set the context property: Represents the level at which operations take place, such as the document root or document content (for example, /document or /document/content). The default is /document.

Overrides:

TextTranslationSkill.setContext(String context)

Parameters:

context

setDefaultFromLanguageCode

public TextTranslationSkill setDefaultFromLanguageCode(TextTranslationSkillLanguage defaultFromLanguageCode)

Set the defaultFromLanguageCode property: The language code to translate documents from for documents that don't specify the from language explicitly.

Parameters:

defaultFromLanguageCode - the defaultFromLanguageCode value to set.

Returns:

the TextTranslationSkill object itself.

setDescription

public TextTranslationSkill setDescription(String description)

Set the description property: The description of the skill which describes the inputs, outputs, and usage of the skill.

Overrides:

TextTranslationSkill.setDescription(String description)

Parameters:

description

setName

public TextTranslationSkill setName(String name)

Set the name property: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'.

Overrides:

TextTranslationSkill.setName(String name)

Parameters:

name

setSuggestedFrom

public TextTranslationSkill setSuggestedFrom(TextTranslationSkillLanguage suggestedFrom)

Set the suggestedFrom property: The language code to translate documents from when neither the fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is unsuccessful. Default is `en`.

Parameters:

suggestedFrom - the suggestedFrom value to set.

Returns:

the TextTranslationSkill object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

TextTranslationSkill.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to