Class EntityMention (2.46.0)

publicfinalclass EntityMentionextendsGeneratedMessageV3implementsEntityMentionOrBuilder

Represents a mention for an entity in the text. Currently, proper noun mentions are supported.

Protobuf type google.cloud.language.v1.EntityMention

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

SENTIMENT_FIELD_NUMBER

publicstaticfinalintSENTIMENT_FIELD_NUMBER
Field Value
Type Description
int

TEXT_FIELD_NUMBER

publicstaticfinalintTEXT_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

publicstaticfinalintTYPE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticEntityMentiongetDefaultInstance()
Returns
Type Description
EntityMention

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticEntityMention.BuildernewBuilder()
Returns
Type Description
EntityMention.Builder

newBuilder(EntityMention prototype)

publicstaticEntityMention.BuildernewBuilder(EntityMentionprototype)
Parameter
Name Description
prototype EntityMention
Returns
Type Description
EntityMention.Builder

parseDelimitedFrom(InputStream input)

publicstaticEntityMentionparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
EntityMention
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

publicstaticEntityMentionparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
EntityMention
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

publicstaticEntityMentionparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
EntityMention
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

publicstaticEntityMentionparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
EntityMention
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

publicstaticEntityMentionparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
EntityMention
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

publicstaticEntityMentionparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
EntityMention
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getDefaultInstanceForType()

publicEntityMentiongetDefaultInstanceForType()
Returns
Type Description
EntityMention

getParserForType()

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

getSentiment()

publicSentimentgetSentiment()

For calls to [AnalyzeEntitySentiment][] or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.

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

Returns
Type Description
Sentiment

The sentiment.

getSentimentOrBuilder()

publicSentimentOrBuildergetSentimentOrBuilder()

For calls to [AnalyzeEntitySentiment][] or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.

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

Returns
Type Description
SentimentOrBuilder

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getText()

publicTextSpangetText()

The mention text.

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

Returns
Type Description
TextSpan

The text.

getTextOrBuilder()

publicTextSpanOrBuildergetTextOrBuilder()

The mention text.

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

Returns
Type Description
TextSpanOrBuilder

getType()

publicEntityMention.TypegetType()

The type of the entity mention.

.google.cloud.language.v1.EntityMention.Type type = 2;

Returns
Type Description
EntityMention.Type

The type.

getTypeValue()

publicintgetTypeValue()

The type of the entity mention.

.google.cloud.language.v1.EntityMention.Type type = 2;

Returns
Type Description
int

The enum numeric value on the wire for type.

hasSentiment()

publicbooleanhasSentiment()

For calls to [AnalyzeEntitySentiment][] or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.

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

Returns
Type Description
boolean

Whether the sentiment field is set.

hasText()

publicbooleanhasText()

The mention 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()

publicEntityMention.BuildernewBuilderForType()
Returns
Type Description
EntityMention.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedEntityMention.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
EntityMention.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

publicEntityMention.BuildertoBuilder()
Returns
Type Description
EntityMention.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.