Class: Google::Cloud::DocumentAI::V1::Document::DocumentLayout

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/documentai/v1/document.rb

Overview

Represents the parsed layout of a document as a collection of blocks that the document is divided into.

Defined Under Namespace

Classes: DocumentLayoutBlock

Instance Attribute Summary collapse

Instance Attribute Details

#blocks::Array<::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock>

Returns List of blocks in the document.

Returns:



1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
# File 'proto_docs/google/cloud/documentai/v1/document.rb', line 1055

class DocumentLayout
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents a block. A block could be one of the various types (text,
  # table, list) supported.
  # @!attribute [rw] text_block
  #   @return [::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock::LayoutTextBlock]
  #     Block consisting of text content.
  # @!attribute [rw] table_block
  #   @return [::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock::LayoutTableBlock]
  #     Block consisting of table content/structure.
  # @!attribute [rw] list_block
  #   @return [::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock::LayoutListBlock]
  #     Block consisting of list content/structure.
  # @!attribute [rw] block_id
  #   @return [::String]
  #     ID of the block.
  # @!attribute [rw] page_span
  #   @return [::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock::LayoutPageSpan]
  #     Page span of the block.
  class DocumentLayoutBlock
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Represents where the block starts and ends in the document.
    # @!attribute [rw] page_start
    #   @return [::Integer]
    #     Page where block starts in the document.
    # @!attribute [rw] page_end
    #   @return [::Integer]
    #     Page where block ends in the document.
    class LayoutPageSpan
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Represents a text type block.
    # @!attribute [rw] text
    #   @return [::String]
    #     Text content stored in the block.
    # @!attribute [rw] type
    #   @return [::String]
    #     Type of the text in the block. Available options are: `paragraph`,
    #     `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`,
    #     `heading-5`, `header`, `footer`.
    # @!attribute [rw] blocks
    #   @return [::Array<::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock>]
    #     A text block could further have child blocks.
    #     Repeated blocks support further hierarchies and nested blocks.
    class LayoutTextBlock
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Represents a table type block.
    # @!attribute [rw] header_rows
    #   @return [::Array<::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock::LayoutTableRow>]
    #     Header rows at the top of the table.
    # @!attribute [rw] body_rows
    #   @return [::Array<::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock::LayoutTableRow>]
    #     Body rows containing main table content.
    # @!attribute [rw] caption
    #   @return [::String]
    #     Table caption/title.
    class LayoutTableBlock
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Represents a row in a table.
    # @!attribute [rw] cells
    #   @return [::Array<::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock::LayoutTableCell>]
    #     A table row is a list of table cells.
    class LayoutTableRow
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Represents a cell in a table row.
    # @!attribute [rw] blocks
    #   @return [::Array<::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock>]
    #     A table cell is a list of blocks.
    #     Repeated blocks support further hierarchies and nested blocks.
    # @!attribute [rw] row_span
    #   @return [::Integer]
    #     How many rows this cell spans.
    # @!attribute [rw] col_span
    #   @return [::Integer]
    #     How many columns this cell spans.
    class LayoutTableCell
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Represents a list type block.
    # @!attribute [rw] list_entries
    #   @return [::Array<::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock::LayoutListEntry>]
    #     List entries that constitute a list block.
    # @!attribute [rw] type
    #   @return [::String]
    #     Type of the list_entries (if exist). Available options are `ordered`
    #     and `unordered`.
    class LayoutListBlock
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Represents an entry in the list.
    # @!attribute [rw] blocks
    #   @return [::Array<::Google::Cloud::DocumentAI::V1::Document::DocumentLayout::DocumentLayoutBlock>]
    #     A list entry is a list of blocks.
    #     Repeated blocks support further hierarchies and nested blocks.
    class LayoutListEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end
end