Class Token (2.34.0)

public final class Token extends GeneratedMessageV3 implements TokenOrBuilder

Represents the smallest syntactic building block of the text.

Protobuf type google.cloud.language.v1beta2.Token

Implements

TokenOrBuilder

Static Fields

DEPENDENCY_EDGE_FIELD_NUMBER

public static final int DEPENDENCY_EDGE_FIELD_NUMBER
Field Value
TypeDescription
int

LEMMA_FIELD_NUMBER

public static final int LEMMA_FIELD_NUMBER
Field Value
TypeDescription
int

PART_OF_SPEECH_FIELD_NUMBER

public static final int PART_OF_SPEECH_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 Token getDefaultInstance()
Returns
TypeDescription
Token

getDescriptor()

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

newBuilder()

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

newBuilder(Token prototype)

public static Token.Builder newBuilder(Token prototype)
Parameter
NameDescription
prototypeToken
Returns
TypeDescription
Token.Builder

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getDefaultInstanceForType()

public Token getDefaultInstanceForType()
Returns
TypeDescription
Token

getDependencyEdge()

public DependencyEdge getDependencyEdge()

Dependency tree parse for this token.

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

Returns
TypeDescription
DependencyEdge

The dependencyEdge.

getDependencyEdgeOrBuilder()

public DependencyEdgeOrBuilder getDependencyEdgeOrBuilder()

Dependency tree parse for this token.

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

Returns
TypeDescription
DependencyEdgeOrBuilder

getLemma()

public String getLemma()

Lemma of the token.

string lemma = 4;

Returns
TypeDescription
String

The lemma.

getLemmaBytes()

public ByteString getLemmaBytes()

Lemma of the token.

string lemma = 4;

Returns
TypeDescription
ByteString

The bytes for lemma.

getParserForType()

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

getPartOfSpeech()

public PartOfSpeech getPartOfSpeech()

Parts of speech tag for this token.

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

Returns
TypeDescription
PartOfSpeech

The partOfSpeech.

getPartOfSpeechOrBuilder()

public PartOfSpeechOrBuilder getPartOfSpeechOrBuilder()

Parts of speech tag for this token.

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

Returns
TypeDescription
PartOfSpeechOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getText()

public TextSpan getText()

The token text.

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

Returns
TypeDescription
TextSpan

The text.

getTextOrBuilder()

public TextSpanOrBuilder getTextOrBuilder()

The token text.

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

Returns
TypeDescription
TextSpanOrBuilder

hasDependencyEdge()

public boolean hasDependencyEdge()

Dependency tree parse for this token.

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

Returns
TypeDescription
boolean

Whether the dependencyEdge field is set.

hasPartOfSpeech()

public boolean hasPartOfSpeech()

Parts of speech tag for this token.

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

Returns
TypeDescription
boolean

Whether the partOfSpeech field is set.

hasText()

public boolean hasText()

The token text.

.google.cloud.language.v1beta2.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 Token.Builder newBuilderForType()
Returns
TypeDescription
Token.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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