Cloud Natural Language V1beta2 Client - Class EntityMention (0.33.0)

Reference documentation and code samples for the Cloud Natural Language V1beta2 Client class EntityMention.

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

Generated from protobuf message google.cloud.language.v1beta2.EntityMention

Namespace

Google \ Cloud \ Language \ V1beta2

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ text Google\Cloud\Language\V1beta2\TextSpan

The mention text.

↳ type int

The type of the entity mention.

↳ sentiment Google\Cloud\Language\V1beta2\Sentiment

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.

getText

The mention text.

Returns
Type Description
Google\Cloud\Language\V1beta2\TextSpan|null

hasText

clearText

setText

The mention text.

Parameter
Name Description
var Google\Cloud\Language\V1beta2\TextSpan
Returns
Type Description
$this

getType

The type of the entity mention.

Returns
Type Description
int

setType

The type of the entity mention.

Parameter
Name Description
var int
Returns
Type Description
$this

getSentiment

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.

Returns
Type Description
Google\Cloud\Language\V1beta2\Sentiment|null

hasSentiment

clearSentiment

setSentiment

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.

Parameter
Name Description
var Google\Cloud\Language\V1beta2\Sentiment
Returns
Type Description
$this