Google Cloud Document Ai V1 Client - Class TextSegment (1.0.1)

Reference documentation and code samples for the Google Cloud Document Ai V1 Client class TextSegment.

A text segment in the Document.text. The indices may be out of bounds which indicate that the text extends into another document shard for large sharded documents. See ShardInfo.text_offset

Generated from protobuf message google.cloud.documentai.v1.Document.TextAnchor.TextSegment

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ start_index int|string

TextSegment start UTF-8 char index in the Document.text.

↳ end_index int|string

TextSegment half open end UTF-8 char index in the Document.text.

getStartIndex

TextSegment start UTF-8 char index in the Document.text.

Generated from protobuf field int64 start_index = 1;

Returns
TypeDescription
int|string

setStartIndex

TextSegment start UTF-8 char index in the Document.text.

Generated from protobuf field int64 start_index = 1;

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getEndIndex

TextSegment half open end UTF-8 char index in the Document.text.

Generated from protobuf field int64 end_index = 2;

Returns
TypeDescription
int|string

setEndIndex

TextSegment half open end UTF-8 char index in the Document.text.

Generated from protobuf field int64 end_index = 2;

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this