ocr_space 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77e73f89b2089b3554dc13b05f7515a80b283dc7
4
- data.tar.gz: d9fe7ca0e38d9078e66ded1d201c533802fb512b
3
+ metadata.gz: 962b3d391926a5a1f282811823e69ecd968f6f48
4
+ data.tar.gz: c693a622879ec79439822e63eeb324ee67247f77
5
5
  SHA512:
6
- metadata.gz: '09c0b9a262a8ccde04f5589ffabb15bbbd7451d3704cc3d08546f0d0f862775f1e07697f2852eb1c53faff3e152315291acad64f1463a79d5d8806edc2224d7b'
7
- data.tar.gz: 2ac33e9e4c25d02bab2d1c2cf4904f83062223a4c6eb30a07ec4f447b50c639366b04cf60b92c28395817d24c0a241b826a9c8a4261132b2632faabf013641b8
6
+ metadata.gz: dd89b5a9765ae51f1ef70ba61601249a478c490dfe36979e5ebb19ebdd8b148609960cb635fac1fdea2d78644e9c7eed10a10454f64c63ed3e16ba2c58e6beaf
7
+ data.tar.gz: 8ec39b07146935ea50311b482b53a2f34bf49a6d11e1d592e67e3ca73e5c79ce0846421aca77f51f4cc6e6489842bb409c87787fb019dbfa0e2a8b7351607dfe
data/README.md CHANGED
@@ -29,6 +29,8 @@ Hosted at [rubygems.org](https://rubygems.org/gems/ocr_space)
29
29
  #To convert images from url
30
30
 
31
31
  ```ruby
32
+ require 'ocr_space'
33
+
32
34
  result = OcrSpace::FromUrl.new(apikey: "YOUR API KEY", url: "http://i.stack.imgur.com/vrkIj.png")
33
35
 
34
36
  puts result #Raw result
@@ -43,6 +45,8 @@ puts result.text_data #Clean result
43
45
  #To convert images from file upload
44
46
 
45
47
  ```ruby
48
+ require 'ocr_space'
49
+
46
50
  result = OcrSpace::FromFile.new(apikey: "YOUR API KEY", files: "./vrkIj.png")
47
51
 
48
52
  puts result #Raw result
@@ -66,6 +70,18 @@ $ "I am curious about \r\narea-filling text \r\nrendering options \r\n"
66
70
  #NOTE
67
71
  For commandline interface to work you will have to set ENV variable 'ocr_api_key' to your apikey.
68
72
 
73
+ ```
74
+ $ export ocr_api_key='YOUR API KEY'
75
+ ```
76
+ 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
+
78
+ ```ruby
79
+ result = OcrSpace::FromFile.new(files: "./vrkIj.png") #for File based
80
+
81
+ result = OcrSpace::FromUrl.new(url: "http://i.stack.imgur.com/vrkIj.png") #for URL based
82
+
83
+ ```
84
+
69
85
  #Optional
70
86
 
71
87
  You can also pass in Optional attributes
@@ -11,6 +11,7 @@ module OcrSpace
11
11
  language: language,
12
12
  isOverlayRequired: isOverlayRequired,
13
13
  files: @file})
14
+ @data = @data.data.parsed_response["ParsedResults"][0]
14
15
  end
15
16
  def text_data
16
17
  self.data.parsed_response["ParsedResults"][0]["ParsedText"]
@@ -10,7 +10,7 @@ module OcrSpace
10
10
  isOverlayRequired: isOverlayRequired,
11
11
  url: url})
12
12
  end
13
-
13
+
14
14
  def text_data
15
15
  self.data.parsed_response["ParsedResults"][0]["ParsedText"]
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module OcrSpace
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
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.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suyesh Bhandari