Class Sentence.Builder (2.13.0)

publicstaticfinalclass Sentence.BuilderextendsGeneratedMessageV3.Builder<Sentence.Builder>implementsSentenceOrBuilder

Represents a sentence in the input document.

Protobuf type google.cloud.language.v1.Sentence

Implements

SentenceOrBuilder

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicSentence.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
Overrides

build()

publicSentencebuild()
Returns
Type Description

buildPartial()

publicSentencebuildPartial()
Returns
Type Description

clear()

publicSentence.Builderclear()
Returns
Type Description
Overrides

clearField(Descriptors.FieldDescriptor field)

publicSentence.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
Returns
Type Description
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicSentence.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
Returns
Type Description
Overrides

clearSentiment()

publicSentence.BuilderclearSentiment()

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.v1.Sentiment sentiment = 2;

Returns
Type Description

clearText()

publicSentence.BuilderclearText()

The sentence text.

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

Returns
Type Description

clone()

publicSentence.Builderclone()
Returns
Type Description
Overrides

getDefaultInstanceForType()

publicSentencegetDefaultInstanceForType()
Returns
Type Description

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Overrides

getSentiment()

publicSentimentgetSentiment()

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.v1.Sentiment sentiment = 2;

Returns
Type Description
Sentiment

The sentiment.

getSentimentBuilder()

publicSentiment.BuildergetSentimentBuilder()

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.v1.Sentiment sentiment = 2;

Returns
Type Description

getSentimentOrBuilder()

publicSentimentOrBuildergetSentimentOrBuilder()

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.v1.Sentiment sentiment = 2;

Returns
Type Description

getText()

publicTextSpangetText()

The sentence text.

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

Returns
Type Description
TextSpan

The text.

getTextBuilder()

publicTextSpan.BuildergetTextBuilder()

The sentence text.

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

Returns
Type Description

getTextOrBuilder()

publicTextSpanOrBuildergetTextOrBuilder()

The sentence text.

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

Returns
Type Description

hasSentiment()

publicbooleanhasSentiment()

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.v1.Sentiment sentiment = 2;

Returns
Type Description
boolean

Whether the sentiment field is set.

hasText()

publicbooleanhasText()

The sentence text.

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

Returns
Type Description
boolean

Whether the text field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
Overrides

mergeFrom(Sentence other)

publicSentence.BuildermergeFrom(Sentenceother)
Parameter
Name Description
other Sentence
Returns
Type Description

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicSentence.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Overrides Exceptions
Type Description

mergeFrom(Message other)

publicSentence.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
Overrides

mergeSentiment(Sentiment value)

publicSentence.BuildermergeSentiment(Sentimentvalue)

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.v1.Sentiment sentiment = 2;

Parameter
Name Description
value Sentiment
Returns
Type Description

mergeText(TextSpan value)

publicSentence.BuildermergeText(TextSpanvalue)

The sentence text.

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

Parameter
Name Description
value TextSpan
Returns
Type Description

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalSentence.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

publicSentence.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

publicSentence.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
index int
value Object
Returns
Type Description
Overrides

setSentiment(Sentiment value)

publicSentence.BuildersetSentiment(Sentimentvalue)

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.v1.Sentiment sentiment = 2;

Parameter
Name Description
value Sentiment
Returns
Type Description

setSentiment(Sentiment.Builder builderForValue)

publicSentence.BuildersetSentiment(Sentiment.BuilderbuilderForValue)

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.v1.Sentiment sentiment = 2;

Parameter
Name Description
builderForValue Sentiment.Builder
Returns
Type Description

setText(TextSpan value)

publicSentence.BuildersetText(TextSpanvalue)

The sentence text.

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

Parameter
Name Description
value TextSpan
Returns
Type Description

setText(TextSpan.Builder builderForValue)

publicSentence.BuildersetText(TextSpan.BuilderbuilderForValue)

The sentence text.

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

Parameter
Name Description
builderForValue TextSpan.Builder
Returns
Type Description

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalSentence.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Overrides

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.