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

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

Namespace

Google \ Cloud \ DocumentAI \ V1 \ Document \ TextAnchor

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.

Returns
TypeDescription
int|string

setStartIndex

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

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getEndIndex

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

Returns
TypeDescription
int|string

setEndIndex

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

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this