Class: Google::Apis::LanguageV1beta1::AnnotateTextResponse

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

Overview

The text annotations response message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ AnnotateTextResponse

Returns a new instance of AnnotateTextResponse.



261
262
263
# File 'lib/google/apis/language_v1beta1/classes.rb', line 261

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

Instance Attribute Details

#document_sentimentGoogle::Apis::LanguageV1beta1::Sentiment

Represents the feeling associated with the entire text or entities in the text. Corresponds to the JSON property documentSentiment



234
235
236
# File 'lib/google/apis/language_v1beta1/classes.rb', line 234

def document_sentiment
  @document_sentiment
end

#entitiesArray<Google::Apis::LanguageV1beta1::Entity>

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities. Corresponds to the JSON property entities



240
241
242
# File 'lib/google/apis/language_v1beta1/classes.rb', line 240

def entities
  @entities
end

#languageString

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 field for more details. Corresponds to the JSON property language

Returns:

  • (String)


247
248
249
# File 'lib/google/apis/language_v1beta1/classes.rb', line 247

def language
  @language
end

#sentencesArray<Google::Apis::LanguageV1beta1::Sentence>

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax. Corresponds to the JSON property sentences



253
254
255
# File 'lib/google/apis/language_v1beta1/classes.rb', line 253

def sentences
  @sentences
end

#tokensArray<Google::Apis::LanguageV1beta1::Token>

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax. Corresponds to the JSON property tokens



259
260
261
# File 'lib/google/apis/language_v1beta1/classes.rb', line 259

def tokens
  @tokens
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



266
267
268
269
270
271
272
# File 'lib/google/apis/language_v1beta1/classes.rb', line 266

def update!(**args)
  @document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment)
  @entities = args[:entities] if args.key?(:entities)
  @language = args[:language] if args.key?(:language)
  @sentences = args[:sentences] if args.key?(:sentences)
  @tokens = args[:tokens] if args.key?(:tokens)
end