public sealed 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, Nullable<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 | Nullable<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, Nullable<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 | Nullable<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 |
Nullable<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 |