ocr_space 2.2 → 2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/ocrspace +1 -1
- data/lib/ocr_space/convert.rb +1 -3
- data/lib/ocr_space/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e31b740fda80d7e435633b181664abe00d52f1c4
|
4
|
+
data.tar.gz: 323033e289f5a106c645417d24e20aa3a3137923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd9421f6a23988bcd48ce5b2f166ad0c6ace824bc71f1ee1c049f78b9489aadbcc861b3ec4ebdf708c0d1a36f0f637f336194bbcea869e550e3a67720e828692
|
7
|
+
data.tar.gz: 6be0bf1464ac989bdab39765c866d205d3e56e1e3be1750c04e28b907b5d563231f929fa0d010bb5365634a9e1a66b4961a677e67a1924007ad1deca7d69516d
|
data/exe/ocrspace
CHANGED
data/lib/ocr_space/convert.rb
CHANGED
@@ -2,7 +2,7 @@ require 'ocr_space/file_post'
|
|
2
2
|
|
3
3
|
module OcrSpace
|
4
4
|
module Convert
|
5
|
-
def convert(apikey: @api_key, language: 'eng', isOverlayRequired: false, file: nil, url: nil
|
5
|
+
def convert(apikey: @api_key, language: 'eng', isOverlayRequired: false, file: nil, url: nil)
|
6
6
|
if file
|
7
7
|
@files = File.new(file)
|
8
8
|
@data = OcrSpace::FilePost.post('/parse/image',
|
@@ -11,7 +11,6 @@ module OcrSpace
|
|
11
11
|
isOverlayRequired: isOverlayRequired,
|
12
12
|
file: @files })
|
13
13
|
@data = @data.parsed_response['ParsedResults']
|
14
|
-
clean_result == true ? @data[0]['ParsedText'].delete("\n").delete("\r").strip : @data = @data.parsed_response['ParsedResults']
|
15
14
|
elsif url
|
16
15
|
@data = HTTParty.post('https://api.ocr.space/parse/image',
|
17
16
|
body: { apikey: apikey,
|
@@ -19,7 +18,6 @@ module OcrSpace
|
|
19
18
|
isOverlayRequired: isOverlayRequired,
|
20
19
|
url: url })
|
21
20
|
@data = @data.parsed_response['ParsedResults']
|
22
|
-
clean_result == true ? @data[0]['ParsedText'].delete("\n").delete("\r").strip : @data = @data.parsed_response['ParsedResults']
|
23
21
|
else
|
24
22
|
"You need to Pass either file or url."
|
25
23
|
end
|
data/lib/ocr_space/version.rb
CHANGED