Class: Google::Cloud::AutoML::V1beta1::Document::Layout

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/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_polyGoogle::Cloud::AutoML::V1beta1::BoundingPoly

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

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

Returns:



126
127
128
129
130
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
# File 'lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_items.rb', line 126

class Layout
  # 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_numberInteger

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.



126
127
128
129
130
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
# File 'lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_items.rb', line 126

class Layout
  # 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_segmentGoogle::Cloud::AutoML::V1beta1::TextSegment

Returns Text Segment that represents a segment in document_text.

Returns:



126
127
128
129
130
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
# File 'lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_items.rb', line 126

class Layout
  # 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_typeGoogle::Cloud::AutoML::V1beta1::Document::Layout::TextSegmentType

Returns The type of the text_segment in document.



126
127
128
129
130
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
# File 'lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_items.rb', line 126

class Layout
  # 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