ocr_space 0.2.7.1 → 0.2.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -16
  3. data/lib/ocr_space/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf750bb7ed29514efe3c1893e572e6bef6092b15
4
- data.tar.gz: 1da64cddff8cd276648b7486bf712ca4ccd9c085
3
+ metadata.gz: 418a4dd2032b0e6d684747e1310f26cf1ea4f0e2
4
+ data.tar.gz: 4230853e0240320fdf74bf45c6f45b8f066eb363
5
5
  SHA512:
6
- metadata.gz: 91cae9df5deca49f245e39c2486d7429232468f22601e664b5565bf62000948817c714ba10022637f1e46f9b9e2b9e3aa1ba0a191b6b762ba96139adb5e7a44d
7
- data.tar.gz: 4712b8920749d5197f4032329b01f1561870722f37b1ac6eee672e6fe72012d066d5be82fd3e2bb3d1436291b28fbe02d134cb02e3e20baa0068022f3d4d5d69
6
+ metadata.gz: e8ae23c4f1756ad91dd345c44841c0c7a15047f6db299f2e30e7a15054a95679083572f6e041d87c0b927d801d2f77e0ec3fcbe8a5510f07a6782c86cb9b1c57
7
+ data.tar.gz: 6cf0b851adcee3ac73f7130e213815a258097728af9792bddb078a2b1dcdf419bfc1b67750a945a38a5146acd360f82bb6ec2af63e142074813b9977aca5b23b
data/README.md CHANGED
@@ -28,18 +28,19 @@ Hosted at [rubygems.org](https://rubygems.org/gems/ocr_space)
28
28
 
29
29
  #To convert images from url
30
30
 
31
+ ![Nicola Tesla](http://bit.ly/2ih9aXt)
32
+
31
33
  ```ruby
32
34
  require 'ocr_space'
33
35
 
34
- result = OcrSpace::FromUrl.new(apikey: "YOUR API KEY", url: "http://i.stack.imgur.com/vrkIj.png")
35
-
36
- puts result #Raw result
36
+ result = OcrSpace::FromUrl.new(apikey: "YOUR API KEY", url: "http://bit.ly/2ih9aXt")
37
37
 
38
- => #<OcrSpace::FromUrl:0x007ff524394128 @data=#<HTTParty::Response:0x7ff52433fc68 parsed_response={"ParsedResults"=>[{"TextOverlay"=>{"Lines"=>[], "HasOverlay"=>false, "Message"=>"Text overlay is not provided as it is not requested"}, "FileParseExitCode"=>1, "ParsedText"=>"I am curious about \r\narea-filling text \r\nrendering options \r\n", "ErrorMessage"=>"", "ErrorDetails"=>""}], "OCRExitCode"=>1, "IsErroredOnProcessing"=>false, "ErrorMessage"=>nil, "ErrorDetails"=>nil, "ProcessingTimeInMilliseconds"=>"325"}, @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"cache-control"=>["no-cache"], "pragma"=>["no-cache"], "content-length"=>["395"], "content-type"=>["application/json; charset=utf-8"], "expires"=>["-1"], "server"=>["Microsoft-IIS/10.0"], "x-aspnet-version"=>["4.0.30319"], "x-powered-by"=>["ASP.NET"], "date"=>["Fri, 02 Dec 2016 04:09:45 GMT"], "connection"=>["close"]}>>
38
+ p result
39
+ => #<OcrSpace::FromUrl:0x007ff5ce404748 @data=#<HTTParty::Response:0x7ff5ce3efcf8 parsed_response={"ParsedResults"=>[{"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"=>""}], "OCRExitCode"=>1, "IsErroredOnProcessing"=>false, "ErrorMessage"=>nil, "ErrorDetails"=>nil, "ProcessingTimeInMilliseconds"=>"345"}, @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"cache-control"=>["no-cache"], "pragma"=>["no-cache"], "content-length"=>["454"], "content-type"=>["application/json; charset=utf-8"], "expires"=>["-1"], "server"=>["Microsoft-IIS/10.0"], "x-aspnet-version"=>["4.0.30319"], "x-powered-by"=>["ASP.NET"], "date"=>["Sun, 25 Dec 2016 22:18:22 GMT"], "connection"=>["close"]}>>
39
40
 
40
- puts result.text_data #Clean result
41
+ p result.text_data #Clean result
41
42
 
42
- => "I am curious about \r\narea-filling text \r\nrendering options \r\n"
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"
43
44
  ```
44
45
 
45
46
  #To convert images from file upload
@@ -47,25 +48,27 @@ puts result.text_data #Clean result
47
48
  ```ruby
48
49
  require 'ocr_space'
49
50
 
50
- result = OcrSpace::FromFile.new(apikey: "YOUR API KEY", files: "./vrkIj.png")
51
+ result = OcrSpace::FromFile.new(apikey: "YOUR API KEY", files: "./nicola_tesla.jpg")
51
52
 
52
- puts result #Raw result
53
+ p result #Raw result
53
54
 
54
- => #<OcrSpace::FromUrl:0x007ff524394128 @data=#<HTTParty::Response:0x7ff52433fc68 parsed_response={"ParsedResults"=>[{"TextOverlay"=>{"Lines"=>[], "HasOverlay"=>false, "Message"=>"Text overlay is not provided as it is not requested"}, "FileParseExitCode"=>1, "ParsedText"=>"I am curious about \r\narea-filling text \r\nrendering options \r\n", "ErrorMessage"=>"", "ErrorDetails"=>""}], "OCRExitCode"=>1, "IsErroredOnProcessing"=>false, "ErrorMessage"=>nil, "ErrorDetails"=>nil, "ProcessingTimeInMilliseconds"=>"325"}, @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"cache-control"=>["no-cache"], "pragma"=>["no-cache"], "content-length"=>["395"], "content-type"=>["application/json; charset=utf-8"], "expires"=>["-1"], "server"=>["Microsoft-IIS/10.0"], "x-aspnet-version"=>["4.0.30319"], "x-powered-by"=>["ASP.NET"], "date"=>["Fri, 02 Dec 2016 04:09:45 GMT"], "connection"=>["close"]}>>
55
+ => #<OcrSpace::FromFile:0x007ff5ce3ae668 @file=#<File:./nicola_tesla.jpg>, @data=#<HTTParty::Response:0x7ff5ce2c41f8 parsed_response={"ParsedResults"=>[{"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"=>""}], "OCRExitCode"=>1, "IsErroredOnProcessing"=>false, "ErrorMessage"=>nil, "ErrorDetails"=>nil, "ProcessingTimeInMilliseconds"=>"311"}, @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"cache-control"=>["no-cache"], "pragma"=>["no-cache"], "content-length"=>["454"], "content-type"=>["application/json; charset=utf-8"], "expires"=>["-1"], "server"=>["Microsoft-IIS/10.0"], "x-aspnet-version"=>["4.0.30319"], "x-powered-by"=>["ASP.NET"], "date"=>["Sun, 25 Dec 2016 22:21:10 GMT"], "connection"=>["close"]}>>
55
56
 
56
- puts result.text_data #Clean result
57
+ p result.text_data #Clean result
58
+
59
+ => "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"
57
60
 
58
- => "I am curious about \r\narea-filling text \r\nrendering options \r\n"
59
61
  ```
60
62
 
61
63
  #COMMAND LINE INTERFACE ***BONUS***
62
64
 
63
- You can run ocr_space through shell to get quick result from a image in a folder
65
+ You can run ocr_space through shell to get quick result from a image using filepath
64
66
 
65
67
  ```
66
- $ ocrspace vrkIj.png
68
+ $ ocrspace home/suyesh/nicola_tesla.jpg
69
+
70
+ $ "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"
67
71
 
68
- $ "I am curious about \r\narea-filling text \r\nrendering options \r\n"
69
72
  ```
70
73
  #NOTE
71
74
  For commandline interface to work you will have to set ENV variable 'ocr_api_key' to your apikey.
@@ -76,9 +79,9 @@ $ export ocr_api_key='YOUR API KEY'
76
79
  Also if you set env variable then you don't need to include apikey in your ruby scripts. You can just do the following -
77
80
 
78
81
  ```ruby
79
- result = OcrSpace::FromFile.new(files: "./vrkIj.png") #for File based
82
+ result = OcrSpace::FromFile.new(files: "./nicola_tesla.jpg") #for File based
80
83
 
81
- result = OcrSpace::FromUrl.new(url: "http://i.stack.imgur.com/vrkIj.png") #for URL based
84
+ result = OcrSpace::FromUrl.new(url: "http://bit.ly/2ih9aXt") #for URL based
82
85
 
83
86
  ```
84
87
 
@@ -1,3 +1,3 @@
1
1
  module OcrSpace
2
- VERSION = '0.2.7.1'.freeze
2
+ VERSION = '0.2.7.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocr_space
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7.1
4
+ version: 0.2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suyesh Bhandari