# Cloud Natural Language V2 API - Class Google::Cloud::Language::V2::Sentence (v1.5.0)

1.5.0 (latest) 1.4.0 1.3.0 1.2.1 1.1.0 1.0.1 0.7.0 0.6.0 0.5.1 0.4.0 0.3.2 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Natural Language V2 API class Google::Cloud::Language::V2::Sentence.

Represents a sentence in the input document.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #sentiment

    def sentiment() -> ::Google::Cloud::Language::V2::Sentiment

**Returns**

- ([::Google::Cloud::Language::V2::Sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Sentiment)) --- For calls to \[AnalyzeSentiment\]\[\] or if [AnnotateTextRequest.Features.extract_document_sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_document_sentiment_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_document_sentiment (method)") is set to true, this field will contain the sentiment for the sentence.

### #sentiment=

    def sentiment=(value) -> ::Google::Cloud::Language::V2::Sentiment

**Parameter**

- **value** ([::Google::Cloud::Language::V2::Sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Sentiment)) --- For calls to \[AnalyzeSentiment\]\[\] or if [AnnotateTextRequest.Features.extract_document_sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_document_sentiment_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_document_sentiment (method)") is set to true, this field will contain the sentiment for the sentence.
**Returns**

- ([::Google::Cloud::Language::V2::Sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Sentiment)) --- For calls to \[AnalyzeSentiment\]\[\] or if [AnnotateTextRequest.Features.extract_document_sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_document_sentiment_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_document_sentiment (method)") is set to true, this field will contain the sentiment for the sentence.

### #text

    def text() -> ::Google::Cloud::Language::V2::TextSpan

**Returns**

- ([::Google::Cloud::Language::V2::TextSpan](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-TextSpan)) --- The sentence text.

### #text=

    def text=(value) -> ::Google::Cloud::Language::V2::TextSpan

**Parameter**

- **value** ([::Google::Cloud::Language::V2::TextSpan](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-TextSpan)) --- The sentence text.
**Returns**

- ([::Google::Cloud::Language::V2::TextSpan](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-TextSpan)) --- The sentence text.