ocr_space 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +25 -11
- 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: 1f6795e9e74c8510d49328e553f4dcfc8fc0f4b2
|
4
|
+
data.tar.gz: 7366a045e749a4888da6f17795840b3bc6cb8afb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b92600826d2cca098b935db8547e95f16b600df7ad80a674779712618657944762c90fe4bba70fe4a5df5c4d0cb85c3b296bdc8d977a2054c01fac888b2aa3e
|
7
|
+
data.tar.gz: 7800aa23f058c12e59ff9469ae248e79ac4c10f0958a55fe8459fa0ce1c3b16cb954e5285b192cd2edc29df62a50148f55a9664f677902b9f3070ff147baff9e
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|

|
2
|
-
|
2
|
+
[](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: "
|
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: "
|
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
|
-
[
|
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
|
-
```
|
data/lib/ocr_space/version.rb
CHANGED