Interface SentenceOrBuilder (2.15.0)

publicinterface SentenceOrBuilderextendsMessageOrBuilder

Implements

MessageOrBuilder

Methods

getSentiment()

publicabstractSentimentgetSentiment()

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1beta2.Sentiment sentiment = 2;

Returns
Type Description
Sentiment

The sentiment.

getSentimentOrBuilder()

publicabstractSentimentOrBuildergetSentimentOrBuilder()

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1beta2.Sentiment sentiment = 2;

Returns
Type Description
SentimentOrBuilder

getText()

publicabstractTextSpangetText()

The sentence text.

.google.cloud.language.v1beta2.TextSpan text = 1;

Returns
Type Description
TextSpan

The text.

getTextOrBuilder()

publicabstractTextSpanOrBuildergetTextOrBuilder()

The sentence text.

.google.cloud.language.v1beta2.TextSpan text = 1;

Returns
Type Description
TextSpanOrBuilder

hasSentiment()

publicabstractbooleanhasSentiment()

For calls to [AnalyzeSentiment][] or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence.

.google.cloud.language.v1beta2.Sentiment sentiment = 2;

Returns
Type Description
boolean

Whether the sentiment field is set.

hasText()

publicabstractbooleanhasText()

The sentence text.

.google.cloud.language.v1beta2.TextSpan text = 1;

Returns
Type Description
boolean

Whether the text field is set.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.