Class: Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment

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

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) ⇒ GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment

Returns a new instance of GoogleCloudDocumentaiV1beta2DocumentTextAnchorTextSegment.

[View source]

9528
9529
9530
# File 'lib/google/apis/documentai_v1/classes.rb', line 9528

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)

9521
9522
9523
# File 'lib/google/apis/documentai_v1/classes.rb', line 9521

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)

9526
9527
9528
# File 'lib/google/apis/documentai_v1/classes.rb', line 9526

def start_index
  @start_index
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object

[View source]

9533
9534
9535
9536
# File 'lib/google/apis/documentai_v1/classes.rb', line 9533

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