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 | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
int|string |
setStartIndex
TextSegment start UTF-8 char index in the Document.text.
Parameter | |
---|---|
Name | Description |
var |
int|string
|
Returns | |
---|---|
Type | Description |
$this |
getEndIndex
TextSegment half open end UTF-8 char index in the Document.text.
Returns | |
---|---|
Type | Description |
int|string |
setEndIndex
TextSegment half open end UTF-8 char index in the Document.text.
Parameter | |
---|---|
Name | Description |
var |
int|string
|
Returns | |
---|---|
Type | Description |
$this |