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 messagegoogle.cloud.automl.v1.TextSegment
Namespace
Google \ Cloud \ AutoMl \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
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
Type
Description
string
setContent
Output only. The content of the TextSegment.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getStartOffset
Required. Zero-based character index of the first character of the text
segment (counting characters from the beginning of the text).
Returns
Type
Description
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
Name
Description
var
int|string
Returns
Type
Description
$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
Type
Description
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud AutoML V1 Client - Class TextSegment (2.0.5)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.5 (latest)](/php/docs/reference/cloud-automl/latest/V1.TextSegment)\n- [2.0.4](/php/docs/reference/cloud-automl/2.0.4/V1.TextSegment)\n- [1.6.5](/php/docs/reference/cloud-automl/1.6.5/V1.TextSegment)\n- [1.5.4](/php/docs/reference/cloud-automl/1.5.4/V1.TextSegment)\n- [1.4.17](/php/docs/reference/cloud-automl/1.4.17/V1.TextSegment) \nReference documentation and code samples for the Cloud AutoML V1 Client class TextSegment.\n\nA contiguous part of a text (string), assuming it has an UTF-8 NFC encoding.\n\nGenerated from protobuf message `google.cloud.automl.v1.TextSegment`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ AutoMl \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getContent\n\nOutput only. The content of the TextSegment.\n\n### setContent\n\nOutput only. The content of the TextSegment.\n\n### getStartOffset\n\nRequired. Zero-based character index of the first character of the text\nsegment (counting characters from the beginning of the text).\n\n### setStartOffset\n\nRequired. Zero-based character index of the first character of the text\nsegment (counting characters from the beginning of the text).\n\n### getEndOffset\n\nRequired. Zero-based character index of the first character past the end of\nthe text segment (counting character from the beginning of the text).\n\nThe character at the end_offset is NOT included in the text segment.\n\n### setEndOffset\n\nRequired. Zero-based character index of the first character past the end of\nthe text segment (counting character from the beginning of the text).\n\nThe character at the end_offset is NOT included in the text segment."]]