Class: Google::Apis::LanguageV1::Sentence

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

Overview

Represents a sentence in the input document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Sentence

Returns a new instance of Sentence.



1120
1121
1122
# File 'lib/google/apis/language_v1/classes.rb', line 1120

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

Instance Attribute Details

#sentimentGoogle::Apis::LanguageV1::Sentiment

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



1113
1114
1115
# File 'lib/google/apis/language_v1/classes.rb', line 1113

def sentiment
  @sentiment
end

#textGoogle::Apis::LanguageV1::TextSpan

Represents a text span in the input document. Corresponds to the JSON property text



1118
1119
1120
# File 'lib/google/apis/language_v1/classes.rb', line 1118

def text
  @text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1125
1126
1127
1128
# File 'lib/google/apis/language_v1/classes.rb', line 1125

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