Class: Google::Apis::LanguageV2::AnalyzeSentimentResponse
- Inherits:
-
Object
- Object
- Google::Apis::LanguageV2::AnalyzeSentimentResponse
- 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 sentiment analysis response message.
Instance Attribute Summary collapse
-
#document_sentiment ⇒ Google::Apis::LanguageV2::Sentiment
Represents the feeling associated with the entire text or entities in the text.
-
#language_code ⇒ String
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.
-
#language_supported ⇒ Boolean
(also: #language_supported?)
Whether the language is officially supported.
-
#sentences ⇒ Array<Google::Apis::LanguageV2::Sentence>
The sentiment for all the sentences in the document.
Instance Method Summary collapse
-
#initialize(**args) ⇒ AnalyzeSentimentResponse
constructor
A new instance of AnalyzeSentimentResponse.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ AnalyzeSentimentResponse
Returns a new instance of AnalyzeSentimentResponse.
138 139 140 |
# File 'lib/google/apis/language_v2/classes.rb', line 138 def initialize(**args) update!(**args) end |
Instance Attribute Details
#document_sentiment ⇒ Google::Apis::LanguageV2::Sentiment
Represents the feeling associated with the entire text or entities in the text.
Corresponds to the JSON property documentSentiment
117 118 119 |
# File 'lib/google/apis/language_v2/classes.rb', line 117 def document_sentiment @document_sentiment end |
#language_code ⇒ String
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 languageCode
124 125 126 |
# File 'lib/google/apis/language_v2/classes.rb', line 124 def language_code @language_code end |
#language_supported ⇒ Boolean 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
130 131 132 |
# File 'lib/google/apis/language_v2/classes.rb', line 130 def language_supported @language_supported end |
#sentences ⇒ Array<Google::Apis::LanguageV2::Sentence>
The sentiment for all the sentences in the document.
Corresponds to the JSON property sentences
136 137 138 |
# File 'lib/google/apis/language_v2/classes.rb', line 136 def sentences @sentences end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
143 144 145 146 147 148 |
# File 'lib/google/apis/language_v2/classes.rb', line 143 def update!(**args) @document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment) @language_code = args[:language_code] if args.key?(:language_code) @language_supported = args[:language_supported] if args.key?(:language_supported) @sentences = args[:sentences] if args.key?(:sentences) end |