Class: Google::Apis::LanguageV2::ClassifyTextResponse

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

Overview

The document classification response message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ClassifyTextResponse

Returns a new instance of ClassifyTextResponse.



364
365
366
# File 'lib/google/apis/language_v2/classes.rb', line 364

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

Instance Attribute Details

#categoriesArray<Google::Apis::LanguageV2::ClassificationCategory>

Categories representing the input document. Corresponds to the JSON property categories



348
349
350
# File 'lib/google/apis/language_v2/classes.rb', line 348

def categories
  @categories
end

#language_codeString

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language_code field for more details. Corresponds to the JSON property languageCode

Returns:

  • (String)


355
356
357
# File 'lib/google/apis/language_v2/classes.rb', line 355

def language_code
  @language_code
end

#language_supportedBoolean Also known as: language_supported?

Whether the language is officially supported. The API may still return a response when the language is not supported, but it is on a best effort basis. Corresponds to the JSON property languageSupported

Returns:

  • (Boolean)


361
362
363
# File 'lib/google/apis/language_v2/classes.rb', line 361

def language_supported
  @language_supported
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



369
370
371
372
373
# File 'lib/google/apis/language_v2/classes.rb', line 369

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