public sealed class Document.Types.TextAnchor.Types.TextSegment : IMessage<Document.Types.TextAnchor.Types.TextSegment>, IEquatable<Document.Types.TextAnchor.Types.TextSegment>, IDeepCloneable<Document.Types.TextAnchor.Types.TextSegment>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Document AI v1 API class Document.Types.TextAnchor.Types.TextSegment.
A text segment in the
[Document.text][google.cloud.documentai.v1.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][google.cloud.documentai.v1.Document.ShardInfo.text_offset]
[TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
half open end UTF-8 char index in the
[Document.text][google.cloud.documentai.v1.Document.text].
[TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
start UTF-8 char index in the
[Document.text][google.cloud.documentai.v1.Document.text].
[[["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-08-19 UTC."],[[["\u003cp\u003eThe webpage provides documentation for the \u003ccode\u003eDocument.Types.TextAnchor.Types.TextSegment\u003c/code\u003e class within the Google Cloud Document AI v1 API, detailing its role in representing a text segment within a document.\u003c/p\u003e\n"],["\u003cp\u003eIt lists various versions of the API, ranging from version 1.0.0 to the latest version, 3.19.0, each linked to its corresponding documentation.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTextSegment\u003c/code\u003e class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, indicating its functionality for message handling, equality comparisons, deep cloning, and buffered message operations.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes properties \u003ccode\u003eEndIndex\u003c/code\u003e and \u003ccode\u003eStartIndex\u003c/code\u003e, which define the half-open range of a UTF-8 char index in the document text, allowing the identification of specific text segments.\u003c/p\u003e\n"],["\u003cp\u003eThe TextSegment class can be constructed either with an empty constructor or one that takes in another TextSegment as a parameter, with detailed descriptions provided about each.\u003c/p\u003e\n"]]],[],null,[]]