cloudmersive-ocr-api-client 1.3.5 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37f50fd7764a8a7bc526bea186b74a8d29209bae63a30061a695946775570ee0
4
- data.tar.gz: 5056bd844cfa0b6041a81a20577780e605a93fad757c92f3c923f231da535023
3
+ metadata.gz: f1b5a3699492d2fa535b5173b9607a76c1a754a9d59f0049baadc3f563514dce
4
+ data.tar.gz: 5e7e7a8ea78364e15871ceb77e70dc93deeeb9acf59dbfc6c17a87fd872bd713
5
5
  SHA512:
6
- metadata.gz: 1bba5aec42d5498ec2397f9e385749093683c0b96951b3cec3bbd7af8d571f682c880b277e499101b4ed151b60cb34a4c3ec7fe1538d1c2b923f9451a8616283
7
- data.tar.gz: b11a833bee4add22b521fbab250822a801fdcef0737dafcb7fb0e7dea8ceea7ebb4f9db44ccd0c1adb7c251a93f058db7e43cdca998661e499523fa993328497
6
+ metadata.gz: 53f1cad544f7617a7fcd659485d90f0a52fedf533f1acc0d8af3597fa1a8453f79d791fe8f9e42304a87716ba82fc0999aebc30d45836cf2d695c59848e6b1e4
7
+ data.tar.gz: 79db60a648f53388aa622270ad581df86702759830fd9f5660f1df2b537b45a2f315054cad95f98b8ee9c7ede349b3dfe8327bca827f1d9b7505c1848b4861dc
data/README.md CHANGED
@@ -7,7 +7,7 @@ The powerful Optical Character Recognition (OCR) APIs let you convert scanned im
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 1.3.5
10
+ - Package version: 1.3.7
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-ocr-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-ocr-api-client-1.3.5.gem
26
+ gem install ./cloudmersive-ocr-api-client-1.3.7.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-ocr-api-client-1.3.5.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-ocr-api-client-1.3.7.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'cloudmersive-ocr-api-client', '~> 1.3.5'
34
+ gem 'cloudmersive-ocr-api-client', '~> 1.3.7'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -214,7 +214,8 @@ image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on
214
214
 
215
215
  opts = {
216
216
  language: "language_example", # String | Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
217
- preprocessing: "preprocessing_example" # String | Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
217
+ preprocessing: "preprocessing_example", # String | Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
218
+ diagnostics: "diagnostics_example" # String | Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance).
218
219
  }
219
220
 
220
221
  begin
@@ -233,6 +234,7 @@ Name | Type | Description | Notes
233
234
  **image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
234
235
  **language** | **String**| Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish) | [optional]
235
236
  **preprocessing** | **String**| Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended). | [optional]
237
+ **diagnostics** | **String**| Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance). | [optional]
236
238
 
237
239
  ### Return type
238
240
 
@@ -5,5 +5,6 @@ Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **successful** | **BOOLEAN** | | [optional]
7
7
  **text_elements** | [**Array<OcrPhotoTextElement>**](OcrPhotoTextElement.md) | Word elements in the image | [optional]
8
+ **diagnostic_image** | **String** | Typically null. To analyze OCR performance, enable diagnostic mode by adding the HTTP header \"DiagnosticMode\" with the value \"true\". When this is true, a diagnostic image showing the details of the OCR result will be set in PNG format into DiagnosticImage. | [optional]
8
9
 
9
10
 
@@ -12,7 +12,7 @@ Method | HTTP request | Description
12
12
 
13
13
 
14
14
  # **preprocessing_binarize**
15
- > Object preprocessing_binarize(image_file)
15
+ > String preprocessing_binarize(image_file)
16
16
 
17
17
  Convert an image of text into a binarized (light and dark) view
18
18
 
@@ -52,7 +52,7 @@ Name | Type | Description | Notes
52
52
 
53
53
  ### Return type
54
54
 
55
- **Object**
55
+ **String**
56
56
 
57
57
  ### Authorization
58
58
 
@@ -66,7 +66,7 @@ Name | Type | Description | Notes
66
66
 
67
67
 
68
68
  # **preprocessing_binarize_advanced**
69
- > Object preprocessing_binarize_advanced(image_file)
69
+ > String preprocessing_binarize_advanced(image_file)
70
70
 
71
71
  Convert an image of text into a binary (light and dark) view with ML
72
72
 
@@ -106,7 +106,7 @@ Name | Type | Description | Notes
106
106
 
107
107
  ### Return type
108
108
 
109
- **Object**
109
+ **String**
110
110
 
111
111
  ### Authorization
112
112
 
@@ -174,7 +174,7 @@ Name | Type | Description | Notes
174
174
 
175
175
 
176
176
  # **preprocessing_unrotate**
177
- > Object preprocessing_unrotate(image_file)
177
+ > String preprocessing_unrotate(image_file)
178
178
 
179
179
  Detect and unrotate a document image
180
180
 
@@ -214,7 +214,7 @@ Name | Type | Description | Notes
214
214
 
215
215
  ### Return type
216
216
 
217
- **Object**
217
+ **String**
218
218
 
219
219
  ### Authorization
220
220
 
@@ -228,7 +228,7 @@ Name | Type | Description | Notes
228
228
 
229
229
 
230
230
  # **preprocessing_unskew**
231
- > Object preprocessing_unskew(image_file)
231
+ > String preprocessing_unskew(image_file)
232
232
 
233
233
  Detect and unskew a photo of a document
234
234
 
@@ -268,7 +268,7 @@ Name | Type | Description | Notes
268
268
 
269
269
  ### Return type
270
270
 
271
- **Object**
271
+ **String**
272
272
 
273
273
  ### Authorization
274
274
 
@@ -209,6 +209,7 @@ module CloudmersiveOcrApiClient
209
209
  # @param [Hash] opts the optional parameters
210
210
  # @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
211
211
  # @option opts [String] :preprocessing Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
212
+ # @option opts [String] :diagnostics Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance).
212
213
  # @return [PhotoToWordsWithLocationResult]
213
214
  def image_ocr_photo_words_with_location(image_file, opts = {})
214
215
  data, _status_code, _headers = image_ocr_photo_words_with_location_with_http_info(image_file, opts)
@@ -221,6 +222,7 @@ module CloudmersiveOcrApiClient
221
222
  # @param [Hash] opts the optional parameters
222
223
  # @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
223
224
  # @option opts [String] :preprocessing Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
225
+ # @option opts [String] :diagnostics Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance).
224
226
  # @return [Array<(PhotoToWordsWithLocationResult, Fixnum, Hash)>] PhotoToWordsWithLocationResult data, response status code and response headers
225
227
  def image_ocr_photo_words_with_location_with_http_info(image_file, opts = {})
226
228
  if @api_client.config.debugging
@@ -244,6 +246,7 @@ module CloudmersiveOcrApiClient
244
246
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
245
247
  header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
246
248
  header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
249
+ header_params[:'diagnostics'] = opts[:'diagnostics'] if !opts[:'diagnostics'].nil?
247
250
 
248
251
  # form parameters
249
252
  form_params = {}
@@ -24,7 +24,7 @@ module CloudmersiveOcrApiClient
24
24
  # Perform an adaptive binarization algorithm on the input image to prepare it for further OCR operations.
25
25
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
26
26
  # @param [Hash] opts the optional parameters
27
- # @return [Object]
27
+ # @return [String]
28
28
  def preprocessing_binarize(image_file, opts = {})
29
29
  data, _status_code, _headers = preprocessing_binarize_with_http_info(image_file, opts)
30
30
  return data
@@ -34,7 +34,7 @@ module CloudmersiveOcrApiClient
34
34
  # Perform an adaptive binarization algorithm on the input image to prepare it for further OCR operations.
35
35
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
36
36
  # @param [Hash] opts the optional parameters
37
- # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
37
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
38
38
  def preprocessing_binarize_with_http_info(image_file, opts = {})
39
39
  if @api_client.config.debugging
40
40
  @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_binarize ..."
@@ -69,7 +69,7 @@ module CloudmersiveOcrApiClient
69
69
  :form_params => form_params,
70
70
  :body => post_body,
71
71
  :auth_names => auth_names,
72
- :return_type => 'Object')
72
+ :return_type => 'String')
73
73
  if @api_client.config.debugging
74
74
  @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_binarize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
75
  end
@@ -80,7 +80,7 @@ module CloudmersiveOcrApiClient
80
80
  # Perform an advanced adaptive, Deep Learning-based binarization algorithm on the input image to prepare it for further OCR operations. Provides enhanced accuracy than adaptive binarization. Image will be upsampled to 300 DPI if it has a DPI below 300.
81
81
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
82
82
  # @param [Hash] opts the optional parameters
83
- # @return [Object]
83
+ # @return [String]
84
84
  def preprocessing_binarize_advanced(image_file, opts = {})
85
85
  data, _status_code, _headers = preprocessing_binarize_advanced_with_http_info(image_file, opts)
86
86
  return data
@@ -90,7 +90,7 @@ module CloudmersiveOcrApiClient
90
90
  # Perform an advanced adaptive, Deep Learning-based binarization algorithm on the input image to prepare it for further OCR operations. Provides enhanced accuracy than adaptive binarization. Image will be upsampled to 300 DPI if it has a DPI below 300.
91
91
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
92
92
  # @param [Hash] opts the optional parameters
93
- # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
93
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
94
94
  def preprocessing_binarize_advanced_with_http_info(image_file, opts = {})
95
95
  if @api_client.config.debugging
96
96
  @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_binarize_advanced ..."
@@ -125,7 +125,7 @@ module CloudmersiveOcrApiClient
125
125
  :form_params => form_params,
126
126
  :body => post_body,
127
127
  :auth_names => auth_names,
128
- :return_type => 'Object')
128
+ :return_type => 'String')
129
129
  if @api_client.config.debugging
130
130
  @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_binarize_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
131
131
  end
@@ -192,7 +192,7 @@ module CloudmersiveOcrApiClient
192
192
  # Detect and unrotate an image of a document (e.g. that was scanned at an angle). Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
193
193
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
194
194
  # @param [Hash] opts the optional parameters
195
- # @return [Object]
195
+ # @return [String]
196
196
  def preprocessing_unrotate(image_file, opts = {})
197
197
  data, _status_code, _headers = preprocessing_unrotate_with_http_info(image_file, opts)
198
198
  return data
@@ -202,7 +202,7 @@ module CloudmersiveOcrApiClient
202
202
  # Detect and unrotate an image of a document (e.g. that was scanned at an angle). Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
203
203
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
204
204
  # @param [Hash] opts the optional parameters
205
- # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
205
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
206
206
  def preprocessing_unrotate_with_http_info(image_file, opts = {})
207
207
  if @api_client.config.debugging
208
208
  @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_unrotate ..."
@@ -237,7 +237,7 @@ module CloudmersiveOcrApiClient
237
237
  :form_params => form_params,
238
238
  :body => post_body,
239
239
  :auth_names => auth_names,
240
- :return_type => 'Object')
240
+ :return_type => 'String')
241
241
  if @api_client.config.debugging
242
242
  @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_unrotate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
243
243
  end
@@ -248,7 +248,7 @@ module CloudmersiveOcrApiClient
248
248
  # Detect and unskew a photo of a document (e.g. taken on a cell phone) into a perfectly square image. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
249
249
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
250
250
  # @param [Hash] opts the optional parameters
251
- # @return [Object]
251
+ # @return [String]
252
252
  def preprocessing_unskew(image_file, opts = {})
253
253
  data, _status_code, _headers = preprocessing_unskew_with_http_info(image_file, opts)
254
254
  return data
@@ -258,7 +258,7 @@ module CloudmersiveOcrApiClient
258
258
  # Detect and unskew a photo of a document (e.g. taken on a cell phone) into a perfectly square image. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
259
259
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
260
260
  # @param [Hash] opts the optional parameters
261
- # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
261
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
262
262
  def preprocessing_unskew_with_http_info(image_file, opts = {})
263
263
  if @api_client.config.debugging
264
264
  @api_client.config.logger.debug "Calling API: PreprocessingApi.preprocessing_unskew ..."
@@ -293,7 +293,7 @@ module CloudmersiveOcrApiClient
293
293
  :form_params => form_params,
294
294
  :body => post_body,
295
295
  :auth_names => auth_names,
296
- :return_type => 'Object')
296
+ :return_type => 'String')
297
297
  if @api_client.config.debugging
298
298
  @api_client.config.logger.debug "API called: PreprocessingApi#preprocessing_unskew\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
299
299
  end
@@ -20,12 +20,16 @@ module CloudmersiveOcrApiClient
20
20
  # Word elements in the image
21
21
  attr_accessor :text_elements
22
22
 
23
+ # Typically null. To analyze OCR performance, enable diagnostic mode by adding the HTTP header \"DiagnosticMode\" with the value \"true\". When this is true, a diagnostic image showing the details of the OCR result will be set in PNG format into DiagnosticImage.
24
+ attr_accessor :diagnostic_image
25
+
23
26
 
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
25
28
  def self.attribute_map
26
29
  {
27
30
  :'successful' => :'Successful',
28
- :'text_elements' => :'TextElements'
31
+ :'text_elements' => :'TextElements',
32
+ :'diagnostic_image' => :'DiagnosticImage'
29
33
  }
30
34
  end
31
35
 
@@ -33,7 +37,8 @@ module CloudmersiveOcrApiClient
33
37
  def self.swagger_types
34
38
  {
35
39
  :'successful' => :'BOOLEAN',
36
- :'text_elements' => :'Array<OcrPhotoTextElement>'
40
+ :'text_elements' => :'Array<OcrPhotoTextElement>',
41
+ :'diagnostic_image' => :'String'
37
42
  }
38
43
  end
39
44
 
@@ -55,28 +60,49 @@ module CloudmersiveOcrApiClient
55
60
  end
56
61
  end
57
62
 
63
+ if attributes.has_key?(:'DiagnosticImage')
64
+ self.diagnostic_image = attributes[:'DiagnosticImage']
65
+ end
66
+
58
67
  end
59
68
 
60
69
  # Show invalid properties with the reasons. Usually used together with valid?
61
70
  # @return Array for valid properties with the reasons
62
71
  def list_invalid_properties
63
72
  invalid_properties = Array.new
73
+ if !@diagnostic_image.nil? && @diagnostic_image !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
74
+ invalid_properties.push("invalid value for 'diagnostic_image', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.")
75
+ end
76
+
64
77
  return invalid_properties
65
78
  end
66
79
 
67
80
  # Check to see if the all the properties in the model are valid
68
81
  # @return true if the model is valid
69
82
  def valid?
83
+ return false if !@diagnostic_image.nil? && @diagnostic_image !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
70
84
  return true
71
85
  end
72
86
 
87
+ # Custom attribute writer method with validation
88
+ # @param [Object] diagnostic_image Value to be assigned
89
+ def diagnostic_image=(diagnostic_image)
90
+
91
+ if !diagnostic_image.nil? && diagnostic_image !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
92
+ fail ArgumentError, "invalid value for 'diagnostic_image', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."
93
+ end
94
+
95
+ @diagnostic_image = diagnostic_image
96
+ end
97
+
73
98
  # Checks equality by comparing each attribute.
74
99
  # @param [Object] Object to be compared
75
100
  def ==(o)
76
101
  return true if self.equal?(o)
77
102
  self.class == o.class &&
78
103
  successful == o.successful &&
79
- text_elements == o.text_elements
104
+ text_elements == o.text_elements &&
105
+ diagnostic_image == o.diagnostic_image
80
106
  end
81
107
 
82
108
  # @see the `==` method
@@ -88,7 +114,7 @@ module CloudmersiveOcrApiClient
88
114
  # Calculates hash code according to all attributes.
89
115
  # @return [Fixnum] Hash code
90
116
  def hash
91
- [successful, text_elements].hash
117
+ [successful, text_elements, diagnostic_image].hash
92
118
  end
93
119
 
94
120
  # Builds the object from hash
@@ -11,5 +11,5 @@ Swagger Codegen version: unset
11
11
  =end
12
12
 
13
13
  module CloudmersiveOcrApiClient
14
- VERSION = "1.3.5"
14
+ VERSION = "1.3.7"
15
15
  end
@@ -80,6 +80,7 @@ describe 'ImageOcrApi' do
80
80
  # @param [Hash] opts the optional parameters
81
81
  # @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
82
82
  # @option opts [String] :preprocessing Optional, preprocessing mode, default is &#39;Auto&#39;. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
83
+ # @option opts [String] :diagnostics Optional, diagnostics mode, default is &#39;false&#39;. Possible values are &#39;true&#39; (will set DiagnosticImage to a diagnostic PNG image in the result), and &#39;false&#39; (no diagnostics are enabled; this is recommended for best performance).
83
84
  # @return [PhotoToWordsWithLocationResult]
84
85
  describe 'image_ocr_photo_words_with_location test' do
85
86
  it "should work" do
@@ -37,7 +37,7 @@ describe 'PreprocessingApi' do
37
37
  # Perform an adaptive binarization algorithm on the input image to prepare it for further OCR operations.
38
38
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
39
39
  # @param [Hash] opts the optional parameters
40
- # @return [Object]
40
+ # @return [String]
41
41
  describe 'preprocessing_binarize test' do
42
42
  it "should work" do
43
43
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -49,7 +49,7 @@ describe 'PreprocessingApi' do
49
49
  # Perform an advanced adaptive, Deep Learning-based binarization algorithm on the input image to prepare it for further OCR operations. Provides enhanced accuracy than adaptive binarization. Image will be upsampled to 300 DPI if it has a DPI below 300.
50
50
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
51
51
  # @param [Hash] opts the optional parameters
52
- # @return [Object]
52
+ # @return [String]
53
53
  describe 'preprocessing_binarize_advanced test' do
54
54
  it "should work" do
55
55
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -73,7 +73,7 @@ describe 'PreprocessingApi' do
73
73
  # Detect and unrotate an image of a document (e.g. that was scanned at an angle). Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
74
74
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
75
75
  # @param [Hash] opts the optional parameters
76
- # @return [Object]
76
+ # @return [String]
77
77
  describe 'preprocessing_unrotate test' do
78
78
  it "should work" do
79
79
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -85,7 +85,7 @@ describe 'PreprocessingApi' do
85
85
  # Detect and unskew a photo of a document (e.g. taken on a cell phone) into a perfectly square image. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
86
86
  # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
87
87
  # @param [Hash] opts the optional parameters
88
- # @return [Object]
88
+ # @return [String]
89
89
  describe 'preprocessing_unskew test' do
90
90
  it "should work" do
91
91
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -44,5 +44,11 @@ describe 'PhotoToWordsWithLocationResult' do
44
44
  end
45
45
  end
46
46
 
47
+ describe 'test attribute "diagnostic_image"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
47
53
  end
48
54
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-ocr-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-06 00:00:00.000000000 Z
11
+ date: 2019-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus