cloudmersive-ocr-api-client 1.5.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. metadata +3 -109
  3. data/Gemfile +0 -7
  4. data/README.md +0 -150
  5. data/Rakefile +0 -8
  6. data/cloudmersive-ocr-api-client.gemspec +0 -45
  7. data/docs/BusinessCardRecognitionResult.md +0 -15
  8. data/docs/FieldResult.md +0 -9
  9. data/docs/FormDefinitionTemplate.md +0 -9
  10. data/docs/FormFieldDefinition.md +0 -25
  11. data/docs/FormRecognitionResult.md +0 -12
  12. data/docs/FormTableColumnDefinition.md +0 -13
  13. data/docs/FormTableDefinition.md +0 -11
  14. data/docs/GetPageAngleResult.md +0 -9
  15. data/docs/ImageOcrApi.md +0 -571
  16. data/docs/ImageToLinesWithLocationResult.md +0 -9
  17. data/docs/ImageToTextResponse.md +0 -9
  18. data/docs/ImageToWordsWithLocationResult.md +0 -9
  19. data/docs/OcrLineElement.md +0 -9
  20. data/docs/OcrPageResult.md +0 -10
  21. data/docs/OcrPageResultWithLinesWithLocation.md +0 -10
  22. data/docs/OcrPageResultWithWordsWithLocation.md +0 -10
  23. data/docs/OcrPhotoTextElement.md +0 -14
  24. data/docs/OcrWordElement.md +0 -18
  25. data/docs/PdfOcrApi.md +0 -191
  26. data/docs/PdfToLinesWithLocationResult.md +0 -9
  27. data/docs/PdfToTextResponse.md +0 -9
  28. data/docs/PdfToWordsWithLocationResult.md +0 -9
  29. data/docs/PhotoToWordsWithLocationResult.md +0 -10
  30. data/docs/Point.md +0 -9
  31. data/docs/PreprocessingApi.md +0 -338
  32. data/docs/ReceiptLineItem.md +0 -9
  33. data/docs/ReceiptRecognitionResult.md +0 -16
  34. data/docs/ReceiptsApi.md +0 -63
  35. data/docs/TableCellResult.md +0 -9
  36. data/docs/TableResult.md +0 -9
  37. data/docs/TableRowResult.md +0 -8
  38. data/git_push.sh +0 -55
  39. data/lib/cloudmersive-ocr-api-client.rb +0 -70
  40. data/lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb +0 -605
  41. data/lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb +0 -212
  42. data/lib/cloudmersive-ocr-api-client/api/preprocessing_api.rb +0 -359
  43. data/lib/cloudmersive-ocr-api-client/api/receipts_api.rb +0 -79
  44. data/lib/cloudmersive-ocr-api-client/api_client.rb +0 -389
  45. data/lib/cloudmersive-ocr-api-client/api_error.rb +0 -38
  46. data/lib/cloudmersive-ocr-api-client/configuration.rb +0 -209
  47. data/lib/cloudmersive-ocr-api-client/models/business_card_recognition_result.rb +0 -259
  48. data/lib/cloudmersive-ocr-api-client/models/field_result.rb +0 -201
  49. data/lib/cloudmersive-ocr-api-client/models/form_definition_template.rb +0 -203
  50. data/lib/cloudmersive-ocr-api-client/models/form_field_definition.rb +0 -361
  51. data/lib/cloudmersive-ocr-api-client/models/form_recognition_result.rb +0 -235
  52. data/lib/cloudmersive-ocr-api-client/models/form_table_column_definition.rb +0 -239
  53. data/lib/cloudmersive-ocr-api-client/models/form_table_definition.rb +0 -221
  54. data/lib/cloudmersive-ocr-api-client/models/get_page_angle_result.rb +0 -199
  55. data/lib/cloudmersive-ocr-api-client/models/image_to_lines_with_location_result.rb +0 -201
  56. data/lib/cloudmersive-ocr-api-client/models/image_to_text_response.rb +0 -199
  57. data/lib/cloudmersive-ocr-api-client/models/image_to_words_with_location_result.rb +0 -201
  58. data/lib/cloudmersive-ocr-api-client/models/ocr_line_element.rb +0 -201
  59. data/lib/cloudmersive-ocr-api-client/models/ocr_page_result.rb +0 -209
  60. data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_lines_with_location.rb +0 -211
  61. data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_words_with_location.rb +0 -211
  62. data/lib/cloudmersive-ocr-api-client/models/ocr_photo_text_element.rb +0 -251
  63. data/lib/cloudmersive-ocr-api-client/models/ocr_word_element.rb +0 -289
  64. data/lib/cloudmersive-ocr-api-client/models/pdf_to_lines_with_location_result.rb +0 -201
  65. data/lib/cloudmersive-ocr-api-client/models/pdf_to_text_response.rb +0 -201
  66. data/lib/cloudmersive-ocr-api-client/models/pdf_to_words_with_location_result.rb +0 -201
  67. data/lib/cloudmersive-ocr-api-client/models/photo_to_words_with_location_result.rb +0 -227
  68. data/lib/cloudmersive-ocr-api-client/models/point.rb +0 -199
  69. data/lib/cloudmersive-ocr-api-client/models/receipt_line_item.rb +0 -199
  70. data/lib/cloudmersive-ocr-api-client/models/receipt_recognition_result.rb +0 -271
  71. data/lib/cloudmersive-ocr-api-client/models/table_cell_result.rb +0 -201
  72. data/lib/cloudmersive-ocr-api-client/models/table_result.rb +0 -201
  73. data/lib/cloudmersive-ocr-api-client/models/table_row_result.rb +0 -191
  74. data/lib/cloudmersive-ocr-api-client/version.rb +0 -15
  75. data/spec/api/image_ocr_api_spec.rb +0 -169
  76. data/spec/api/pdf_ocr_api_spec.rb +0 -78
  77. data/spec/api/preprocessing_api_spec.rb +0 -107
  78. data/spec/api/receipts_api_spec.rb +0 -47
  79. data/spec/api_client_spec.rb +0 -226
  80. data/spec/configuration_spec.rb +0 -42
  81. data/spec/models/business_card_recognition_result_spec.rb +0 -84
  82. data/spec/models/field_result_spec.rb +0 -48
  83. data/spec/models/form_definition_template_spec.rb +0 -48
  84. data/spec/models/form_field_definition_spec.rb +0 -144
  85. data/spec/models/form_recognition_result_spec.rb +0 -66
  86. data/spec/models/form_table_column_definition_spec.rb +0 -72
  87. data/spec/models/form_table_definition_spec.rb +0 -60
  88. data/spec/models/get_page_angle_result_spec.rb +0 -48
  89. data/spec/models/image_to_lines_with_location_result_spec.rb +0 -48
  90. data/spec/models/image_to_text_response_spec.rb +0 -48
  91. data/spec/models/image_to_words_with_location_result_spec.rb +0 -48
  92. data/spec/models/ocr_line_element_spec.rb +0 -48
  93. data/spec/models/ocr_page_result_spec.rb +0 -54
  94. data/spec/models/ocr_page_result_with_lines_with_location_spec.rb +0 -54
  95. data/spec/models/ocr_page_result_with_words_with_location_spec.rb +0 -54
  96. data/spec/models/ocr_photo_text_element_spec.rb +0 -78
  97. data/spec/models/ocr_word_element_spec.rb +0 -102
  98. data/spec/models/pdf_to_lines_with_location_result_spec.rb +0 -48
  99. data/spec/models/pdf_to_text_response_spec.rb +0 -48
  100. data/spec/models/pdf_to_words_with_location_result_spec.rb +0 -48
  101. data/spec/models/photo_to_words_with_location_result_spec.rb +0 -54
  102. data/spec/models/point_spec.rb +0 -48
  103. data/spec/models/receipt_line_item_spec.rb +0 -48
  104. data/spec/models/receipt_recognition_result_spec.rb +0 -90
  105. data/spec/models/table_cell_result_spec.rb +0 -48
  106. data/spec/models/table_result_spec.rb +0 -48
  107. data/spec/models/table_row_result_spec.rb +0 -42
  108. data/spec/spec_helper.rb +0 -111
@@ -1,271 +0,0 @@
1
- =begin
2
- #ocrapi
3
-
4
- #The powerful Optical Character Recognition (OCR) APIs let you convert scanned images of pages into recognized text.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CloudmersiveOcrApiClient
16
- # Result of recognizing a receipt, to extract the key information from the receipt
17
- class ReceiptRecognitionResult
18
- # True if the operation was successful, false otherwise
19
- attr_accessor :successful
20
-
21
- # The date and time printed on the receipt (if included on the receipt)
22
- attr_accessor :timestamp
23
-
24
- # The name of the business printed on the receipt (if included on the receipt)
25
- attr_accessor :business_name
26
-
27
- # The website URL of the business printed on the receipt (if included on the receipt)
28
- attr_accessor :business_website
29
-
30
- # The address of the business printed on the receipt (if included on the receipt)
31
- attr_accessor :address_string
32
-
33
- # The phone number printed on the receipt (if included on the receipt)
34
- attr_accessor :phone_number
35
-
36
- # The individual line items comprising the order; does not include total (see ReceiptTotal)
37
- attr_accessor :receipt_items
38
-
39
- # Optional; if available, the monetary value of the receipt subtotal - typically not including specialized line items such as Tax. If this value is not available, it will be 0.
40
- attr_accessor :receipt_sub_total
41
-
42
- # The total monetary value of the receipt (if included on the receipt)
43
- attr_accessor :receipt_total
44
-
45
-
46
- # Attribute mapping from ruby-style variable name to JSON key.
47
- def self.attribute_map
48
- {
49
- :'successful' => :'Successful',
50
- :'timestamp' => :'Timestamp',
51
- :'business_name' => :'BusinessName',
52
- :'business_website' => :'BusinessWebsite',
53
- :'address_string' => :'AddressString',
54
- :'phone_number' => :'PhoneNumber',
55
- :'receipt_items' => :'ReceiptItems',
56
- :'receipt_sub_total' => :'ReceiptSubTotal',
57
- :'receipt_total' => :'ReceiptTotal'
58
- }
59
- end
60
-
61
- # Attribute type mapping.
62
- def self.swagger_types
63
- {
64
- :'successful' => :'BOOLEAN',
65
- :'timestamp' => :'DateTime',
66
- :'business_name' => :'String',
67
- :'business_website' => :'String',
68
- :'address_string' => :'String',
69
- :'phone_number' => :'String',
70
- :'receipt_items' => :'Array<ReceiptLineItem>',
71
- :'receipt_sub_total' => :'Float',
72
- :'receipt_total' => :'Float'
73
- }
74
- end
75
-
76
- # Initializes the object
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- def initialize(attributes = {})
79
- return unless attributes.is_a?(Hash)
80
-
81
- # convert string to symbol for hash key
82
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
83
-
84
- if attributes.has_key?(:'Successful')
85
- self.successful = attributes[:'Successful']
86
- end
87
-
88
- if attributes.has_key?(:'Timestamp')
89
- self.timestamp = attributes[:'Timestamp']
90
- end
91
-
92
- if attributes.has_key?(:'BusinessName')
93
- self.business_name = attributes[:'BusinessName']
94
- end
95
-
96
- if attributes.has_key?(:'BusinessWebsite')
97
- self.business_website = attributes[:'BusinessWebsite']
98
- end
99
-
100
- if attributes.has_key?(:'AddressString')
101
- self.address_string = attributes[:'AddressString']
102
- end
103
-
104
- if attributes.has_key?(:'PhoneNumber')
105
- self.phone_number = attributes[:'PhoneNumber']
106
- end
107
-
108
- if attributes.has_key?(:'ReceiptItems')
109
- if (value = attributes[:'ReceiptItems']).is_a?(Array)
110
- self.receipt_items = value
111
- end
112
- end
113
-
114
- if attributes.has_key?(:'ReceiptSubTotal')
115
- self.receipt_sub_total = attributes[:'ReceiptSubTotal']
116
- end
117
-
118
- if attributes.has_key?(:'ReceiptTotal')
119
- self.receipt_total = attributes[:'ReceiptTotal']
120
- end
121
-
122
- end
123
-
124
- # Show invalid properties with the reasons. Usually used together with valid?
125
- # @return Array for valid properties with the reasons
126
- def list_invalid_properties
127
- invalid_properties = Array.new
128
- return invalid_properties
129
- end
130
-
131
- # Check to see if the all the properties in the model are valid
132
- # @return true if the model is valid
133
- def valid?
134
- return true
135
- end
136
-
137
- # Checks equality by comparing each attribute.
138
- # @param [Object] Object to be compared
139
- def ==(o)
140
- return true if self.equal?(o)
141
- self.class == o.class &&
142
- successful == o.successful &&
143
- timestamp == o.timestamp &&
144
- business_name == o.business_name &&
145
- business_website == o.business_website &&
146
- address_string == o.address_string &&
147
- phone_number == o.phone_number &&
148
- receipt_items == o.receipt_items &&
149
- receipt_sub_total == o.receipt_sub_total &&
150
- receipt_total == o.receipt_total
151
- end
152
-
153
- # @see the `==` method
154
- # @param [Object] Object to be compared
155
- def eql?(o)
156
- self == o
157
- end
158
-
159
- # Calculates hash code according to all attributes.
160
- # @return [Fixnum] Hash code
161
- def hash
162
- [successful, timestamp, business_name, business_website, address_string, phone_number, receipt_items, receipt_sub_total, receipt_total].hash
163
- end
164
-
165
- # Builds the object from hash
166
- # @param [Hash] attributes Model attributes in the form of hash
167
- # @return [Object] Returns the model itself
168
- def build_from_hash(attributes)
169
- return nil unless attributes.is_a?(Hash)
170
- self.class.swagger_types.each_pair do |key, type|
171
- if type =~ /\AArray<(.*)>/i
172
- # check to ensure the input is an array given that the the attribute
173
- # is documented as an array but the input is not
174
- if attributes[self.class.attribute_map[key]].is_a?(Array)
175
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
176
- end
177
- elsif !attributes[self.class.attribute_map[key]].nil?
178
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
179
- end # or else data not found in attributes(hash), not an issue as the data can be optional
180
- end
181
-
182
- self
183
- end
184
-
185
- # Deserializes the data based on type
186
- # @param string type Data type
187
- # @param string value Value to be deserialized
188
- # @return [Object] Deserialized data
189
- def _deserialize(type, value)
190
- case type.to_sym
191
- when :DateTime
192
- DateTime.parse(value)
193
- when :Date
194
- Date.parse(value)
195
- when :String
196
- value.to_s
197
- when :Integer
198
- value.to_i
199
- when :Float
200
- value.to_f
201
- when :BOOLEAN
202
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
- true
204
- else
205
- false
206
- end
207
- when :Object
208
- # generic object (usually a Hash), return directly
209
- value
210
- when /\AArray<(?<inner_type>.+)>\z/
211
- inner_type = Regexp.last_match[:inner_type]
212
- value.map { |v| _deserialize(inner_type, v) }
213
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
- k_type = Regexp.last_match[:k_type]
215
- v_type = Regexp.last_match[:v_type]
216
- {}.tap do |hash|
217
- value.each do |k, v|
218
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
- end
220
- end
221
- else # model
222
- temp_model = CloudmersiveOcrApiClient.const_get(type).new
223
- temp_model.build_from_hash(value)
224
- end
225
- end
226
-
227
- # Returns the string representation of the object
228
- # @return [String] String presentation of the object
229
- def to_s
230
- to_hash.to_s
231
- end
232
-
233
- # to_body is an alias to to_hash (backward compatibility)
234
- # @return [Hash] Returns the object in the form of hash
235
- def to_body
236
- to_hash
237
- end
238
-
239
- # Returns the object in the form of hash
240
- # @return [Hash] Returns the object in the form of hash
241
- def to_hash
242
- hash = {}
243
- self.class.attribute_map.each_pair do |attr, param|
244
- value = self.send(attr)
245
- next if value.nil?
246
- hash[param] = _to_hash(value)
247
- end
248
- hash
249
- end
250
-
251
- # Outputs non-array value in the form of hash
252
- # For object, use to_hash. Otherwise, just return the value
253
- # @param [Object] value Any valid value
254
- # @return [Hash] Returns the value in the form of hash
255
- def _to_hash(value)
256
- if value.is_a?(Array)
257
- value.compact.map{ |v| _to_hash(v) }
258
- elsif value.is_a?(Hash)
259
- {}.tap do |hash|
260
- value.each { |k, v| hash[k] = _to_hash(v) }
261
- end
262
- elsif value.respond_to? :to_hash
263
- value.to_hash
264
- else
265
- value
266
- end
267
- end
268
-
269
- end
270
-
271
- end
@@ -1,201 +0,0 @@
1
- =begin
2
- #ocrapi
3
-
4
- #The powerful Optical Character Recognition (OCR) APIs let you convert scanned images of pages into recognized text.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CloudmersiveOcrApiClient
16
- # The recognition result of one cell in one row in a table of a form
17
- class TableCellResult
18
- # The ID of the column
19
- attr_accessor :column_id
20
-
21
- # Result cell value(s) extracted
22
- attr_accessor :cell_values
23
-
24
-
25
- # Attribute mapping from ruby-style variable name to JSON key.
26
- def self.attribute_map
27
- {
28
- :'column_id' => :'ColumnID',
29
- :'cell_values' => :'CellValues'
30
- }
31
- end
32
-
33
- # Attribute type mapping.
34
- def self.swagger_types
35
- {
36
- :'column_id' => :'String',
37
- :'cell_values' => :'Array<OcrPhotoTextElement>'
38
- }
39
- end
40
-
41
- # Initializes the object
42
- # @param [Hash] attributes Model attributes in the form of hash
43
- def initialize(attributes = {})
44
- return unless attributes.is_a?(Hash)
45
-
46
- # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
-
49
- if attributes.has_key?(:'ColumnID')
50
- self.column_id = attributes[:'ColumnID']
51
- end
52
-
53
- if attributes.has_key?(:'CellValues')
54
- if (value = attributes[:'CellValues']).is_a?(Array)
55
- self.cell_values = value
56
- end
57
- end
58
-
59
- end
60
-
61
- # Show invalid properties with the reasons. Usually used together with valid?
62
- # @return Array for valid properties with the reasons
63
- def list_invalid_properties
64
- invalid_properties = Array.new
65
- return invalid_properties
66
- end
67
-
68
- # Check to see if the all the properties in the model are valid
69
- # @return true if the model is valid
70
- def valid?
71
- return true
72
- end
73
-
74
- # Checks equality by comparing each attribute.
75
- # @param [Object] Object to be compared
76
- def ==(o)
77
- return true if self.equal?(o)
78
- self.class == o.class &&
79
- column_id == o.column_id &&
80
- cell_values == o.cell_values
81
- end
82
-
83
- # @see the `==` method
84
- # @param [Object] Object to be compared
85
- def eql?(o)
86
- self == o
87
- end
88
-
89
- # Calculates hash code according to all attributes.
90
- # @return [Fixnum] Hash code
91
- def hash
92
- [column_id, cell_values].hash
93
- end
94
-
95
- # Builds the object from hash
96
- # @param [Hash] attributes Model attributes in the form of hash
97
- # @return [Object] Returns the model itself
98
- def build_from_hash(attributes)
99
- return nil unless attributes.is_a?(Hash)
100
- self.class.swagger_types.each_pair do |key, type|
101
- if type =~ /\AArray<(.*)>/i
102
- # check to ensure the input is an array given that the the attribute
103
- # is documented as an array but the input is not
104
- if attributes[self.class.attribute_map[key]].is_a?(Array)
105
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
106
- end
107
- elsif !attributes[self.class.attribute_map[key]].nil?
108
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
109
- end # or else data not found in attributes(hash), not an issue as the data can be optional
110
- end
111
-
112
- self
113
- end
114
-
115
- # Deserializes the data based on type
116
- # @param string type Data type
117
- # @param string value Value to be deserialized
118
- # @return [Object] Deserialized data
119
- def _deserialize(type, value)
120
- case type.to_sym
121
- when :DateTime
122
- DateTime.parse(value)
123
- when :Date
124
- Date.parse(value)
125
- when :String
126
- value.to_s
127
- when :Integer
128
- value.to_i
129
- when :Float
130
- value.to_f
131
- when :BOOLEAN
132
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
- true
134
- else
135
- false
136
- end
137
- when :Object
138
- # generic object (usually a Hash), return directly
139
- value
140
- when /\AArray<(?<inner_type>.+)>\z/
141
- inner_type = Regexp.last_match[:inner_type]
142
- value.map { |v| _deserialize(inner_type, v) }
143
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
- k_type = Regexp.last_match[:k_type]
145
- v_type = Regexp.last_match[:v_type]
146
- {}.tap do |hash|
147
- value.each do |k, v|
148
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
149
- end
150
- end
151
- else # model
152
- temp_model = CloudmersiveOcrApiClient.const_get(type).new
153
- temp_model.build_from_hash(value)
154
- end
155
- end
156
-
157
- # Returns the string representation of the object
158
- # @return [String] String presentation of the object
159
- def to_s
160
- to_hash.to_s
161
- end
162
-
163
- # to_body is an alias to to_hash (backward compatibility)
164
- # @return [Hash] Returns the object in the form of hash
165
- def to_body
166
- to_hash
167
- end
168
-
169
- # Returns the object in the form of hash
170
- # @return [Hash] Returns the object in the form of hash
171
- def to_hash
172
- hash = {}
173
- self.class.attribute_map.each_pair do |attr, param|
174
- value = self.send(attr)
175
- next if value.nil?
176
- hash[param] = _to_hash(value)
177
- end
178
- hash
179
- end
180
-
181
- # Outputs non-array value in the form of hash
182
- # For object, use to_hash. Otherwise, just return the value
183
- # @param [Object] value Any valid value
184
- # @return [Hash] Returns the value in the form of hash
185
- def _to_hash(value)
186
- if value.is_a?(Array)
187
- value.compact.map{ |v| _to_hash(v) }
188
- elsif value.is_a?(Hash)
189
- {}.tap do |hash|
190
- value.each { |k, v| hash[k] = _to_hash(v) }
191
- end
192
- elsif value.respond_to? :to_hash
193
- value.to_hash
194
- else
195
- value
196
- end
197
- end
198
-
199
- end
200
-
201
- end