Partilhar via


AITranslationTextModelFactory.DictionaryTranslation Method

Definition

Initializes a new instance of DictionaryTranslation.

public static Azure.AI.Translation.Text.DictionaryTranslation DictionaryTranslation (string normalizedTarget = default, string displayTarget = default, string posTag = default, float confidence = 0, string prefixWord = default, System.Collections.Generic.IEnumerable<Azure.AI.Translation.Text.BackTranslation> backTranslations = default);
static member DictionaryTranslation : string * string * string * single * string * seq<Azure.AI.Translation.Text.BackTranslation> -> Azure.AI.Translation.Text.DictionaryTranslation
Public Shared Function DictionaryTranslation (Optional normalizedTarget As String = Nothing, Optional displayTarget As String = Nothing, Optional posTag As String = Nothing, Optional confidence As Single = 0, Optional prefixWord As String = Nothing, Optional backTranslations As IEnumerable(Of BackTranslation) = Nothing) As DictionaryTranslation

Parameters

normalizedTarget
String

A string giving the normalized form of this term in the target language. This value should be used as input to lookup examples.

displayTarget
String

A string giving the term in the target language and in a form best suited for end-user display. Generally, this will only differ from the normalizedTarget in terms of capitalization. For example, a proper noun like "Juan" will have normalizedTarget = "juan" and displayTarget = "Juan".

posTag
String

A string associating this term with a part-of-speech tag.

confidence
Single

A value between 0.0 and 1.0 which represents the "confidence" (or perhaps more accurately, "probability in the training data") of that translation pair. The sum of confidence scores for one source word may or may not sum to 1.0.

prefixWord
String

A string giving the word to display as a prefix of the translation. Currently, this is the gendered determiner of nouns, in languages that have gendered determiners. For example, the prefix of the Spanish word "mosca" is "la", since "mosca" is a feminine noun in Spanish. This is only dependent on the translation, and not on the source. If there is no prefix, it will be the empty string.

backTranslations
IEnumerable<BackTranslation>

A list of "back translations" of the target. For example, source words that the target can translate to. The list is guaranteed to contain the source word that was requested (e.g., if the source word being looked up is "fly", then it is guaranteed that "fly" will be in the backTranslations list). However, it is not guaranteed to be in the first position, and often will not be.

Returns

A new DictionaryTranslation instance for mocking.

Applies to