Class: Google::Apis::TranslateV3::DetectedLanguage

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/translate_v3/classes.rb,
generated/google/apis/translate_v3/representations.rb,
generated/google/apis/translate_v3/representations.rb

Overview

The response message for language detection.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ DetectedLanguage

Returns a new instance of DetectedLanguage.



199
200
201
# File 'generated/google/apis/translate_v3/classes.rb', line 199

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#confidenceFloat

The confidence of the detection result for this language. Corresponds to the JSON property confidence

Returns:

  • (Float)


191
192
193
# File 'generated/google/apis/translate_v3/classes.rb', line 191

def confidence
  @confidence
end

#language_codeString

The BCP-47 language code of source content in the request, detected automatically. Corresponds to the JSON property languageCode

Returns:

  • (String)


197
198
199
# File 'generated/google/apis/translate_v3/classes.rb', line 197

def language_code
  @language_code
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



204
205
206
207
# File 'generated/google/apis/translate_v3/classes.rb', line 204

def update!(**args)
  @confidence = args[:confidence] if args.key?(:confidence)
  @language_code = args[:language_code] if args.key?(:language_code)
end