Class: Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPage

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

Overview

A page in a Document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDocumentaiV1DocumentPage

Returns a new instance of GoogleCloudDocumentaiV1DocumentPage.



1600
1601
1602
# File 'lib/google/apis/documentai_v1/classes.rb', line 1600

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

Instance Attribute Details

#blocksArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageBlock>

A list of visually detected text blocks on the page. A block has a set of lines (collected into paragraphs) that have a common line-spacing and orientation. Corresponds to the JSON property blocks



1527
1528
1529
# File 'lib/google/apis/documentai_v1/classes.rb', line 1527

def blocks
  @blocks
end

#detected_languagesArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageDetectedLanguage>

A list of detected languages together with confidence. Corresponds to the JSON property detectedLanguages



1532
1533
1534
# File 'lib/google/apis/documentai_v1/classes.rb', line 1532

def detected_languages
  @detected_languages
end

#dimensionGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageDimension

Dimension for the page. Corresponds to the JSON property dimension



1537
1538
1539
# File 'lib/google/apis/documentai_v1/classes.rb', line 1537

def dimension
  @dimension
end

#form_fieldsArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageFormField>

A list of visually detected form fields on the page. Corresponds to the JSON property formFields



1542
1543
1544
# File 'lib/google/apis/documentai_v1/classes.rb', line 1542

def form_fields
  @form_fields
end

#imageGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageImage

Rendered image contents for this page. Corresponds to the JSON property image



1547
1548
1549
# File 'lib/google/apis/documentai_v1/classes.rb', line 1547

def image
  @image
end

#layoutGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageLayout

Visual element describing a layout unit on a page. Corresponds to the JSON property layout



1552
1553
1554
# File 'lib/google/apis/documentai_v1/classes.rb', line 1552

def layout
  @layout
end

#linesArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageLine>

A list of visually detected text lines on the page. A collection of tokens that a human would perceive as a line. Corresponds to the JSON property lines



1558
1559
1560
# File 'lib/google/apis/documentai_v1/classes.rb', line 1558

def lines
  @lines
end

#page_numberFixnum

1-based index for current Page in a parent Document. Useful when a page is taken out of a Document for individual processing. Corresponds to the JSON property pageNumber

Returns:

  • (Fixnum)


1564
1565
1566
# File 'lib/google/apis/documentai_v1/classes.rb', line 1564

def page_number
  @page_number
end

#paragraphsArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageParagraph>

A list of visually detected text paragraphs on the page. A collection of lines that a human would perceive as a paragraph. Corresponds to the JSON property paragraphs



1570
1571
1572
# File 'lib/google/apis/documentai_v1/classes.rb', line 1570

def paragraphs
  @paragraphs
end

#provenanceGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentProvenance

Structure to identify provenance relationships between annotations in different revisions. Corresponds to the JSON property provenance



1576
1577
1578
# File 'lib/google/apis/documentai_v1/classes.rb', line 1576

def provenance
  @provenance
end

#tablesArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageTable>

A list of visually detected tables on the page. Corresponds to the JSON property tables



1581
1582
1583
# File 'lib/google/apis/documentai_v1/classes.rb', line 1581

def tables
  @tables
end

#tokensArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageToken>

A list of visually detected tokens on the page. Corresponds to the JSON property tokens



1586
1587
1588
# File 'lib/google/apis/documentai_v1/classes.rb', line 1586

def tokens
  @tokens
end

#transformsArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageMatrix>

Transformation matrices that were applied to the original document image to produce Page.image. Corresponds to the JSON property transforms



1592
1593
1594
# File 'lib/google/apis/documentai_v1/classes.rb', line 1592

def transforms
  @transforms
end

#visual_elementsArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageVisualElement>

A list of detected non-text visual elements e.g. checkbox, signature etc. on the page. Corresponds to the JSON property visualElements



1598
1599
1600
# File 'lib/google/apis/documentai_v1/classes.rb', line 1598

def visual_elements
  @visual_elements
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
# File 'lib/google/apis/documentai_v1/classes.rb', line 1605

def update!(**args)
  @blocks = args[:blocks] if args.key?(:blocks)
  @detected_languages = args[:detected_languages] if args.key?(:detected_languages)
  @dimension = args[:dimension] if args.key?(:dimension)
  @form_fields = args[:form_fields] if args.key?(:form_fields)
  @image = args[:image] if args.key?(:image)
  @layout = args[:layout] if args.key?(:layout)
  @lines = args[:lines] if args.key?(:lines)
  @page_number = args[:page_number] if args.key?(:page_number)
  @paragraphs = args[:paragraphs] if args.key?(:paragraphs)
  @provenance = args[:provenance] if args.key?(:provenance)
  @tables = args[:tables] if args.key?(:tables)
  @tokens = args[:tokens] if args.key?(:tokens)
  @transforms = args[:transforms] if args.key?(:transforms)
  @visual_elements = args[:visual_elements] if args.key?(:visual_elements)
end