Class: Google::Apis::TranslateV2::DetectionsResource

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

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) ⇒ DetectionsResource

Returns a new instance of DetectionsResource



169
170
171
# File 'generated/google/apis/translate_v2/classes.rb', line 169

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

Instance Attribute Details

#confidenceFloat

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

Returns:

  • (Float)


156
157
158
# File 'generated/google/apis/translate_v2/classes.rb', line 156

def confidence
  @confidence
end

#is_reliableBoolean Also known as: is_reliable?

A boolean to indicate is the language detection result reliable. Corresponds to the JSON property isReliable

Returns:

  • (Boolean)


161
162
163
# File 'generated/google/apis/translate_v2/classes.rb', line 161

def is_reliable
  @is_reliable
end

#languageString

The language we detected. Corresponds to the JSON property language

Returns:

  • (String)


167
168
169
# File 'generated/google/apis/translate_v2/classes.rb', line 167

def language
  @language
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



174
175
176
177
178
# File 'generated/google/apis/translate_v2/classes.rb', line 174

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