Cloud Natural Language V1 Client - Class TextSpan (0.30.2)

Reference documentation and code samples for the Cloud Natural Language V1 Client class TextSpan.

Represents an output piece of text.

Generated from protobuf message google.cloud.language.v1.TextSpan

Namespace

Google \ Cloud \ Language \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ content string

The content of the output text.

↳ begin_offset int

The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.

getContent

The content of the output text.

Returns
TypeDescription
string

setContent

The content of the output text.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getBeginOffset

The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.

Returns
TypeDescription
int

setBeginOffset

The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.

Parameter
NameDescription
var int
Returns
TypeDescription
$this