Partilhar via


AITranslationTextModelFactory.TranslatedTextItem Method

Definition

Initializes a new instance of TranslatedTextItem.

public static Azure.AI.Translation.Text.TranslatedTextItem TranslatedTextItem (Azure.AI.Translation.Text.DetectedLanguage detectedLanguage = default, System.Collections.Generic.IEnumerable<Azure.AI.Translation.Text.TranslationText> translations = default, Azure.AI.Translation.Text.SourceText sourceText = default);
static member TranslatedTextItem : Azure.AI.Translation.Text.DetectedLanguage * seq<Azure.AI.Translation.Text.TranslationText> * Azure.AI.Translation.Text.SourceText -> Azure.AI.Translation.Text.TranslatedTextItem
Public Shared Function TranslatedTextItem (Optional detectedLanguage As DetectedLanguage = Nothing, Optional translations As IEnumerable(Of TranslationText) = Nothing, Optional sourceText As SourceText = Nothing) As TranslatedTextItem

Parameters

detectedLanguage
DetectedLanguage

The detectedLanguage property is only present in the result object when language auto-detection is requested.

translations
IEnumerable<TranslationText>

An array of translation results. The size of the array matches the number of target languages specified through the to query parameter.

sourceText
SourceText

Input text in the default script of the source language. sourceText property is present only when the input is expressed in a script that's not the usual script for the language. For example, if the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text converted into Arab script.

Returns

A new TranslatedTextItem instance for mocking.

Applies to