Class Sentence (2.8.0)

public final class Sentence extends GeneratedMessageV3 implements SentenceOrBuilder

Represents a sentence in the input document.

Protobuf type google.cloud.language.v1.Sentence

Implements

SentenceOrBuilder

Static Fields

SENTIMENT_FIELD_NUMBER

public static final int SENTIMENT_FIELD_NUMBER
Field Value
TypeDescription
int

TEXT_FIELD_NUMBER

public static final int TEXT_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Sentence getDefaultInstance()
Returns
TypeDescription
Sentence

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Sentence.Builder newBuilder()
Returns
TypeDescription
Sentence.Builder

newBuilder(Sentence prototype)

public static Sentence.Builder newBuilder(Sentence prototype)
Parameter
NameDescription
prototypeSentence
Returns
TypeDescription
Sentence.Builder

parseDelimitedFrom(InputStream input)

public static Sentence parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Sentence parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Sentence parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Sentence parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Sentence parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Sentence parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Sentence parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Sentence parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Sentence parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Sentence parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Sentence parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Sentence parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Sentence
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Sentence> parser()
Returns
TypeDescription
Parser<Sentence>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Sentence getDefaultInstanceForType()
Returns
TypeDescription
Sentence

getParserForType()

public Parser<Sentence> getParserForType()
Returns
TypeDescription
Parser<Sentence>
Overrides

getSentiment()

public Sentiment 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.

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

Returns
TypeDescription
Sentiment

The sentiment.

getSentimentOrBuilder()

public SentimentOrBuilder getSentimentOrBuilder()

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
TypeDescription
SentimentOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getText()

public TextSpan getText()

The sentence text.

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

Returns
TypeDescription
TextSpan

The text.

getTextOrBuilder()

public TextSpanOrBuilder getTextOrBuilder()

The sentence text.

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

Returns
TypeDescription
TextSpanOrBuilder

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hasSentiment()

public boolean hasSentiment()

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
TypeDescription
boolean

Whether the sentiment field is set.

hasText()

public boolean hasText()

The sentence text.

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

Returns
TypeDescription
boolean

Whether the text field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Sentence.Builder newBuilderForType()
Returns
TypeDescription
Sentence.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Sentence.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Sentence.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Sentence.Builder toBuilder()
Returns
TypeDescription
Sentence.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException