Cloud AutoML V1 Client - Class TextSegment (1.5.4)

Reference documentation and code samples for the Cloud AutoML V1 Client class TextSegment.

A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding.

Generated from protobuf message google.cloud.automl.v1.TextSegment

Namespace

Google \ Cloud \ AutoMl \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ content string

Output only. The content of the TextSegment.

↳ start_offset int|string

Required. Zero-based character index of the first character of the text segment (counting characters from the beginning of the text).

↳ end_offset int|string

Required. Zero-based character index of the first character past the end of the text segment (counting character from the beginning of the text). The character at the end_offset is NOT included in the text segment.

getContent

Output only. The content of the TextSegment.

Returns
TypeDescription
string

setContent

Output only. The content of the TextSegment.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getStartOffset

Required. Zero-based character index of the first character of the text segment (counting characters from the beginning of the text).

Returns
TypeDescription
int|string

setStartOffset

Required. Zero-based character index of the first character of the text segment (counting characters from the beginning of the text).

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getEndOffset

Required. Zero-based character index of the first character past the end of the text segment (counting character from the beginning of the text).

The character at the end_offset is NOT included in the text segment.

Returns
TypeDescription
int|string

setEndOffset

Required. Zero-based character index of the first character past the end of the text segment (counting character from the beginning of the text).

The character at the end_offset is NOT included in the text segment.

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this