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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c1b2a8acf83ddace8ddbabe25bc7783b832d0cc
4
- data.tar.gz: ad437866031e93ff7b1488add0a485a58e6687e2
3
+ metadata.gz: d307c51a47c8d24a8841dc7fb91c69e6ded50b08
4
+ data.tar.gz: 818ce81415b49d521f39617722d3c3d3ca8320f7
5
5
  SHA512:
6
- metadata.gz: 0a3c5db74d18468f0bd97419b0d3114f1830061241372333d2c229afc27be4a07b7ff2858f7c03bf27564e526385003c199cf1cb94dcf1a733af791c6d086075
7
- data.tar.gz: c59f78d727e8720dbf82612da82c84d92fc7ebaeba6d39862614be790286fd8db7cede7a667626c9dbb9be1da4ba9ee2859a6939f7064a96260d06bdf3cb8e7b
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
- 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"]}>>
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
- p result.text_data #Clean result
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
- p result #Raw result
54
+ puts result.data #Raw result
54
55
 
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"]}>>
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
- p result.text_data #Clean result
58
+ puts result.text_data #Clean result
58
59
 
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"
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
 
@@ -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.parsed_response['ParsedResults'][0]['ParsedText']
18
+ data[0]['ParsedText'].delete("\n").delete("\r").strip
18
19
  end
19
20
  end
20
21
  end
@@ -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.parsed_response['ParsedResults'][0]['ParsedText']
16
+ data[0]['ParsedText'].delete("\n").delete("\r").strip
16
17
  end
17
18
  end
18
19
  end
@@ -1,3 +1,3 @@
1
1
  module OcrSpace
2
- VERSION = '0.2.7.3'.freeze
2
+ VERSION = '0.2.8.1'.freeze
3
3
  end
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.7.3
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-25 00:00:00.000000000 Z
11
+ date: 2016-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler