Class: Google::Apis::VisionV1::DetectedLanguage

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

Overview

Detected language for a structural component.

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



1036
1037
1038
# File 'generated/google/apis/vision_v1/classes.rb', line 1036

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

Instance Attribute Details

#confidenceFloat

Confidence of detected language. Range [0, 1]. Corresponds to the JSON property confidence

Returns:

  • (Float)


1034
1035
1036
# File 'generated/google/apis/vision_v1/classes.rb', line 1034

def confidence
  @confidence
end

#language_codeString

The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. Corresponds to the JSON property languageCode

Returns:

  • (String)


1029
1030
1031
# File 'generated/google/apis/vision_v1/classes.rb', line 1029

def language_code
  @language_code
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1041
1042
1043
1044
# File 'generated/google/apis/vision_v1/classes.rb', line 1041

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