Class: Google::Apis::DocumentaiV1beta2::GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/documentai_v1beta2/classes.rb,
generated/google/apis/documentai_v1beta2/representations.rb,
generated/google/apis/documentai_v1beta2/representations.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment

Returns a new instance of GoogleCloudDocumentaiV1beta1DocumentTextAnchorTextSegment.



1723
1724
1725
# File 'generated/google/apis/documentai_v1beta2/classes.rb', line 1723

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#end_indexFixnum

TextSegment half open end UTF-8 char index in the Document.text. Corresponds to the JSON property endIndex

Returns:

  • (Fixnum)


1716
1717
1718
# File 'generated/google/apis/documentai_v1beta2/classes.rb', line 1716

def end_index
  @end_index
end

#start_indexFixnum

TextSegment start UTF-8 char index in the Document.text. Corresponds to the JSON property startIndex

Returns:

  • (Fixnum)


1721
1722
1723
# File 'generated/google/apis/documentai_v1beta2/classes.rb', line 1721

def start_index
  @start_index
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1728
1729
1730
1731
# File 'generated/google/apis/documentai_v1beta2/classes.rb', line 1728

def update!(**args)
  @end_index = args[:end_index] if args.key?(:end_index)
  @start_index = args[:start_index] if args.key?(:start_index)
end