ocr_space 0.1.6 → 0.1.7

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 +25 -11
  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: adf78804d8f86f505cbb85d628bacfa2d7e88252
4
- data.tar.gz: 21b34b2138b6c64977fdc83b198f7078f8f75c60
3
+ metadata.gz: 1f6795e9e74c8510d49328e553f4dcfc8fc0f4b2
4
+ data.tar.gz: 7366a045e749a4888da6f17795840b3bc6cb8afb
5
5
  SHA512:
6
- metadata.gz: e6c7af9d1ece5be97c5dcf81dfb4e2a367b9897d5fe14250be64f858b2622fe2c80ac9f6f966694f1a41104fe6e999bdcea9b7c1b1c80044017ea7c7878af1d4
7
- data.tar.gz: fe9e96e64e427848074f2d13b8a5f9350a372acdd95d52f499d9d42b6d2e9ebccd197b7b2e0635b64fa9cc23b8665bd8259c7ad098f26c256211c15bff219cb6
6
+ metadata.gz: 9b92600826d2cca098b935db8547e95f16b600df7ad80a674779712618657944762c90fe4bba70fe4a5df5c4d0cb85c3b296bdc8d977a2054c01fac888b2aa3e
7
+ data.tar.gz: 7800aa23f058c12e59ff9469ae248e79ac4c10f0958a55fe8459fa0ce1c3b16cb954e5285b192cd2edc29df62a50148f55a9664f677902b9f3070ff147baff9e
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ![OCR.SPACE](https://ocr.space/Content/Images/ocr.space.logo.png)
2
-
2
+ [![Gem Version](https://badge.fury.io/rb/ocr_space.svg)](https://badge.fury.io/rb/ocr_space)
3
3
  # OcrSpace
4
4
 
5
5
  Simple API wrapper for [OCR.Space](https://ocr.space), A awesome Free api for converting images to text.
@@ -25,7 +25,7 @@ Or install it yourself as:
25
25
  #To convert images from url
26
26
 
27
27
  ```ruby
28
- result = OcrSpace::FromUrl.new(apikey: "YOUR API KEY", url: "Image url")
28
+ result = OcrSpace::FromUrl.new(apikey: "YOUR API KEY", url: "http://i.stack.imgur.com/vrkIj.png")
29
29
 
30
30
  puts result #Raw result
31
31
 
@@ -39,8 +39,29 @@ puts result.text_data #Clean result
39
39
  #To convert images from file upload
40
40
 
41
41
  ```ruby
42
- result = OcrSpace::FromFile.new(apikey: "YOUR API KEY", files: "Path to file")
42
+ result = OcrSpace::FromFile.new(apikey: "YOUR API KEY", files: "./vrkIj.png")
43
+
44
+ puts result #Raw result
45
+
46
+ => #<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"]}>>
47
+
48
+ puts result.text_data #Clean result
49
+
50
+ => "I am curious about \r\narea-filling text \r\nrendering options \r\n"
51
+ ```
52
+
53
+ #COMMAND LINE INTERFACE ***BONUS***
54
+
55
+ You can run ocr_space through shell to get quick result from a image in a folder
56
+
43
57
  ```
58
+ $ ocrspace vrkIj.png
59
+
60
+ $ "I am curious about \r\narea-filling text \r\nrendering options \r\n"
61
+ ```
62
+ #NOTE
63
+ For commandline interface to work you will have to set ENV variable 'ocr_api_key' to your apikey.
64
+
44
65
  #Optional
45
66
 
46
67
  You can also pass in Optional attributes
@@ -48,17 +69,10 @@ You can also pass in Optional attributes
48
69
  ```ruby
49
70
 
50
71
  isOverlayRequired:
51
- [#Optional] Default = False Allows you to specify if the image/pdf text overlay is required. Overlay could be #used to show the text over the image
72
+ #[Optional] Default = False Allows you to specify if the image/pdf text overlay is required. Overlay could be #used to show the text over the image
52
73
 
53
74
  language:
54
75
 
55
76
  #Czech = ce; Danish = dan; Dutch = dut; English = eng; Finnish = fin; French = fre; German = ger;Hungarian=hun;
56
77
  #Italian = ita; Norwegian = nor; Polish = pol; Portuguese = por; Spanish = spa; Swedish = swe; #ChineseSimplified = chs; Greek = gre; Japanese = jpn; Russian = rus; Turkish = tur; ChineseTraditional = cht; #Korean = kor
57
78
  ```
58
- #COMMAND LINE INTERFACE ***BONUS***
59
-
60
- You can run ocr_space through shell to get quick result from a image in a folder
61
-
62
- ```
63
- $ ocrspace hello.png
64
- ```
@@ -1,3 +1,3 @@
1
1
  module OcrSpace
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
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.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suyesh Bhandari