cloudmersive-ocr-api-client 1.3.4 → 1.3.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 +9 -5
- data/cloudmersive-ocr-api-client.gemspec +1 -1
- data/docs/GetPageAngleResult.md +9 -0
- data/docs/ImageOcrApi.md +3 -1
- data/docs/PreprocessingApi.md +114 -4
- data/docs/ReceiptsApi.md +63 -0
- data/lib/cloudmersive-ocr-api-client.rb +3 -1
- data/lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb +4 -1
- data/lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/api/preprocessing_api.rb +117 -5
- data/lib/cloudmersive-ocr-api-client/api/receipts_api.rb +79 -0
- data/lib/cloudmersive-ocr-api-client/api_client.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/api_error.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/configuration.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/get_page_angle_result.rb +199 -0
- data/lib/cloudmersive-ocr-api-client/models/image_to_lines_with_location_result.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/image_to_text_response.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/image_to_words_with_location_result.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/ocr_line_element.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/ocr_page_result.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_lines_with_location.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_words_with_location.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/ocr_photo_text_element.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/ocr_word_element.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/pdf_to_lines_with_location_result.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/pdf_to_text_response.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/pdf_to_words_with_location_result.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/models/photo_to_words_with_location_result.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/version.rb +2 -2
- data/spec/api/image_ocr_api_spec.rb +2 -1
- data/spec/api/pdf_ocr_api_spec.rb +1 -1
- data/spec/api/preprocessing_api_spec.rb +27 -3
- data/spec/api/receipts_api_spec.rb +47 -0
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/get_page_angle_result_spec.rb +48 -0
- data/spec/models/image_to_lines_with_location_result_spec.rb +1 -1
- data/spec/models/image_to_text_response_spec.rb +1 -1
- data/spec/models/image_to_words_with_location_result_spec.rb +1 -1
- data/spec/models/ocr_line_element_spec.rb +1 -1
- data/spec/models/ocr_page_result_spec.rb +1 -1
- data/spec/models/ocr_page_result_with_lines_with_location_spec.rb +1 -1
- data/spec/models/ocr_page_result_with_words_with_location_spec.rb +1 -1
- data/spec/models/ocr_photo_text_element_spec.rb +1 -1
- data/spec/models/ocr_word_element_spec.rb +1 -1
- data/spec/models/pdf_to_lines_with_location_result_spec.rb +1 -1
- data/spec/models/pdf_to_text_response_spec.rb +1 -1
- data/spec/models/pdf_to_words_with_location_result_spec.rb +1 -1
- data/spec/models/photo_to_words_with_location_result_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +22 -15
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version:
|
9
|
+
Swagger Codegen version: unset
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -79,6 +79,7 @@ describe 'ImageOcrApi' do
|
|
79
79
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
80
80
|
# @param [Hash] opts the optional parameters
|
81
81
|
# @option opts [String] :language Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
|
82
|
+
# @option opts [String] :preprocessing Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
|
82
83
|
# @return [PhotoToWordsWithLocationResult]
|
83
84
|
describe 'image_ocr_photo_words_with_location test' do
|
84
85
|
it "should work" do
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version:
|
9
|
+
Swagger Codegen version: unset
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -33,8 +33,8 @@ describe 'PreprocessingApi' do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
# unit tests for preprocessing_binarize
|
36
|
-
# Convert an image of text into a
|
37
|
-
# Perform an
|
36
|
+
# Convert an image of text into a binarized (light and dark) view
|
37
|
+
# Perform an adaptive binarization algorithm on the input image to prepare it for further OCR operations.
|
38
38
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
40
|
# @return [Object]
|
@@ -44,6 +44,30 @@ describe 'PreprocessingApi' do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
# unit tests for preprocessing_binarize_advanced
|
48
|
+
# Convert an image of text into a binary (light and dark) view with ML
|
49
|
+
# Perform an advanced adaptive, Deep Learning-based binarization algorithm on the input image to prepare it for further OCR operations. Provides enhanced accuracy than adaptive binarization. Image will be upsampled to 300 DPI if it has a DPI below 300.
|
50
|
+
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [Object]
|
53
|
+
describe 'preprocessing_binarize_advanced test' do
|
54
|
+
it "should work" do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# unit tests for preprocessing_get_page_angle
|
60
|
+
# Get the angle of the page / document / receipt
|
61
|
+
# Analyzes a photo or image of a document and identifies the rotation angle of the page.
|
62
|
+
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
63
|
+
# @param [Hash] opts the optional parameters
|
64
|
+
# @return [GetPageAngleResult]
|
65
|
+
describe 'preprocessing_get_page_angle test' do
|
66
|
+
it "should work" do
|
67
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
47
71
|
# unit tests for preprocessing_unrotate
|
48
72
|
# Detect and unrotate a document image
|
49
73
|
# Detect and unrotate an image of a document (e.g. that was scanned at an angle). Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
|
@@ -0,0 +1,47 @@
|
|
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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for CloudmersiveOcrApiClient::ReceiptsApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'ReceiptsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = CloudmersiveOcrApiClient::ReceiptsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of ReceiptsApi' do
|
30
|
+
it 'should create an instance of ReceiptsApi' do
|
31
|
+
expect(@instance).to be_instance_of(CloudmersiveOcrApiClient::ReceiptsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for receipts_photo_to_csv
|
36
|
+
# Convert a photo of a receipt into a CSV file containing structured information from the receipt
|
37
|
+
# Leverage Deep Learning to automatically turn a photo of a receipt into a CSV file containing the structured information from the receipt.
|
38
|
+
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [Object]
|
41
|
+
describe 'receipts_photo_to_csv test' do
|
42
|
+
it "should work" do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
data/spec/api_client_spec.rb
CHANGED
data/spec/configuration_spec.rb
CHANGED
@@ -0,0 +1,48 @@
|
|
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: unset
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for CloudmersiveOcrApiClient::GetPageAngleResult
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'GetPageAngleResult' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveOcrApiClient::GetPageAngleResult.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of GetPageAngleResult' do
|
31
|
+
it 'should create an instance of GetPageAngleResult' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveOcrApiClient::GetPageAngleResult)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "successful"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "angle"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudmersive-ocr-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.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-06
|
11
|
+
date: 2019-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -34,42 +34,42 @@ dependencies:
|
|
34
34
|
name: json
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ">="
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: 2.1.0
|
40
37
|
- - "~>"
|
41
38
|
- !ruby/object:Gem::Version
|
42
39
|
version: '2.1'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.1.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 2.1.0
|
50
47
|
- - "~>"
|
51
48
|
- !ruby/object:Gem::Version
|
52
49
|
version: '2.1'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.1.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: rspec
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: 3.6.0
|
60
57
|
- - "~>"
|
61
58
|
- !ruby/object:Gem::Version
|
62
59
|
version: '3.6'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 3.6.0
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 3.6.0
|
70
67
|
- - "~>"
|
71
68
|
- !ruby/object:Gem::Version
|
72
69
|
version: '3.6'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 3.6.0
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: vcr
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- "./README.md"
|
202
202
|
- "./Rakefile"
|
203
203
|
- "./cloudmersive-ocr-api-client.gemspec"
|
204
|
+
- "./docs/GetPageAngleResult.md"
|
204
205
|
- "./docs/ImageOcrApi.md"
|
205
206
|
- "./docs/ImageToLinesWithLocationResult.md"
|
206
207
|
- "./docs/ImageToTextResponse.md"
|
@@ -217,14 +218,17 @@ files:
|
|
217
218
|
- "./docs/PdfToWordsWithLocationResult.md"
|
218
219
|
- "./docs/PhotoToWordsWithLocationResult.md"
|
219
220
|
- "./docs/PreprocessingApi.md"
|
221
|
+
- "./docs/ReceiptsApi.md"
|
220
222
|
- "./git_push.sh"
|
221
223
|
- "./lib/cloudmersive-ocr-api-client.rb"
|
222
224
|
- "./lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb"
|
223
225
|
- "./lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb"
|
224
226
|
- "./lib/cloudmersive-ocr-api-client/api/preprocessing_api.rb"
|
227
|
+
- "./lib/cloudmersive-ocr-api-client/api/receipts_api.rb"
|
225
228
|
- "./lib/cloudmersive-ocr-api-client/api_client.rb"
|
226
229
|
- "./lib/cloudmersive-ocr-api-client/api_error.rb"
|
227
230
|
- "./lib/cloudmersive-ocr-api-client/configuration.rb"
|
231
|
+
- "./lib/cloudmersive-ocr-api-client/models/get_page_angle_result.rb"
|
228
232
|
- "./lib/cloudmersive-ocr-api-client/models/image_to_lines_with_location_result.rb"
|
229
233
|
- "./lib/cloudmersive-ocr-api-client/models/image_to_text_response.rb"
|
230
234
|
- "./lib/cloudmersive-ocr-api-client/models/image_to_words_with_location_result.rb"
|
@@ -242,8 +246,10 @@ files:
|
|
242
246
|
- "./spec/api/image_ocr_api_spec.rb"
|
243
247
|
- "./spec/api/pdf_ocr_api_spec.rb"
|
244
248
|
- "./spec/api/preprocessing_api_spec.rb"
|
249
|
+
- "./spec/api/receipts_api_spec.rb"
|
245
250
|
- "./spec/api_client_spec.rb"
|
246
251
|
- "./spec/configuration_spec.rb"
|
252
|
+
- "./spec/models/get_page_angle_result_spec.rb"
|
247
253
|
- "./spec/models/image_to_lines_with_location_result_spec.rb"
|
248
254
|
- "./spec/models/image_to_text_response_spec.rb"
|
249
255
|
- "./spec/models/image_to_words_with_location_result_spec.rb"
|
@@ -277,7 +283,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
277
283
|
- !ruby/object:Gem::Version
|
278
284
|
version: '0'
|
279
285
|
requirements: []
|
280
|
-
|
286
|
+
rubyforge_project:
|
287
|
+
rubygems_version: 2.7.6
|
281
288
|
signing_key:
|
282
289
|
specification_version: 4
|
283
290
|
summary: Convert scanned documents and images to text.
|