ocr_space 0.2.7.3 → 0.2.8.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 +9 -8
- data/lib/ocr_space/from_file.rb +2 -1
- data/lib/ocr_space/from_url.rb +2 -1
- data/lib/ocr_space/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d307c51a47c8d24a8841dc7fb91c69e6ded50b08
|
4
|
+
data.tar.gz: 818ce81415b49d521f39617722d3c3d3ca8320f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90d9e1af8655d9cf1fda95bcc93b28b8e265a89001ddce07dd839c340c6c1c991046f9686fa01a7f78e08cafb9130c3b8eda1926282c198c7ef95b596d7cf12a
|
7
|
+
data.tar.gz: 9d84440183c42e822636245b628aa7cfba365e00d45dceb394af5f6fb5e229c898b1b024e0a3a867b3b54d10566b593c2e8a8383927e64357dacf09e53bc3db0
|
data/README.md
CHANGED
@@ -35,12 +35,13 @@ require 'ocr_space'
|
|
35
35
|
|
36
36
|
result = OcrSpace::FromUrl.new(apikey: "YOUR API KEY", url: "http://bit.ly/2ih9aXt")
|
37
37
|
|
38
|
-
|
39
|
-
=>
|
38
|
+
puts result.data
|
39
|
+
=> #[{"TextOverlay"=>{"Lines"=>[], "HasOverlay"=>false, "Message"=>"Text overlay is not provided as it is not requested"}, "FileParseExitCode"=>1, "ParsedText"=>"If you want to find the secrets of the \r\nuniverse, think in terms of energy, \r\nfrequency and vibration. \r\nAZ QUOTES \r\n", "ErrorMessage"=>"", "ErrorDetails"=>""}]
|
40
40
|
|
41
|
-
|
41
|
+
puts result.text_data #Clean result
|
42
|
+
|
43
|
+
=> "If you want to find the secrets of the universe, think in terms of energy, frequency and vibration. AZ QUOTES"
|
42
44
|
|
43
|
-
=> "If you want to find the secrets of the \r\nuniverse, think in terms of energy, \r\nfrequency and vibration. \r\nAZ QUOTES \r\n"
|
44
45
|
```
|
45
46
|
|
46
47
|
#To convert images from file upload
|
@@ -50,13 +51,13 @@ require 'ocr_space'
|
|
50
51
|
|
51
52
|
result = OcrSpace::FromFile.new(apikey: "YOUR API KEY", files: "./nicola_tesla.jpg")
|
52
53
|
|
53
|
-
|
54
|
+
puts result.data #Raw result
|
54
55
|
|
55
|
-
=>
|
56
|
+
=> #{"TextOverlay"=>{"Lines"=>[], "HasOverlay"=>false, "Message"=>"Text overlay is not provided as it is not requested"}, "FileParseExitCode"=>1, "ParsedText"=>"If you want to find the secrets of the \r\nuniverse, think in terms of energy, \r\nfrequency and vibration. \r\nAZ QUOTES \r\n", "ErrorMessage"=>"", "ErrorDetails"=>""}
|
56
57
|
|
57
|
-
|
58
|
+
puts result.text_data #Clean result
|
58
59
|
|
59
|
-
=> "If you want to find the secrets of the
|
60
|
+
=> "If you want to find the secrets of the universe, think in terms of energy, frequency and vibration. AZ QUOTES"
|
60
61
|
|
61
62
|
```
|
62
63
|
|
data/lib/ocr_space/from_file.rb
CHANGED
@@ -11,10 +11,11 @@ module OcrSpace
|
|
11
11
|
language: language,
|
12
12
|
isOverlayRequired: isOverlayRequired,
|
13
13
|
files: @file })
|
14
|
+
@data = @data.parsed_response['ParsedResults']
|
14
15
|
end
|
15
16
|
|
16
17
|
def text_data
|
17
|
-
data
|
18
|
+
data[0]['ParsedText'].delete("\n").delete("\r").strip
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
data/lib/ocr_space/from_url.rb
CHANGED
@@ -9,10 +9,11 @@ module OcrSpace
|
|
9
9
|
language: language,
|
10
10
|
isOverlayRequired: isOverlayRequired,
|
11
11
|
url: url })
|
12
|
+
@data = @data.parsed_response['ParsedResults']
|
12
13
|
end
|
13
14
|
|
14
15
|
def text_data
|
15
|
-
data
|
16
|
+
data[0]['ParsedText'].delete("\n").delete("\r").strip
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
data/lib/ocr_space/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocr_space
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Suyesh Bhandari
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|