Class: Google::Cloud::Translate::V2::Translation
- Inherits:
-
Object
- Object
- Google::Cloud::Translate::V2::Translation
- Defined in:
- lib/google/cloud/translate/v2/translation.rb
Overview
Translation
Represents a translation query result. Returned by Api#translate.
Instance Attribute Summary collapse
-
#from ⇒ String
(also: #source)
readonly
The source language from which the text was translated.
-
#model ⇒ String
readonly
The translation model.
-
#origin ⇒ String
readonly
The original query text that was translated.
-
#text ⇒ String
(also: #to_s, #to_str)
readonly
The translated result.
-
#to ⇒ String
(also: #language, #target)
readonly
The target language into which the text was translated.
Instance Method Summary collapse
-
#detected? ⇒ Boolean
Determines if the source language was detected by the Google Cloud Cloud Translation API.
Instance Attribute Details
#from ⇒ String (readonly) Also known as: source
The source language from which the text was translated.
68 69 70 |
# File 'lib/google/cloud/translate/v2/translation.rb', line 68 def from @from end |
#model ⇒ String (readonly)
The translation model. Can be either base
for the Phrase-Based Machine Translation (PBMT) model, or nmt
for the Neural Machine Translation (NMT) model. If you did not include a model parameter with your request,
then this field is not included in the response.
77 78 79 |
# File 'lib/google/cloud/translate/v2/translation.rb', line 77 def model @model end |
#origin ⇒ String (readonly)
The original query text that was translated.
54 55 56 |
# File 'lib/google/cloud/translate/v2/translation.rb', line 54 def origin @origin end |
#text ⇒ String (readonly) Also known as: to_s, to_str
The translated result.
46 47 48 |
# File 'lib/google/cloud/translate/v2/translation.rb', line 46 def text @text end |
#to ⇒ String (readonly) Also known as: language, target
The target language into which the text was translated.
60 61 62 |
# File 'lib/google/cloud/translate/v2/translation.rb', line 60 def to @to end |
Instance Method Details
#detected? ⇒ Boolean
Determines if the source language was detected by the Google Cloud Cloud Translation API.
95 96 97 |
# File 'lib/google/cloud/translate/v2/translation.rb', line 95 def detected? @detected end |