cloudmersive-ocr-api-client 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/docs/FormFieldDefinition.md +3 -1
- data/docs/FormRecognitionResult.md +1 -0
- data/docs/ImageOcrApi.md +5 -1
- data/lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb +6 -0
- data/lib/cloudmersive-ocr-api-client/models/form_field_definition.rb +22 -2
- data/lib/cloudmersive-ocr-api-client/models/form_recognition_result.rb +16 -4
- data/lib/cloudmersive-ocr-api-client/version.rb +1 -1
- data/spec/api/image_ocr_api_spec.rb +2 -0
- data/spec/models/form_field_definition_spec.rb +12 -0
- data/spec/models/form_recognition_result_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a44f5408d13ce0be8ef9ebc327d40844fc90ded46a1dc85afc2963fea9b7ab55
|
4
|
+
data.tar.gz: e09bdb94194b2c4ad7bdb6ba26f9ffd027a2bfbf34431d5cf4c3b65b57a45a8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 254cc404a1713f8944536aa27c3392ba053723b2156df7149d7eda0b884eba0dc2662ce5638973fbcf8e79d034f0f6d21617578aafd44b77bf1a18c429bd5e43
|
7
|
+
data.tar.gz: 5fd11be943b8b0401f1b864e7dc5f06e0f75eb977ec0b7c068e426c38211e085dfb40875e924454c4c34f24bdfc1571b5c37a37cd123e0fc1294c2d047aef7cb
|
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.4.
|
10
|
+
- Package version: 1.4.5
|
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.4.
|
26
|
+
gem install ./cloudmersive-ocr-api-client-1.4.5.gem
|
27
27
|
```
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-ocr-api-client-1.4.
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-ocr-api-client-1.4.5.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.4.
|
34
|
+
gem 'cloudmersive-ocr-api-client', '~> 1.4.5'
|
35
35
|
|
36
36
|
### Install from Git
|
37
37
|
|
data/docs/FormFieldDefinition.md
CHANGED
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
|
|
6
6
|
**field_id** | **String** | The identifier of the field; use this to identify which field is being referenced | [optional]
|
7
7
|
**left_anchor** | **String** | Optional - the left-hand anchor of the field | [optional]
|
8
8
|
**top_anchor** | **String** | Optional - the top anchor of the field | [optional]
|
9
|
-
**anchor_mode** | **String** | Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match). Default is Partial. | [optional]
|
9
|
+
**anchor_mode** | **String** | Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match) and Horizontal (anchor must be laid out horizontally). Default is Partial. | [optional]
|
10
10
|
**data_type** | **String** | The data type of the field; possible values are INTEGER (Integer value), STRING (Arbitrary string value, spaces are permitted), DATE (Date in a structured format), DECIMAL (Decimal number), ALPHANUMERIC (Continuous alphanumeric string with no spaces), STRINGNOWHITESPACE (A string that contains no whitespace characters), SERIALNUMBER (A serial-number style string that contains letters and numbers, and certain symbols; must contain at least one number), ALPHAONLY (Alphabet characters only, no numbers or symbols or whitespace) | [optional]
|
11
11
|
**target_digit_count** | **Integer** | Optional - the target number of digits in the field; useful for fixed-length fields | [optional]
|
12
12
|
**minimum_character_count** | **Integer** | Optional - the target number of digits in the field; useful for fixed-length fields | [optional]
|
@@ -15,6 +15,8 @@ Name | Type | Description | Notes
|
|
15
15
|
**horizontal_alignment_type** | **String** | Horizontal alignment of target value area relative to the field anchor; Possible values are Left, Right | [optional]
|
16
16
|
**target_field_width_relative** | **Float** | Optional - scale factor for target field width - relative to width of field title; a value of 1.0 indicates the target value area has the same width as the field value as occurring in the image; a value of 2.0 would indicate that the target value area has 2 times the width of the field value as occurring in the image. | [optional]
|
17
17
|
**target_field_height_relative** | **Float** | Optional - scale factor for target field height - relative to height of field title | [optional]
|
18
|
+
**target_field_horizontal_adjustment** | **Float** | Optional - horizontal adjestment in relative width of the field | [optional]
|
19
|
+
**target_field_vertical_adjustment** | **Float** | Optional - vertical adjestment in relative height of the field | [optional]
|
18
20
|
**ignore** | **Array<String>** | Optional - Ignore any result items that contain a partial or complete match with these text strings | [optional]
|
19
21
|
|
20
22
|
|
@@ -6,5 +6,6 @@ Name | Type | Description | Notes
|
|
6
6
|
**successful** | **BOOLEAN** | True if the operation was successful, false otherwise | [optional]
|
7
7
|
**field_value_extraction_result** | [**Array<FieldResult>**](FieldResult.md) | Result of form field OCR data extraction | [optional]
|
8
8
|
**table_value_extraction_results** | [**Array<TableResult>**](TableResult.md) | Result of form table OCR data extraction | [optional]
|
9
|
+
**diagnostics** | **Array<String>** | Diagnostic images - default is null, enable diagnostics=true to populate this parameter with one image per field | [optional]
|
9
10
|
|
10
11
|
|
data/docs/ImageOcrApi.md
CHANGED
@@ -216,6 +216,7 @@ opts = {
|
|
216
216
|
form_template_definition: "form_template_definition_example", # String | Form field definitions
|
217
217
|
recognition_mode: "recognition_mode_example", # String | Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
218
218
|
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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
219
|
+
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).
|
219
220
|
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)
|
220
221
|
}
|
221
222
|
|
@@ -236,6 +237,7 @@ Name | Type | Description | Notes
|
|
236
237
|
**form_template_definition** | **String**| Form field definitions | [optional]
|
237
238
|
**recognition_mode** | **String**| Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled. | [optional]
|
238
239
|
**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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement. | [optional]
|
240
|
+
**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]
|
239
241
|
**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]
|
240
242
|
|
241
243
|
### Return type
|
@@ -280,7 +282,8 @@ opts = {
|
|
280
282
|
bucket_id: "bucket_id_example", # String | Bucket ID of the Configuration Bucket storing the form templates
|
281
283
|
bucket_secret_key: "bucket_secret_key_example", # String | Bucket Secret Key of the Configuration Bucket storing the form templates
|
282
284
|
recognition_mode: "recognition_mode_example", # String | Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
283
|
-
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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
285
|
+
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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
286
|
+
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).
|
284
287
|
}
|
285
288
|
|
286
289
|
begin
|
@@ -301,6 +304,7 @@ Name | Type | Description | Notes
|
|
301
304
|
**bucket_secret_key** | **String**| Bucket Secret Key of the Configuration Bucket storing the form templates | [optional]
|
302
305
|
**recognition_mode** | **String**| Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled. | [optional]
|
303
306
|
**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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement. | [optional]
|
307
|
+
**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]
|
304
308
|
|
305
309
|
### Return type
|
306
310
|
|
@@ -207,6 +207,7 @@ module CloudmersiveOcrApiClient
|
|
207
207
|
# @option opts [String] :form_template_definition Form field definitions
|
208
208
|
# @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
209
209
|
# @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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
210
|
+
# @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).
|
210
211
|
# @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
212
|
# @return [FormRecognitionResult]
|
212
213
|
def image_ocr_photo_recognize_form(image_file, opts = {})
|
@@ -221,6 +222,7 @@ module CloudmersiveOcrApiClient
|
|
221
222
|
# @option opts [String] :form_template_definition Form field definitions
|
222
223
|
# @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
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
|
# @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)
|
225
227
|
# @return [Array<(FormRecognitionResult, Fixnum, Hash)>] FormRecognitionResult data, response status code and response headers
|
226
228
|
def image_ocr_photo_recognize_form_with_http_info(image_file, opts = {})
|
@@ -246,6 +248,7 @@ module CloudmersiveOcrApiClient
|
|
246
248
|
header_params[:'formTemplateDefinition'] = opts[:'form_template_definition'] if !opts[:'form_template_definition'].nil?
|
247
249
|
header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
|
248
250
|
header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
|
251
|
+
header_params[:'diagnostics'] = opts[:'diagnostics'] if !opts[:'diagnostics'].nil?
|
249
252
|
header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
|
250
253
|
|
251
254
|
# form parameters
|
@@ -276,6 +279,7 @@ module CloudmersiveOcrApiClient
|
|
276
279
|
# @option opts [String] :bucket_secret_key Bucket Secret Key of the Configuration Bucket storing the form templates
|
277
280
|
# @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
278
281
|
# @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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
282
|
+
# @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).
|
279
283
|
# @return [FormRecognitionResult]
|
280
284
|
def image_ocr_photo_recognize_form_advanced(image_file, opts = {})
|
281
285
|
data, _status_code, _headers = image_ocr_photo_recognize_form_advanced_with_http_info(image_file, opts)
|
@@ -290,6 +294,7 @@ module CloudmersiveOcrApiClient
|
|
290
294
|
# @option opts [String] :bucket_secret_key Bucket Secret Key of the Configuration Bucket storing the form templates
|
291
295
|
# @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
292
296
|
# @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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
297
|
+
# @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).
|
293
298
|
# @return [Array<(FormRecognitionResult, Fixnum, Hash)>] FormRecognitionResult data, response status code and response headers
|
294
299
|
def image_ocr_photo_recognize_form_advanced_with_http_info(image_file, opts = {})
|
295
300
|
if @api_client.config.debugging
|
@@ -315,6 +320,7 @@ module CloudmersiveOcrApiClient
|
|
315
320
|
header_params[:'bucketSecretKey'] = opts[:'bucket_secret_key'] if !opts[:'bucket_secret_key'].nil?
|
316
321
|
header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
|
317
322
|
header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
|
323
|
+
header_params[:'diagnostics'] = opts[:'diagnostics'] if !opts[:'diagnostics'].nil?
|
318
324
|
|
319
325
|
# form parameters
|
320
326
|
form_params = {}
|
@@ -24,7 +24,7 @@ module CloudmersiveOcrApiClient
|
|
24
24
|
# Optional - the top anchor of the field
|
25
25
|
attr_accessor :top_anchor
|
26
26
|
|
27
|
-
# Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match). Default is Partial.
|
27
|
+
# Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match) and Horizontal (anchor must be laid out horizontally). Default is Partial.
|
28
28
|
attr_accessor :anchor_mode
|
29
29
|
|
30
30
|
# The data type of the field; possible values are INTEGER (Integer value), STRING (Arbitrary string value, spaces are permitted), DATE (Date in a structured format), DECIMAL (Decimal number), ALPHANUMERIC (Continuous alphanumeric string with no spaces), STRINGNOWHITESPACE (A string that contains no whitespace characters), SERIALNUMBER (A serial-number style string that contains letters and numbers, and certain symbols; must contain at least one number), ALPHAONLY (Alphabet characters only, no numbers or symbols or whitespace)
|
@@ -51,6 +51,12 @@ module CloudmersiveOcrApiClient
|
|
51
51
|
# Optional - scale factor for target field height - relative to height of field title
|
52
52
|
attr_accessor :target_field_height_relative
|
53
53
|
|
54
|
+
# Optional - horizontal adjestment in relative width of the field
|
55
|
+
attr_accessor :target_field_horizontal_adjustment
|
56
|
+
|
57
|
+
# Optional - vertical adjestment in relative height of the field
|
58
|
+
attr_accessor :target_field_vertical_adjustment
|
59
|
+
|
54
60
|
# Optional - Ignore any result items that contain a partial or complete match with these text strings
|
55
61
|
attr_accessor :ignore
|
56
62
|
|
@@ -70,6 +76,8 @@ module CloudmersiveOcrApiClient
|
|
70
76
|
:'horizontal_alignment_type' => :'HorizontalAlignmentType',
|
71
77
|
:'target_field_width_relative' => :'TargetFieldWidth_Relative',
|
72
78
|
:'target_field_height_relative' => :'TargetFieldHeight_Relative',
|
79
|
+
:'target_field_horizontal_adjustment' => :'TargetFieldHorizontalAdjustment',
|
80
|
+
:'target_field_vertical_adjustment' => :'TargetFieldVerticalAdjustment',
|
73
81
|
:'ignore' => :'Ignore'
|
74
82
|
}
|
75
83
|
end
|
@@ -89,6 +97,8 @@ module CloudmersiveOcrApiClient
|
|
89
97
|
:'horizontal_alignment_type' => :'String',
|
90
98
|
:'target_field_width_relative' => :'Float',
|
91
99
|
:'target_field_height_relative' => :'Float',
|
100
|
+
:'target_field_horizontal_adjustment' => :'Float',
|
101
|
+
:'target_field_vertical_adjustment' => :'Float',
|
92
102
|
:'ignore' => :'Array<String>'
|
93
103
|
}
|
94
104
|
end
|
@@ -149,6 +159,14 @@ module CloudmersiveOcrApiClient
|
|
149
159
|
self.target_field_height_relative = attributes[:'TargetFieldHeight_Relative']
|
150
160
|
end
|
151
161
|
|
162
|
+
if attributes.has_key?(:'TargetFieldHorizontalAdjustment')
|
163
|
+
self.target_field_horizontal_adjustment = attributes[:'TargetFieldHorizontalAdjustment']
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.has_key?(:'TargetFieldVerticalAdjustment')
|
167
|
+
self.target_field_vertical_adjustment = attributes[:'TargetFieldVerticalAdjustment']
|
168
|
+
end
|
169
|
+
|
152
170
|
if attributes.has_key?(:'Ignore')
|
153
171
|
if (value = attributes[:'Ignore']).is_a?(Array)
|
154
172
|
self.ignore = value
|
@@ -187,6 +205,8 @@ module CloudmersiveOcrApiClient
|
|
187
205
|
horizontal_alignment_type == o.horizontal_alignment_type &&
|
188
206
|
target_field_width_relative == o.target_field_width_relative &&
|
189
207
|
target_field_height_relative == o.target_field_height_relative &&
|
208
|
+
target_field_horizontal_adjustment == o.target_field_horizontal_adjustment &&
|
209
|
+
target_field_vertical_adjustment == o.target_field_vertical_adjustment &&
|
190
210
|
ignore == o.ignore
|
191
211
|
end
|
192
212
|
|
@@ -199,7 +219,7 @@ module CloudmersiveOcrApiClient
|
|
199
219
|
# Calculates hash code according to all attributes.
|
200
220
|
# @return [Fixnum] Hash code
|
201
221
|
def hash
|
202
|
-
[field_id, left_anchor, top_anchor, anchor_mode, data_type, target_digit_count, minimum_character_count, allow_numeric_digits, vertical_alignment_type, horizontal_alignment_type, target_field_width_relative, target_field_height_relative, ignore].hash
|
222
|
+
[field_id, left_anchor, top_anchor, anchor_mode, data_type, target_digit_count, minimum_character_count, allow_numeric_digits, vertical_alignment_type, horizontal_alignment_type, target_field_width_relative, target_field_height_relative, target_field_horizontal_adjustment, target_field_vertical_adjustment, ignore].hash
|
203
223
|
end
|
204
224
|
|
205
225
|
# Builds the object from hash
|
@@ -24,13 +24,17 @@ module CloudmersiveOcrApiClient
|
|
24
24
|
# Result of form table OCR data extraction
|
25
25
|
attr_accessor :table_value_extraction_results
|
26
26
|
|
27
|
+
# Diagnostic images - default is null, enable diagnostics=true to populate this parameter with one image per field
|
28
|
+
attr_accessor :diagnostics
|
29
|
+
|
27
30
|
|
28
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
32
|
def self.attribute_map
|
30
33
|
{
|
31
34
|
:'successful' => :'Successful',
|
32
35
|
:'field_value_extraction_result' => :'FieldValueExtractionResult',
|
33
|
-
:'table_value_extraction_results' => :'TableValueExtractionResults'
|
36
|
+
:'table_value_extraction_results' => :'TableValueExtractionResults',
|
37
|
+
:'diagnostics' => :'Diagnostics'
|
34
38
|
}
|
35
39
|
end
|
36
40
|
|
@@ -39,7 +43,8 @@ module CloudmersiveOcrApiClient
|
|
39
43
|
{
|
40
44
|
:'successful' => :'BOOLEAN',
|
41
45
|
:'field_value_extraction_result' => :'Array<FieldResult>',
|
42
|
-
:'table_value_extraction_results' => :'Array<TableResult>'
|
46
|
+
:'table_value_extraction_results' => :'Array<TableResult>',
|
47
|
+
:'diagnostics' => :'Array<String>'
|
43
48
|
}
|
44
49
|
end
|
45
50
|
|
@@ -67,6 +72,12 @@ module CloudmersiveOcrApiClient
|
|
67
72
|
end
|
68
73
|
end
|
69
74
|
|
75
|
+
if attributes.has_key?(:'Diagnostics')
|
76
|
+
if (value = attributes[:'Diagnostics']).is_a?(Array)
|
77
|
+
self.diagnostics = value
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
70
81
|
end
|
71
82
|
|
72
83
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -89,7 +100,8 @@ module CloudmersiveOcrApiClient
|
|
89
100
|
self.class == o.class &&
|
90
101
|
successful == o.successful &&
|
91
102
|
field_value_extraction_result == o.field_value_extraction_result &&
|
92
|
-
table_value_extraction_results == o.table_value_extraction_results
|
103
|
+
table_value_extraction_results == o.table_value_extraction_results &&
|
104
|
+
diagnostics == o.diagnostics
|
93
105
|
end
|
94
106
|
|
95
107
|
# @see the `==` method
|
@@ -101,7 +113,7 @@ module CloudmersiveOcrApiClient
|
|
101
113
|
# Calculates hash code according to all attributes.
|
102
114
|
# @return [Fixnum] Hash code
|
103
115
|
def hash
|
104
|
-
[successful, field_value_extraction_result, table_value_extraction_results].hash
|
116
|
+
[successful, field_value_extraction_result, table_value_extraction_results, diagnostics].hash
|
105
117
|
end
|
106
118
|
|
107
119
|
# Builds the object from hash
|
@@ -80,6 +80,7 @@ describe 'ImageOcrApi' do
|
|
80
80
|
# @option opts [String] :form_template_definition Form field definitions
|
81
81
|
# @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
82
82
|
# @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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
83
|
+
# @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).
|
83
84
|
# @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)
|
84
85
|
# @return [FormRecognitionResult]
|
85
86
|
describe 'image_ocr_photo_recognize_form test' do
|
@@ -97,6 +98,7 @@ describe 'ImageOcrApi' do
|
|
97
98
|
# @option opts [String] :bucket_secret_key Bucket Secret Key of the Configuration Bucket storing the form templates
|
98
99
|
# @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
99
100
|
# @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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
101
|
+
# @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).
|
100
102
|
# @return [FormRecognitionResult]
|
101
103
|
describe 'image_ocr_photo_recognize_form_advanced test' do
|
102
104
|
it "should work" do
|
@@ -104,6 +104,18 @@ describe 'FormFieldDefinition' do
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
+
describe 'test attribute "target_field_horizontal_adjustment"' do
|
108
|
+
it 'should work' do
|
109
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
describe 'test attribute "target_field_vertical_adjustment"' do
|
114
|
+
it 'should work' do
|
115
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
107
119
|
describe 'test attribute "ignore"' do
|
108
120
|
it 'should work' do
|
109
121
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
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.4.
|
4
|
+
version: 1.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloudmersive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|