class Google::Cloud::Translate::V2::Detection::Result
# Result
Represents an individual result in a {Google::Cloud::Translate::V2::Detection} result.
Attributes
confidence[R]
The confidence that the language detection result is correct. The closer this value is to 1, the higher the confidence in language detection.
@return [Float] a value between 0 and 1
language[R]
The language detected. This is an [ISO 639-1](en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code.
@return [String] the language code
Public Class Methods
from_gapi(gapi)
click to toggle source
@private New Detection::Result
from a DetectionsResource object as defined by the Google
API Client object.
# File lib/google/cloud/translate/v2/detection.rb, line 124 def self.from_gapi gapi new gapi["confidence"], gapi["language"] end
new(confidence, language)
click to toggle source
@private Create a new object.
# File lib/google/cloud/translate/v2/detection.rb, line 116 def initialize confidence, language @confidence = confidence @language = language end