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,9 +0,0 @@
1
- # CloudmersiveOcrApiClient::ReceiptLineItem
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **item_description** | **String** | Description of the item | [optional]
7
- **item_price** | **Float** | Price of the item if available | [optional]
8
-
9
-
@@ -1,16 +0,0 @@
1
- # CloudmersiveOcrApiClient::ReceiptRecognitionResult
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **successful** | **BOOLEAN** | True if the operation was successful, false otherwise | [optional]
7
- **timestamp** | **DateTime** | The date and time printed on the receipt (if included on the receipt) | [optional]
8
- **business_name** | **String** | The name of the business printed on the receipt (if included on the receipt) | [optional]
9
- **business_website** | **String** | The website URL of the business printed on the receipt (if included on the receipt) | [optional]
10
- **address_string** | **String** | The address of the business printed on the receipt (if included on the receipt) | [optional]
11
- **phone_number** | **String** | The phone number printed on the receipt (if included on the receipt) | [optional]
12
- **receipt_items** | [**Array<ReceiptLineItem>**](ReceiptLineItem.md) | The individual line items comprising the order; does not include total (see ReceiptTotal) | [optional]
13
- **receipt_sub_total** | **Float** | 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. | [optional]
14
- **receipt_total** | **Float** | The total monetary value of the receipt (if included on the receipt) | [optional]
15
-
16
-
@@ -1,63 +0,0 @@
1
- # CloudmersiveOcrApiClient::ReceiptsApi
2
-
3
- All URIs are relative to *https://api.cloudmersive.com*
4
-
5
- Method | HTTP request | Description
6
- ------------- | ------------- | -------------
7
- [**receipts_photo_to_csv**](ReceiptsApi.md#receipts_photo_to_csv) | **POST** /ocr/receipts/photo/to/csv | Convert a photo of a receipt into a CSV file containing structured information from the receipt
8
-
9
-
10
- # **receipts_photo_to_csv**
11
- > Object receipts_photo_to_csv(image_file)
12
-
13
- Convert a photo of a receipt into a CSV file containing structured information from the receipt
14
-
15
- Leverage Deep Learning to automatically turn a photo of a receipt into a CSV file containing the structured information from the receipt.
16
-
17
- ### Example
18
- ```ruby
19
- # load the gem
20
- require 'cloudmersive-ocr-api-client'
21
- # setup authorization
22
- CloudmersiveOcrApiClient.configure do |config|
23
- # Configure API key authorization: Apikey
24
- config.api_key['Apikey'] = 'YOUR API KEY'
25
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
26
- #config.api_key_prefix['Apikey'] = 'Bearer'
27
- end
28
-
29
- api_instance = CloudmersiveOcrApiClient::ReceiptsApi.new
30
-
31
- image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
32
-
33
-
34
- begin
35
- #Convert a photo of a receipt into a CSV file containing structured information from the receipt
36
- result = api_instance.receipts_photo_to_csv(image_file)
37
- p result
38
- rescue CloudmersiveOcrApiClient::ApiError => e
39
- puts "Exception when calling ReceiptsApi->receipts_photo_to_csv: #{e}"
40
- end
41
- ```
42
-
43
- ### Parameters
44
-
45
- Name | Type | Description | Notes
46
- ------------- | ------------- | ------------- | -------------
47
- **image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
48
-
49
- ### Return type
50
-
51
- **Object**
52
-
53
- ### Authorization
54
-
55
- [Apikey](../README.md#Apikey)
56
-
57
- ### HTTP request headers
58
-
59
- - **Content-Type**: multipart/form-data
60
- - **Accept**: application/json, text/json, application/xml, text/xml
61
-
62
-
63
-
@@ -1,9 +0,0 @@
1
- # CloudmersiveOcrApiClient::TableCellResult
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **column_id** | **String** | The ID of the column | [optional]
7
- **cell_values** | [**Array<OcrPhotoTextElement>**](OcrPhotoTextElement.md) | Result cell value(s) extracted | [optional]
8
-
9
-
@@ -1,9 +0,0 @@
1
- # CloudmersiveOcrApiClient::TableResult
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **table_definition** | [**FormTableDefinition**](FormTableDefinition.md) | The input table definition for reference | [optional]
7
- **table_rows_result** | [**Array<TableRowResult>**](TableRowResult.md) | Rows of data in the table | [optional]
8
-
9
-
@@ -1,8 +0,0 @@
1
- # CloudmersiveOcrApiClient::TableRowResult
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
- **table_row_cells_result** | [**Array<TableCellResult>**](TableCellResult.md) | Table cells in this row result | [optional]
7
-
8
-
@@ -1,55 +0,0 @@
1
- #!/bin/sh
2
- #
3
- # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
- #
5
- # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
- #
7
- # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
-
9
- git_user_id=$1
10
- git_repo_id=$2
11
- release_note=$3
12
-
13
- if [ "$git_user_id" = "" ]; then
14
- git_user_id="GIT_USER_ID"
15
- echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
- fi
17
-
18
- if [ "$git_repo_id" = "" ]; then
19
- git_repo_id="GIT_REPO_ID"
20
- echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
- fi
22
-
23
- if [ "$release_note" = "" ]; then
24
- release_note="Minor update"
25
- echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
- fi
27
-
28
- # Initialize the local directory as a Git repository
29
- git init
30
-
31
- # Adds the files in the local repository and stages them for commit.
32
- git add .
33
-
34
- # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
- git commit -m "$release_note"
36
-
37
- # Sets the new remote
38
- git_remote=`git remote`
39
- if [ "$git_remote" = "" ]; then # git remote not defined
40
-
41
- if [ "$GIT_TOKEN" = "" ]; then
42
- echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
- git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
- else
45
- git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
- fi
47
-
48
- fi
49
-
50
- git pull origin master
51
-
52
- # Pushes (Forces) the changes in the local repository up to the remote repository
53
- echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
- git push origin master 2>&1 | grep -v 'To https'
55
-
@@ -1,70 +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
- # Common files
14
- require 'cloudmersive-ocr-api-client/api_client'
15
- require 'cloudmersive-ocr-api-client/api_error'
16
- require 'cloudmersive-ocr-api-client/version'
17
- require 'cloudmersive-ocr-api-client/configuration'
18
-
19
- # Models
20
- require 'cloudmersive-ocr-api-client/models/business_card_recognition_result'
21
- require 'cloudmersive-ocr-api-client/models/field_result'
22
- require 'cloudmersive-ocr-api-client/models/form_definition_template'
23
- require 'cloudmersive-ocr-api-client/models/form_field_definition'
24
- require 'cloudmersive-ocr-api-client/models/form_recognition_result'
25
- require 'cloudmersive-ocr-api-client/models/form_table_column_definition'
26
- require 'cloudmersive-ocr-api-client/models/form_table_definition'
27
- require 'cloudmersive-ocr-api-client/models/get_page_angle_result'
28
- require 'cloudmersive-ocr-api-client/models/image_to_lines_with_location_result'
29
- require 'cloudmersive-ocr-api-client/models/image_to_text_response'
30
- require 'cloudmersive-ocr-api-client/models/image_to_words_with_location_result'
31
- require 'cloudmersive-ocr-api-client/models/ocr_line_element'
32
- require 'cloudmersive-ocr-api-client/models/ocr_page_result'
33
- require 'cloudmersive-ocr-api-client/models/ocr_page_result_with_lines_with_location'
34
- require 'cloudmersive-ocr-api-client/models/ocr_page_result_with_words_with_location'
35
- require 'cloudmersive-ocr-api-client/models/ocr_photo_text_element'
36
- require 'cloudmersive-ocr-api-client/models/ocr_word_element'
37
- require 'cloudmersive-ocr-api-client/models/pdf_to_lines_with_location_result'
38
- require 'cloudmersive-ocr-api-client/models/pdf_to_text_response'
39
- require 'cloudmersive-ocr-api-client/models/pdf_to_words_with_location_result'
40
- require 'cloudmersive-ocr-api-client/models/photo_to_words_with_location_result'
41
- require 'cloudmersive-ocr-api-client/models/point'
42
- require 'cloudmersive-ocr-api-client/models/receipt_line_item'
43
- require 'cloudmersive-ocr-api-client/models/receipt_recognition_result'
44
- require 'cloudmersive-ocr-api-client/models/table_cell_result'
45
- require 'cloudmersive-ocr-api-client/models/table_result'
46
- require 'cloudmersive-ocr-api-client/models/table_row_result'
47
-
48
- # APIs
49
- require 'cloudmersive-ocr-api-client/api/image_ocr_api'
50
- require 'cloudmersive-ocr-api-client/api/pdf_ocr_api'
51
- require 'cloudmersive-ocr-api-client/api/preprocessing_api'
52
- require 'cloudmersive-ocr-api-client/api/receipts_api'
53
-
54
- module CloudmersiveOcrApiClient
55
- class << self
56
- # Customize default settings for the SDK using block.
57
- # CloudmersiveOcrApiClient.configure do |config|
58
- # config.username = "xxx"
59
- # config.password = "xxx"
60
- # end
61
- # If no block given, return the default Configuration object.
62
- def configure
63
- if block_given?
64
- yield(Configuration.default)
65
- else
66
- Configuration.default
67
- end
68
- end
69
- end
70
- end
@@ -1,605 +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 "uri"
14
-
15
- module CloudmersiveOcrApiClient
16
- class ImageOcrApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
-
23
- # Convert a scanned image into words with location
24
- # Converts an uploaded image in common formats such as JPEG, PNG into lines/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
25
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
26
- # @param [Hash] opts the optional parameters
27
- # @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)
28
- # @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).
29
- # @return [ImageToLinesWithLocationResult]
30
- def image_ocr_image_lines_with_location(image_file, opts = {})
31
- data, _status_code, _headers = image_ocr_image_lines_with_location_with_http_info(image_file, opts)
32
- return data
33
- end
34
-
35
- # Convert a scanned image into words with location
36
- # Converts an uploaded image in common formats such as JPEG, PNG into lines/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
37
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
38
- # @param [Hash] opts the optional parameters
39
- # @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)
40
- # @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).
41
- # @return [Array<(ImageToLinesWithLocationResult, Fixnum, Hash)>] ImageToLinesWithLocationResult data, response status code and response headers
42
- def image_ocr_image_lines_with_location_with_http_info(image_file, opts = {})
43
- if @api_client.config.debugging
44
- @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_image_lines_with_location ..."
45
- end
46
- # verify the required parameter 'image_file' is set
47
- if @api_client.config.client_side_validation && image_file.nil?
48
- fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_image_lines_with_location"
49
- end
50
- # resource path
51
- local_var_path = "/ocr/image/to/lines-with-location"
52
-
53
- # query parameters
54
- query_params = {}
55
-
56
- # header parameters
57
- header_params = {}
58
- # HTTP header 'Accept' (if needed)
59
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
60
- # HTTP header 'Content-Type'
61
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
62
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
63
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
64
-
65
- # form parameters
66
- form_params = {}
67
- form_params["imageFile"] = image_file
68
-
69
- # http body (model)
70
- post_body = nil
71
- auth_names = ['Apikey']
72
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
73
- :header_params => header_params,
74
- :query_params => query_params,
75
- :form_params => form_params,
76
- :body => post_body,
77
- :auth_names => auth_names,
78
- :return_type => 'ImageToLinesWithLocationResult')
79
- if @api_client.config.debugging
80
- @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_image_lines_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
- end
82
- return data, status_code, headers
83
- end
84
-
85
- # Convert a scanned image into words with location
86
- # Converts an uploaded image in common formats such as JPEG, PNG into words/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
87
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
88
- # @param [Hash] opts the optional parameters
89
- # @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)
90
- # @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).
91
- # @return [ImageToWordsWithLocationResult]
92
- def image_ocr_image_words_with_location(image_file, opts = {})
93
- data, _status_code, _headers = image_ocr_image_words_with_location_with_http_info(image_file, opts)
94
- return data
95
- end
96
-
97
- # Convert a scanned image into words with location
98
- # Converts an uploaded image in common formats such as JPEG, PNG into words/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
99
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
100
- # @param [Hash] opts the optional parameters
101
- # @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)
102
- # @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).
103
- # @return [Array<(ImageToWordsWithLocationResult, Fixnum, Hash)>] ImageToWordsWithLocationResult data, response status code and response headers
104
- def image_ocr_image_words_with_location_with_http_info(image_file, opts = {})
105
- if @api_client.config.debugging
106
- @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_image_words_with_location ..."
107
- end
108
- # verify the required parameter 'image_file' is set
109
- if @api_client.config.client_side_validation && image_file.nil?
110
- fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_image_words_with_location"
111
- end
112
- # resource path
113
- local_var_path = "/ocr/image/to/words-with-location"
114
-
115
- # query parameters
116
- query_params = {}
117
-
118
- # header parameters
119
- header_params = {}
120
- # HTTP header 'Accept' (if needed)
121
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
122
- # HTTP header 'Content-Type'
123
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
124
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
125
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
126
-
127
- # form parameters
128
- form_params = {}
129
- form_params["imageFile"] = image_file
130
-
131
- # http body (model)
132
- post_body = nil
133
- auth_names = ['Apikey']
134
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
135
- :header_params => header_params,
136
- :query_params => query_params,
137
- :form_params => form_params,
138
- :body => post_body,
139
- :auth_names => auth_names,
140
- :return_type => 'ImageToWordsWithLocationResult')
141
- if @api_client.config.debugging
142
- @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_image_words_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
- end
144
- return data, status_code, headers
145
- end
146
-
147
- # Recognize a photo of a business card, extract key business information
148
- # Analyzes a photograph of a business card as input, and outputs key business information such as the name of the person, name of the business, the address of the business, the phone number, the email address and more.
149
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
150
- # @param [Hash] opts the optional parameters
151
- # @return [BusinessCardRecognitionResult]
152
- def image_ocr_photo_recognize_business_card(image_file, opts = {})
153
- data, _status_code, _headers = image_ocr_photo_recognize_business_card_with_http_info(image_file, opts)
154
- return data
155
- end
156
-
157
- # Recognize a photo of a business card, extract key business information
158
- # Analyzes a photograph of a business card as input, and outputs key business information such as the name of the person, name of the business, the address of the business, the phone number, the email address and more.
159
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
160
- # @param [Hash] opts the optional parameters
161
- # @return [Array<(BusinessCardRecognitionResult, Fixnum, Hash)>] BusinessCardRecognitionResult data, response status code and response headers
162
- def image_ocr_photo_recognize_business_card_with_http_info(image_file, opts = {})
163
- if @api_client.config.debugging
164
- @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_photo_recognize_business_card ..."
165
- end
166
- # verify the required parameter 'image_file' is set
167
- if @api_client.config.client_side_validation && image_file.nil?
168
- fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_recognize_business_card"
169
- end
170
- # resource path
171
- local_var_path = "/ocr/photo/recognize/business-card"
172
-
173
- # query parameters
174
- query_params = {}
175
-
176
- # header parameters
177
- header_params = {}
178
- # HTTP header 'Accept' (if needed)
179
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
180
- # HTTP header 'Content-Type'
181
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
182
-
183
- # form parameters
184
- form_params = {}
185
- form_params["imageFile"] = image_file
186
-
187
- # http body (model)
188
- post_body = nil
189
- auth_names = ['Apikey']
190
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
191
- :header_params => header_params,
192
- :query_params => query_params,
193
- :form_params => form_params,
194
- :body => post_body,
195
- :auth_names => auth_names,
196
- :return_type => 'BusinessCardRecognitionResult')
197
- if @api_client.config.debugging
198
- @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_photo_recognize_business_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
199
- end
200
- return data, status_code, headers
201
- end
202
-
203
- # Recognize a photo of a form, extract key fields and business information
204
- # Analyzes a photograph of a form as input, and outputs key business fields and information. Customzie data to be extracted by defining fields for the form.
205
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
206
- # @param [Hash] opts the optional parameters
207
- # @option opts [String] :form_template_definition Form field definitions
208
- # @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying &#39;Advanced&#39;, enable handwriting recognition by specifying &#39;EnableHandwriting&#39;. Default is disabled.
209
- # @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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to &#39;None&#39; if you do not want to use automatic image unrotation and enhancement.
210
- # @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).
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)
212
- # @return [FormRecognitionResult]
213
- def image_ocr_photo_recognize_form(image_file, opts = {})
214
- data, _status_code, _headers = image_ocr_photo_recognize_form_with_http_info(image_file, opts)
215
- return data
216
- end
217
-
218
- # Recognize a photo of a form, extract key fields and business information
219
- # Analyzes a photograph of a form as input, and outputs key business fields and information. Customzie data to be extracted by defining fields for the form.
220
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
221
- # @param [Hash] opts the optional parameters
222
- # @option opts [String] :form_template_definition Form field definitions
223
- # @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying &#39;Advanced&#39;, enable handwriting recognition by specifying &#39;EnableHandwriting&#39;. Default is disabled.
224
- # @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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to &#39;None&#39; if you do not want to use automatic image unrotation and enhancement.
225
- # @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).
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)
227
- # @return [Array<(FormRecognitionResult, Fixnum, Hash)>] FormRecognitionResult data, response status code and response headers
228
- def image_ocr_photo_recognize_form_with_http_info(image_file, opts = {})
229
- if @api_client.config.debugging
230
- @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_photo_recognize_form ..."
231
- end
232
- # verify the required parameter 'image_file' is set
233
- if @api_client.config.client_side_validation && image_file.nil?
234
- fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_recognize_form"
235
- end
236
- # resource path
237
- local_var_path = "/ocr/photo/recognize/form"
238
-
239
- # query parameters
240
- query_params = {}
241
-
242
- # header parameters
243
- header_params = {}
244
- # HTTP header 'Accept' (if needed)
245
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
246
- # HTTP header 'Content-Type'
247
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
248
- header_params[:'formTemplateDefinition'] = opts[:'form_template_definition'] if !opts[:'form_template_definition'].nil?
249
- header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
250
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
251
- header_params[:'diagnostics'] = opts[:'diagnostics'] if !opts[:'diagnostics'].nil?
252
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
253
-
254
- # form parameters
255
- form_params = {}
256
- form_params["imageFile"] = image_file
257
-
258
- # http body (model)
259
- post_body = nil
260
- auth_names = ['Apikey']
261
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
262
- :header_params => header_params,
263
- :query_params => query_params,
264
- :form_params => form_params,
265
- :body => post_body,
266
- :auth_names => auth_names,
267
- :return_type => 'FormRecognitionResult')
268
- if @api_client.config.debugging
269
- @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_photo_recognize_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
270
- end
271
- return data, status_code, headers
272
- end
273
-
274
- # Recognize a photo of a form, extract key fields using stored templates
275
- # Analyzes a photograph of a form as input, and outputs key business fields and information. Customzie data to be extracted by defining fields for the form. Uses template definitions stored in Cloudmersive Configuration; to configure stored templates in a configuration bucket, log into Cloudmersive Management Portal and navigate to Settings &gt; API Configuration &gt; Create Bucket
276
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
277
- # @param [Hash] opts the optional parameters
278
- # @option opts [String] :bucket_id Bucket ID of the Configuration Bucket storing the form templates
279
- # @option opts [String] :bucket_secret_key Bucket Secret Key of the Configuration Bucket storing the form templates
280
- # @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying &#39;Advanced&#39;, enable handwriting recognition by specifying &#39;EnableHandwriting&#39;. Default is disabled.
281
- # @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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to &#39;None&#39; if you do not want to use automatic image unrotation and enhancement.
282
- # @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).
283
- # @return [FormRecognitionResult]
284
- def image_ocr_photo_recognize_form_advanced(image_file, opts = {})
285
- data, _status_code, _headers = image_ocr_photo_recognize_form_advanced_with_http_info(image_file, opts)
286
- return data
287
- end
288
-
289
- # Recognize a photo of a form, extract key fields using stored templates
290
- # Analyzes a photograph of a form as input, and outputs key business fields and information. Customzie data to be extracted by defining fields for the form. Uses template definitions stored in Cloudmersive Configuration; to configure stored templates in a configuration bucket, log into Cloudmersive Management Portal and navigate to Settings &amp;gt; API Configuration &amp;gt; Create Bucket
291
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
292
- # @param [Hash] opts the optional parameters
293
- # @option opts [String] :bucket_id Bucket ID of the Configuration Bucket storing the form templates
294
- # @option opts [String] :bucket_secret_key Bucket Secret Key of the Configuration Bucket storing the form templates
295
- # @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying &#39;Advanced&#39;, enable handwriting recognition by specifying &#39;EnableHandwriting&#39;. Default is disabled.
296
- # @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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to &#39;None&#39; if you do not want to use automatic image unrotation and enhancement.
297
- # @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).
298
- # @return [Array<(FormRecognitionResult, Fixnum, Hash)>] FormRecognitionResult data, response status code and response headers
299
- def image_ocr_photo_recognize_form_advanced_with_http_info(image_file, opts = {})
300
- if @api_client.config.debugging
301
- @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_photo_recognize_form_advanced ..."
302
- end
303
- # verify the required parameter 'image_file' is set
304
- if @api_client.config.client_side_validation && image_file.nil?
305
- fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_recognize_form_advanced"
306
- end
307
- # resource path
308
- local_var_path = "/ocr/photo/recognize/form/advanced"
309
-
310
- # query parameters
311
- query_params = {}
312
-
313
- # header parameters
314
- header_params = {}
315
- # HTTP header 'Accept' (if needed)
316
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
317
- # HTTP header 'Content-Type'
318
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
319
- header_params[:'bucketID'] = opts[:'bucket_id'] if !opts[:'bucket_id'].nil?
320
- header_params[:'bucketSecretKey'] = opts[:'bucket_secret_key'] if !opts[:'bucket_secret_key'].nil?
321
- header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
322
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
323
- header_params[:'diagnostics'] = opts[:'diagnostics'] if !opts[:'diagnostics'].nil?
324
-
325
- # form parameters
326
- form_params = {}
327
- form_params["imageFile"] = image_file
328
-
329
- # http body (model)
330
- post_body = nil
331
- auth_names = ['Apikey']
332
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
333
- :header_params => header_params,
334
- :query_params => query_params,
335
- :form_params => form_params,
336
- :body => post_body,
337
- :auth_names => auth_names,
338
- :return_type => 'FormRecognitionResult')
339
- if @api_client.config.debugging
340
- @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_photo_recognize_form_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
341
- end
342
- return data, status_code, headers
343
- end
344
-
345
- # Recognize a photo of a receipt, extract key business information
346
- # Analyzes a photograph of a receipt as input, and outputs key business information such as the name of the business, the address of the business, the phone number of the business, the total of the receipt, the date of the receipt, and more.
347
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
348
- # @param [Hash] opts the optional parameters
349
- # @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying &#39;Advanced&#39;, enable handwriting recognition by specifying &#39;EnableHandwriting&#39;. Default is disabled.
350
- # @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)
351
- # @option opts [String] :preprocessing Optional, preprocessing mode, default is &#39;None&#39;. Possible values are None (no preprocessing of the image), and &#39;Advanced&#39; (automatic image enhancement of the image before OCR is applied; this is recommended and needed to handle rotated receipts).
352
- # @return [ReceiptRecognitionResult]
353
- def image_ocr_photo_recognize_receipt(image_file, opts = {})
354
- data, _status_code, _headers = image_ocr_photo_recognize_receipt_with_http_info(image_file, opts)
355
- return data
356
- end
357
-
358
- # Recognize a photo of a receipt, extract key business information
359
- # Analyzes a photograph of a receipt as input, and outputs key business information such as the name of the business, the address of the business, the phone number of the business, the total of the receipt, the date of the receipt, and more.
360
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
361
- # @param [Hash] opts the optional parameters
362
- # @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying &#39;Advanced&#39;, enable handwriting recognition by specifying &#39;EnableHandwriting&#39;. Default is disabled.
363
- # @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)
364
- # @option opts [String] :preprocessing Optional, preprocessing mode, default is &#39;None&#39;. Possible values are None (no preprocessing of the image), and &#39;Advanced&#39; (automatic image enhancement of the image before OCR is applied; this is recommended and needed to handle rotated receipts).
365
- # @return [Array<(ReceiptRecognitionResult, Fixnum, Hash)>] ReceiptRecognitionResult data, response status code and response headers
366
- def image_ocr_photo_recognize_receipt_with_http_info(image_file, opts = {})
367
- if @api_client.config.debugging
368
- @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_photo_recognize_receipt ..."
369
- end
370
- # verify the required parameter 'image_file' is set
371
- if @api_client.config.client_side_validation && image_file.nil?
372
- fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_recognize_receipt"
373
- end
374
- # resource path
375
- local_var_path = "/ocr/photo/recognize/receipt"
376
-
377
- # query parameters
378
- query_params = {}
379
-
380
- # header parameters
381
- header_params = {}
382
- # HTTP header 'Accept' (if needed)
383
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
384
- # HTTP header 'Content-Type'
385
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
386
- header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
387
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
388
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
389
-
390
- # form parameters
391
- form_params = {}
392
- form_params["imageFile"] = image_file
393
-
394
- # http body (model)
395
- post_body = nil
396
- auth_names = ['Apikey']
397
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
398
- :header_params => header_params,
399
- :query_params => query_params,
400
- :form_params => form_params,
401
- :body => post_body,
402
- :auth_names => auth_names,
403
- :return_type => 'ReceiptRecognitionResult')
404
- if @api_client.config.debugging
405
- @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_photo_recognize_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
406
- end
407
- return data, status_code, headers
408
- end
409
-
410
- # Convert a photo of a document into text
411
- # Converts an uploaded photo of a document in common formats such as JPEG, PNG into text via Optical Character Recognition. This API is intended to be run on photos of documents, e.g. taken with a smartphone and supports cases where other content, such as a desk, are in the frame and the camera is crooked. If you want to OCR a scanned image, use the image/toText API call instead as it is designed for scanned images.
412
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
413
- # @param [Hash] opts the optional parameters
414
- # @option opts [String] :recognition_mode Optional; possible values are &#39;Basic&#39; which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls; &#39;Normal&#39; which provides highly fault tolerant OCR recognition uses 14-16 API calls; and &#39;Advanced&#39; which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is &#39;Advanced&#39;
415
- # @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)
416
- # @return [ImageToTextResponse]
417
- def image_ocr_photo_to_text(image_file, opts = {})
418
- data, _status_code, _headers = image_ocr_photo_to_text_with_http_info(image_file, opts)
419
- return data
420
- end
421
-
422
- # Convert a photo of a document into text
423
- # Converts an uploaded photo of a document in common formats such as JPEG, PNG into text via Optical Character Recognition. This API is intended to be run on photos of documents, e.g. taken with a smartphone and supports cases where other content, such as a desk, are in the frame and the camera is crooked. If you want to OCR a scanned image, use the image/toText API call instead as it is designed for scanned images.
424
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
425
- # @param [Hash] opts the optional parameters
426
- # @option opts [String] :recognition_mode Optional; possible values are &#39;Basic&#39; which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls; &#39;Normal&#39; which provides highly fault tolerant OCR recognition uses 14-16 API calls; and &#39;Advanced&#39; which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is &#39;Advanced&#39;
427
- # @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)
428
- # @return [Array<(ImageToTextResponse, Fixnum, Hash)>] ImageToTextResponse data, response status code and response headers
429
- def image_ocr_photo_to_text_with_http_info(image_file, opts = {})
430
- if @api_client.config.debugging
431
- @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_photo_to_text ..."
432
- end
433
- # verify the required parameter 'image_file' is set
434
- if @api_client.config.client_side_validation && image_file.nil?
435
- fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_to_text"
436
- end
437
- # resource path
438
- local_var_path = "/ocr/photo/toText"
439
-
440
- # query parameters
441
- query_params = {}
442
-
443
- # header parameters
444
- header_params = {}
445
- # HTTP header 'Accept' (if needed)
446
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
447
- # HTTP header 'Content-Type'
448
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
449
- header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
450
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
451
-
452
- # form parameters
453
- form_params = {}
454
- form_params["imageFile"] = image_file
455
-
456
- # http body (model)
457
- post_body = nil
458
- auth_names = ['Apikey']
459
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
460
- :header_params => header_params,
461
- :query_params => query_params,
462
- :form_params => form_params,
463
- :body => post_body,
464
- :auth_names => auth_names,
465
- :return_type => 'ImageToTextResponse')
466
- if @api_client.config.debugging
467
- @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_photo_to_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
468
- end
469
- return data, status_code, headers
470
- end
471
-
472
- # Convert a photo of a document or receipt into words with location
473
- # Converts a photo of a document or receipt in common formats such as JPEG, PNG into words/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on photographs of documents. If you want to OCR scanned documents (e.g. taken with a scanner), be sure to use the image/toText API instead, as it is designed for that use case.
474
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
475
- # @param [Hash] opts the optional parameters
476
- # @option opts [String] :recognition_mode Optional; possible values are &#39;Normal&#39; which provides highly fault tolerant OCR recognition uses 14-16 API calls; and &#39;Advanced&#39; which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is &#39;Advanced&#39;
477
- # @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)
478
- # @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).
479
- # @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).
480
- # @return [PhotoToWordsWithLocationResult]
481
- def image_ocr_photo_words_with_location(image_file, opts = {})
482
- data, _status_code, _headers = image_ocr_photo_words_with_location_with_http_info(image_file, opts)
483
- return data
484
- end
485
-
486
- # Convert a photo of a document or receipt into words with location
487
- # Converts a photo of a document or receipt in common formats such as JPEG, PNG into words/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on photographs of documents. If you want to OCR scanned documents (e.g. taken with a scanner), be sure to use the image/toText API instead, as it is designed for that use case.
488
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
489
- # @param [Hash] opts the optional parameters
490
- # @option opts [String] :recognition_mode Optional; possible values are &#39;Normal&#39; which provides highly fault tolerant OCR recognition uses 14-16 API calls; and &#39;Advanced&#39; which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is &#39;Advanced&#39;
491
- # @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)
492
- # @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).
493
- # @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).
494
- # @return [Array<(PhotoToWordsWithLocationResult, Fixnum, Hash)>] PhotoToWordsWithLocationResult data, response status code and response headers
495
- def image_ocr_photo_words_with_location_with_http_info(image_file, opts = {})
496
- if @api_client.config.debugging
497
- @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_photo_words_with_location ..."
498
- end
499
- # verify the required parameter 'image_file' is set
500
- if @api_client.config.client_side_validation && image_file.nil?
501
- fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_words_with_location"
502
- end
503
- # resource path
504
- local_var_path = "/ocr/photo/to/words-with-location"
505
-
506
- # query parameters
507
- query_params = {}
508
-
509
- # header parameters
510
- header_params = {}
511
- # HTTP header 'Accept' (if needed)
512
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
513
- # HTTP header 'Content-Type'
514
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
515
- header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
516
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
517
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
518
- header_params[:'diagnostics'] = opts[:'diagnostics'] if !opts[:'diagnostics'].nil?
519
-
520
- # form parameters
521
- form_params = {}
522
- form_params["imageFile"] = image_file
523
-
524
- # http body (model)
525
- post_body = nil
526
- auth_names = ['Apikey']
527
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
528
- :header_params => header_params,
529
- :query_params => query_params,
530
- :form_params => form_params,
531
- :body => post_body,
532
- :auth_names => auth_names,
533
- :return_type => 'PhotoToWordsWithLocationResult')
534
- if @api_client.config.debugging
535
- @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_photo_words_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
536
- end
537
- return data, status_code, headers
538
- end
539
-
540
- # Convert a scanned image into text
541
- # Converts an uploaded image in common formats such as JPEG, PNG into text via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
542
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
543
- # @param [Hash] opts the optional parameters
544
- # @option opts [String] :recognition_mode Optional; possible values are &#39;Basic&#39; which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls; &#39;Normal&#39; which provides highly fault tolerant OCR recognition uses 14-16 API calls; and &#39;Advanced&#39; which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is &#39;Advanced&#39;
545
- # @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)
546
- # @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).
547
- # @return [ImageToTextResponse]
548
- def image_ocr_post(image_file, opts = {})
549
- data, _status_code, _headers = image_ocr_post_with_http_info(image_file, opts)
550
- return data
551
- end
552
-
553
- # Convert a scanned image into text
554
- # Converts an uploaded image in common formats such as JPEG, PNG into text via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
555
- # @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
556
- # @param [Hash] opts the optional parameters
557
- # @option opts [String] :recognition_mode Optional; possible values are &#39;Basic&#39; which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls; &#39;Normal&#39; which provides highly fault tolerant OCR recognition uses 14-16 API calls; and &#39;Advanced&#39; which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is &#39;Advanced&#39;
558
- # @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)
559
- # @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).
560
- # @return [Array<(ImageToTextResponse, Fixnum, Hash)>] ImageToTextResponse data, response status code and response headers
561
- def image_ocr_post_with_http_info(image_file, opts = {})
562
- if @api_client.config.debugging
563
- @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_post ..."
564
- end
565
- # verify the required parameter 'image_file' is set
566
- if @api_client.config.client_side_validation && image_file.nil?
567
- fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_post"
568
- end
569
- # resource path
570
- local_var_path = "/ocr/image/toText"
571
-
572
- # query parameters
573
- query_params = {}
574
-
575
- # header parameters
576
- header_params = {}
577
- # HTTP header 'Accept' (if needed)
578
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
579
- # HTTP header 'Content-Type'
580
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
581
- header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
582
- header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
583
- header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
584
-
585
- # form parameters
586
- form_params = {}
587
- form_params["imageFile"] = image_file
588
-
589
- # http body (model)
590
- post_body = nil
591
- auth_names = ['Apikey']
592
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
593
- :header_params => header_params,
594
- :query_params => query_params,
595
- :form_params => form_params,
596
- :body => post_body,
597
- :auth_names => auth_names,
598
- :return_type => 'ImageToTextResponse')
599
- if @api_client.config.debugging
600
- @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
601
- end
602
- return data, status_code, headers
603
- end
604
- end
605
- end