public sealed class TranslationResult
Reference documentation and code samples for the Google Cloud Translation v2 API class TranslationResult.
The result of a translation operation.
Namespace
Google.Cloud.Translation.V2Assembly
Google.Cloud.Translation.V2.dll
Constructors
TranslationResult(string, string, string, string, string, TranslationModel?)
public TranslationResult(string originalText, string translatedText, string detectedSourceLanguage, string specifiedSourceLanguage, string targetLanguage, TranslationModel? model)
Constructs an instance.
Parameters | |
---|---|
Name | Description |
originalText | string The original text. |
translatedText | string The translated text. |
detectedSourceLanguage | string The source language code detected by the server, if any. |
specifiedSourceLanguage | string The source language code specified by the API caller. |
targetLanguage | string The target language code. |
model | TranslationModel The model used to perform the translation, if known. |
This constructor is for the benefit of testability, in case you wish to provide your own fake implementation of TranslationClient.
TranslationResult(string, string, string, string, string, TranslationModel?, string)
public TranslationResult(string originalText, string translatedText, string detectedSourceLanguage, string specifiedSourceLanguage, string targetLanguage, TranslationModel? model, string modelName)
Constructs an instance.
Parameters | |
---|---|
Name | Description |
originalText | string The original text. |
translatedText | string The translated text. |
detectedSourceLanguage | string The source language code detected by the server, if any. |
specifiedSourceLanguage | string The source language code specified by the API caller. |
targetLanguage | string The target language code. |
model | TranslationModel The model used to perform the translation, if known. |
modelName | string The name of the model used to perform the translation. |
This constructor is for the benefit of testability, in case you wish to provide your own fake implementation of TranslationClient.
Properties
DetectedSourceLanguage
public string DetectedSourceLanguage { get; }
The source language code detected by the server. This may be null, typically due to the source language being supplied by the caller.
Property Value | |
---|---|
Type | Description |
string |
Model
public TranslationModel? Model { get; }
The model used to perform the translation, if known and available as one of the values in TranslationModel.
Property Value | |
---|---|
Type | Description |
TranslationModel |
ModelName
public string ModelName { get; }
The name of the model used to perform the translation. This may be present even if Model is null, if a custom model name has been specified via AdvancedTranslationClient.
Property Value | |
---|---|
Type | Description |
string |
OriginalText
public string OriginalText { get; }
The original text (or HTML) that was translated.
Property Value | |
---|---|
Type | Description |
string |
SpecifiedSourceLanguage
public string SpecifiedSourceLanguage { get; }
The source language code supplied by the caller, if any.
Property Value | |
---|---|
Type | Description |
string |
TargetLanguage
public string TargetLanguage { get; }
The target language code that the text was translated into.
Property Value | |
---|---|
Type | Description |
string |
TranslatedText
public string TranslatedText { get; }
The translated text.
Property Value | |
---|---|
Type | Description |
string |