Cloud Natural Language V1beta2 Client - Class Sentence (0.31.3)

Reference documentation and code samples for the Cloud Natural Language V1beta2 Client class Sentence.

Represents a sentence in the input document.

Generated from protobuf message google.cloud.language.v1beta2.Sentence

Namespace

Google \ Cloud \ Language \ V1beta2

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ text Google\Cloud\Language\V1beta2\TextSpan

The sentence text.

↳ sentiment Google\Cloud\Language\V1beta2\Sentiment

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

getText

The sentence text.

Returns
TypeDescription
Google\Cloud\Language\V1beta2\TextSpan|null

hasText

clearText

setText

The sentence text.

Parameter
NameDescription
var Google\Cloud\Language\V1beta2\TextSpan
Returns
TypeDescription
$this

getSentiment

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

Returns
TypeDescription
Google\Cloud\Language\V1beta2\Sentiment|null

hasSentiment

clearSentiment

setSentiment

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

Parameter
NameDescription
var Google\Cloud\Language\V1beta2\Sentiment
Returns
TypeDescription
$this