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

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

Overview

The response message for language detection.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ DetectedLanguage

Returns a new instance of DetectedLanguage.



418
419
420
# File 'lib/google/apis/translate_v3/classes.rb', line 418

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)


410
411
412
# File 'lib/google/apis/translate_v3/classes.rb', line 410

def confidence
  @confidence
end

#language_codeString

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

Returns:

  • (String)


416
417
418
# File 'lib/google/apis/translate_v3/classes.rb', line 416

def language_code
  @language_code
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



423
424
425
426
# File 'lib/google/apis/translate_v3/classes.rb', line 423

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