Class Token (2.65.0)

publicfinalclass TokenextendsGeneratedMessageV3implementsTokenOrBuilder

Represents the smallest syntactic building block of the text.

Protobuf type google.cloud.language.v1.Token

Implements

TokenOrBuilder

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

DEPENDENCY_EDGE_FIELD_NUMBER

publicstaticfinalintDEPENDENCY_EDGE_FIELD_NUMBER
Field Value
Type Description
int

LEMMA_FIELD_NUMBER

publicstaticfinalintLEMMA_FIELD_NUMBER
Field Value
Type Description
int

PART_OF_SPEECH_FIELD_NUMBER

publicstaticfinalintPART_OF_SPEECH_FIELD_NUMBER
Field Value
Type Description
int

TEXT_FIELD_NUMBER

publicstaticfinalintTEXT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticTokengetDefaultInstance()
Returns
Type Description
Token

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticToken.BuildernewBuilder()
Returns
Type Description
Token.Builder

newBuilder(Token prototype)

publicstaticToken.BuildernewBuilder(Tokenprototype)
Parameter
Name Description
prototype Token
Returns
Type Description
Token.Builder

parseDelimitedFrom(InputStream input)

publicstaticTokenparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Token
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticTokenparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Token
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticTokenparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Token
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticTokenparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Token
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticTokenparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Token
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticTokenparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Token
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticTokenparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Token
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticTokenparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Token
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticTokenparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Token
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticTokenparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Token
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticTokenparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Token
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticTokenparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Token
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<Token>parser()
Returns
Type Description
Parser<Token>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

publicTokengetDefaultInstanceForType()
Returns
Type Description
Token

getDependencyEdge()

publicDependencyEdgegetDependencyEdge()

Dependency tree parse for this token.

.google.cloud.language.v1.DependencyEdge dependency_edge = 3;

Returns
Type Description
DependencyEdge

The dependencyEdge.

getDependencyEdgeOrBuilder()

publicDependencyEdgeOrBuildergetDependencyEdgeOrBuilder()

Dependency tree parse for this token.

.google.cloud.language.v1.DependencyEdge dependency_edge = 3;

Returns
Type Description
DependencyEdgeOrBuilder

getLemma()

publicStringgetLemma()

Lemma of the token.

string lemma = 4;

Returns
Type Description
String

The lemma.

getLemmaBytes()

publicByteStringgetLemmaBytes()

Lemma of the token.

string lemma = 4;

Returns
Type Description
ByteString

The bytes for lemma.

getParserForType()

publicParser<Token>getParserForType()
Returns
Type Description
Parser<Token>
Overrides

getPartOfSpeech()

publicPartOfSpeechgetPartOfSpeech()

Parts of speech tag for this token.

.google.cloud.language.v1.PartOfSpeech part_of_speech = 2;

Returns
Type Description
PartOfSpeech

The partOfSpeech.

getPartOfSpeechOrBuilder()

publicPartOfSpeechOrBuildergetPartOfSpeechOrBuilder()

Parts of speech tag for this token.

.google.cloud.language.v1.PartOfSpeech part_of_speech = 2;

Returns
Type Description
PartOfSpeechOrBuilder

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getText()

publicTextSpangetText()

The token text.

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

Returns
Type Description
TextSpan

The text.

getTextOrBuilder()

publicTextSpanOrBuildergetTextOrBuilder()

The token text.

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

Returns
Type Description
TextSpanOrBuilder

hasDependencyEdge()

publicbooleanhasDependencyEdge()

Dependency tree parse for this token.

.google.cloud.language.v1.DependencyEdge dependency_edge = 3;

Returns
Type Description
boolean

Whether the dependencyEdge field is set.

hasPartOfSpeech()

publicbooleanhasPartOfSpeech()

Parts of speech tag for this token.

.google.cloud.language.v1.PartOfSpeech part_of_speech = 2;

Returns
Type Description
boolean

Whether the partOfSpeech field is set.

hasText()

publicbooleanhasText()

The token text.

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

Returns
Type Description
boolean

Whether the text field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicToken.BuildernewBuilderForType()
Returns
Type Description
Token.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedToken.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Token.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicToken.BuildertoBuilder()
Returns
Type Description
Token.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

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.