cloudmersive-ocr-api-client 1.2.9 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -7
- data/docs/ImageOcrApi.md +118 -0
- data/docs/ImageToLinesWithLocationResult.md +9 -0
- data/docs/ImageToWordsWithLocationResult.md +9 -0
- data/docs/OcrLineElement.md +9 -0
- data/docs/OcrWordElement.md +18 -0
- data/lib/cloudmersive-ocr-api-client.rb +4 -0
- data/lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb +118 -0
- data/lib/cloudmersive-ocr-api-client/models/image_to_lines_with_location_result.rb +200 -0
- data/lib/cloudmersive-ocr-api-client/models/image_to_words_with_location_result.rb +199 -0
- data/lib/cloudmersive-ocr-api-client/models/ocr_line_element.rb +201 -0
- data/lib/cloudmersive-ocr-api-client/models/ocr_word_element.rb +289 -0
- data/lib/cloudmersive-ocr-api-client/version.rb +1 -1
- data/spec/api/image_ocr_api_spec.rb +26 -0
- data/spec/models/image_to_lines_with_location_result_spec.rb +48 -0
- data/spec/models/image_to_words_with_location_result_spec.rb +48 -0
- data/spec/models/ocr_line_element_spec.rb +48 -0
- data/spec/models/ocr_word_element_spec.rb +102 -0
- metadata +14 -2
@@ -32,6 +32,32 @@ describe 'ImageOcrApi' do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
# unit tests for image_ocr_image_lines_with_location
|
36
|
+
# Convert a scanned image into words with location
|
37
|
+
# 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.
|
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
|
+
# @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)
|
41
|
+
# @return [ImageToLinesWithLocationResult]
|
42
|
+
describe 'image_ocr_image_lines_with_location test' do
|
43
|
+
it "should work" do
|
44
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# unit tests for image_ocr_image_words_with_location
|
49
|
+
# Convert a scanned image into words with location
|
50
|
+
# 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.
|
51
|
+
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
52
|
+
# @param [Hash] opts the optional parameters
|
53
|
+
# @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)
|
54
|
+
# @return [ImageToWordsWithLocationResult]
|
55
|
+
describe 'image_ocr_image_words_with_location test' do
|
56
|
+
it "should work" do
|
57
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
35
61
|
# unit tests for image_ocr_photo_to_text
|
36
62
|
# Convert a photo of a document into text
|
37
63
|
# 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.
|
@@ -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::ImageToLinesWithLocationResult
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'ImageToLinesWithLocationResult' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveOcrApiClient::ImageToLinesWithLocationResult.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of ImageToLinesWithLocationResult' do
|
31
|
+
it 'should create an instance of ImageToLinesWithLocationResult' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveOcrApiClient::ImageToLinesWithLocationResult)
|
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 "lines"' 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
|
+
|
@@ -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::ImageToWordsWithLocationResult
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'ImageToWordsWithLocationResult' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveOcrApiClient::ImageToWordsWithLocationResult.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of ImageToWordsWithLocationResult' do
|
31
|
+
it 'should create an instance of ImageToWordsWithLocationResult' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveOcrApiClient::ImageToWordsWithLocationResult)
|
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 "words"' 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
|
+
|
@@ -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::OcrLineElement
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'OcrLineElement' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveOcrApiClient::OcrLineElement.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of OcrLineElement' do
|
31
|
+
it 'should create an instance of OcrLineElement' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveOcrApiClient::OcrLineElement)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "line_text"' 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 "words"' 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
|
+
|
@@ -0,0 +1,102 @@
|
|
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::OcrWordElement
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'OcrWordElement' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = CloudmersiveOcrApiClient::OcrWordElement.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of OcrWordElement' do
|
31
|
+
it 'should create an instance of OcrWordElement' do
|
32
|
+
expect(@instance).to be_instance_of(CloudmersiveOcrApiClient::OcrWordElement)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "word_text"' 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 "line_number"' 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
|
+
describe 'test attribute "word_number"' do
|
48
|
+
it 'should work' do
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe 'test attribute "x_left"' 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
|
+
describe 'test attribute "y_top"' do
|
60
|
+
it 'should work' do
|
61
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe 'test attribute "width"' 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
|
+
|
71
|
+
describe 'test attribute "height"' do
|
72
|
+
it 'should work' do
|
73
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe 'test attribute "confidence_level"' do
|
78
|
+
it 'should work' do
|
79
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe 'test attribute "block_number"' do
|
84
|
+
it 'should work' do
|
85
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe 'test attribute "paragraph_number"' do
|
90
|
+
it 'should work' do
|
91
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe 'test attribute "page_number"' do
|
96
|
+
it 'should work' do
|
97
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudmersive-ocr-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloudmersive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -202,8 +202,12 @@ files:
|
|
202
202
|
- "./Rakefile"
|
203
203
|
- "./cloudmersive-ocr-api-client.gemspec"
|
204
204
|
- "./docs/ImageOcrApi.md"
|
205
|
+
- "./docs/ImageToLinesWithLocationResult.md"
|
205
206
|
- "./docs/ImageToTextResponse.md"
|
207
|
+
- "./docs/ImageToWordsWithLocationResult.md"
|
208
|
+
- "./docs/OcrLineElement.md"
|
206
209
|
- "./docs/OcrPageResult.md"
|
210
|
+
- "./docs/OcrWordElement.md"
|
207
211
|
- "./docs/PdfOcrApi.md"
|
208
212
|
- "./docs/PdfToTextResponse.md"
|
209
213
|
- "./docs/PreprocessingApi.md"
|
@@ -215,8 +219,12 @@ files:
|
|
215
219
|
- "./lib/cloudmersive-ocr-api-client/api_client.rb"
|
216
220
|
- "./lib/cloudmersive-ocr-api-client/api_error.rb"
|
217
221
|
- "./lib/cloudmersive-ocr-api-client/configuration.rb"
|
222
|
+
- "./lib/cloudmersive-ocr-api-client/models/image_to_lines_with_location_result.rb"
|
218
223
|
- "./lib/cloudmersive-ocr-api-client/models/image_to_text_response.rb"
|
224
|
+
- "./lib/cloudmersive-ocr-api-client/models/image_to_words_with_location_result.rb"
|
225
|
+
- "./lib/cloudmersive-ocr-api-client/models/ocr_line_element.rb"
|
219
226
|
- "./lib/cloudmersive-ocr-api-client/models/ocr_page_result.rb"
|
227
|
+
- "./lib/cloudmersive-ocr-api-client/models/ocr_word_element.rb"
|
220
228
|
- "./lib/cloudmersive-ocr-api-client/models/pdf_to_text_response.rb"
|
221
229
|
- "./lib/cloudmersive-ocr-api-client/version.rb"
|
222
230
|
- "./spec/api/image_ocr_api_spec.rb"
|
@@ -224,8 +232,12 @@ files:
|
|
224
232
|
- "./spec/api/preprocessing_api_spec.rb"
|
225
233
|
- "./spec/api_client_spec.rb"
|
226
234
|
- "./spec/configuration_spec.rb"
|
235
|
+
- "./spec/models/image_to_lines_with_location_result_spec.rb"
|
227
236
|
- "./spec/models/image_to_text_response_spec.rb"
|
237
|
+
- "./spec/models/image_to_words_with_location_result_spec.rb"
|
238
|
+
- "./spec/models/ocr_line_element_spec.rb"
|
228
239
|
- "./spec/models/ocr_page_result_spec.rb"
|
240
|
+
- "./spec/models/ocr_word_element_spec.rb"
|
229
241
|
- "./spec/models/pdf_to_text_response_spec.rb"
|
230
242
|
- "./spec/spec_helper.rb"
|
231
243
|
homepage: https://www.cloudmersive.com/ocr-api
|