Class: Google::Cloud::AutoML::V1::Document::Layout

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

Overview

Describes the layout information of a text_segment in the document.

Defined Under Namespace

Modules: TextSegmentType

Instance Attribute Summary collapse

Instance Attribute Details

#bounding_poly::Google::Cloud::AutoML::V1::BoundingPoly

Returns The position of the text_segment in the page. Contains exactly 4

[normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] and they are connected by edges in the order provided, which will represent a rectangle parallel to the frame. The [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are relative to the page. Coordinates are based on top-left as point (0,0).

Returns:

  • (::Google::Cloud::AutoML::V1::BoundingPoly)

    The position of the text_segment in the page. Contains exactly 4

    [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] and they are connected by edges in the order provided, which will represent a rectangle parallel to the frame. The [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are relative to the page. Coordinates are based on top-left as point (0,0).



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'proto_docs/google/cloud/automl/v1/data_items.rb', line 131

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

  # The type of TextSegment in the context of the original document.
  module TextSegmentType
    # Should not be used.
    TEXT_SEGMENT_TYPE_UNSPECIFIED = 0

    # The text segment is a token. e.g. word.
    TOKEN = 1

    # The text segment is a paragraph.
    PARAGRAPH = 2

    # The text segment is a form field.
    FORM_FIELD = 3

    # The text segment is the name part of a form field. It will be treated
    # as child of another FORM_FIELD TextSegment if its span is subspan of
    # another TextSegment with type FORM_FIELD.
    FORM_FIELD_NAME = 4

    # The text segment is the text content part of a form field. It will be
    # treated as child of another FORM_FIELD TextSegment if its span is
    # subspan of another TextSegment with type FORM_FIELD.
    FORM_FIELD_CONTENTS = 5

    # The text segment is a whole table, including headers, and all rows.
    TABLE = 6

    # The text segment is a table's headers. It will be treated as child of
    # another TABLE TextSegment if its span is subspan of another TextSegment
    # with type TABLE.
    TABLE_HEADER = 7

    # The text segment is a row in table. It will be treated as child of
    # another TABLE TextSegment if its span is subspan of another TextSegment
    # with type TABLE.
    TABLE_ROW = 8

    # The text segment is a cell in table. It will be treated as child of
    # another TABLE_ROW TextSegment if its span is subspan of another
    # TextSegment with type TABLE_ROW.
    TABLE_CELL = 9
  end
end

#page_number::Integer

Returns Page number of the text_segment in the original document, starts from 1.

Returns:

  • (::Integer)

    Page number of the text_segment in the original document, starts from 1.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'proto_docs/google/cloud/automl/v1/data_items.rb', line 131

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

  # The type of TextSegment in the context of the original document.
  module TextSegmentType
    # Should not be used.
    TEXT_SEGMENT_TYPE_UNSPECIFIED = 0

    # The text segment is a token. e.g. word.
    TOKEN = 1

    # The text segment is a paragraph.
    PARAGRAPH = 2

    # The text segment is a form field.
    FORM_FIELD = 3

    # The text segment is the name part of a form field. It will be treated
    # as child of another FORM_FIELD TextSegment if its span is subspan of
    # another TextSegment with type FORM_FIELD.
    FORM_FIELD_NAME = 4

    # The text segment is the text content part of a form field. It will be
    # treated as child of another FORM_FIELD TextSegment if its span is
    # subspan of another TextSegment with type FORM_FIELD.
    FORM_FIELD_CONTENTS = 5

    # The text segment is a whole table, including headers, and all rows.
    TABLE = 6

    # The text segment is a table's headers. It will be treated as child of
    # another TABLE TextSegment if its span is subspan of another TextSegment
    # with type TABLE.
    TABLE_HEADER = 7

    # The text segment is a row in table. It will be treated as child of
    # another TABLE TextSegment if its span is subspan of another TextSegment
    # with type TABLE.
    TABLE_ROW = 8

    # The text segment is a cell in table. It will be treated as child of
    # another TABLE_ROW TextSegment if its span is subspan of another
    # TextSegment with type TABLE_ROW.
    TABLE_CELL = 9
  end
end

#text_segment::Google::Cloud::AutoML::V1::TextSegment

Returns Text Segment that represents a segment in [document_text][google.cloud.automl.v1p1beta.Document.document_text].

Returns:



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'proto_docs/google/cloud/automl/v1/data_items.rb', line 131

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

  # The type of TextSegment in the context of the original document.
  module TextSegmentType
    # Should not be used.
    TEXT_SEGMENT_TYPE_UNSPECIFIED = 0

    # The text segment is a token. e.g. word.
    TOKEN = 1

    # The text segment is a paragraph.
    PARAGRAPH = 2

    # The text segment is a form field.
    FORM_FIELD = 3

    # The text segment is the name part of a form field. It will be treated
    # as child of another FORM_FIELD TextSegment if its span is subspan of
    # another TextSegment with type FORM_FIELD.
    FORM_FIELD_NAME = 4

    # The text segment is the text content part of a form field. It will be
    # treated as child of another FORM_FIELD TextSegment if its span is
    # subspan of another TextSegment with type FORM_FIELD.
    FORM_FIELD_CONTENTS = 5

    # The text segment is a whole table, including headers, and all rows.
    TABLE = 6

    # The text segment is a table's headers. It will be treated as child of
    # another TABLE TextSegment if its span is subspan of another TextSegment
    # with type TABLE.
    TABLE_HEADER = 7

    # The text segment is a row in table. It will be treated as child of
    # another TABLE TextSegment if its span is subspan of another TextSegment
    # with type TABLE.
    TABLE_ROW = 8

    # The text segment is a cell in table. It will be treated as child of
    # another TABLE_ROW TextSegment if its span is subspan of another
    # TextSegment with type TABLE_ROW.
    TABLE_CELL = 9
  end
end

#text_segment_type::Google::Cloud::AutoML::V1::Document::Layout::TextSegmentType

Returns The type of the text_segment in document.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'proto_docs/google/cloud/automl/v1/data_items.rb', line 131

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

  # The type of TextSegment in the context of the original document.
  module TextSegmentType
    # Should not be used.
    TEXT_SEGMENT_TYPE_UNSPECIFIED = 0

    # The text segment is a token. e.g. word.
    TOKEN = 1

    # The text segment is a paragraph.
    PARAGRAPH = 2

    # The text segment is a form field.
    FORM_FIELD = 3

    # The text segment is the name part of a form field. It will be treated
    # as child of another FORM_FIELD TextSegment if its span is subspan of
    # another TextSegment with type FORM_FIELD.
    FORM_FIELD_NAME = 4

    # The text segment is the text content part of a form field. It will be
    # treated as child of another FORM_FIELD TextSegment if its span is
    # subspan of another TextSegment with type FORM_FIELD.
    FORM_FIELD_CONTENTS = 5

    # The text segment is a whole table, including headers, and all rows.
    TABLE = 6

    # The text segment is a table's headers. It will be treated as child of
    # another TABLE TextSegment if its span is subspan of another TextSegment
    # with type TABLE.
    TABLE_HEADER = 7

    # The text segment is a row in table. It will be treated as child of
    # another TABLE TextSegment if its span is subspan of another TextSegment
    # with type TABLE.
    TABLE_ROW = 8

    # The text segment is a cell in table. It will be treated as child of
    # another TABLE_ROW TextSegment if its span is subspan of another
    # TextSegment with type TABLE_ROW.
    TABLE_CELL = 9
  end
end