ocr_space 2.2 → 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: c34462559994e00ea9b84c27a4d7f54bb54bc62c
4
- data.tar.gz: 8bdfe01771c7fc294ceb458f6231bfa4e2c950b3
3
+ metadata.gz: e31b740fda80d7e435633b181664abe00d52f1c4
4
+ data.tar.gz: 323033e289f5a106c645417d24e20aa3a3137923
5
5
  SHA512:
6
- metadata.gz: 6ad76cda15eb4b316db677020002ed1990214dd42e4ffad65b55146e88dd14cb2d557f87769656178502e629261edabf892915e2674565da1187226b82fa2514
7
- data.tar.gz: 58a0b8a673b4875dcda3571aff024ff37a6e133fc2771aa0df305926cb0136cb8fab57b152d1106e50f7179fca598136dc1d9b08e2a27f68877b1fd04ea86660
6
+ metadata.gz: bd9421f6a23988bcd48ce5b2f166ad0c6ace824bc71f1ee1c049f78b9489aadbcc861b3ec4ebdf708c0d1a36f0f637f336194bbcea869e550e3a67720e828692
7
+ data.tar.gz: 6be0bf1464ac989bdab39765c866d205d3e56e1e3be1750c04e28b907b5d563231f929fa0d010bb5365634a9e1a66b4961a677e67a1924007ad1deca7d69516d
data/exe/ocrspace CHANGED
@@ -9,7 +9,7 @@ else
9
9
  begin
10
10
  resource = OcrSpace::Resource.new
11
11
  result = resource.convert file: ARGV[0]
12
- puts result[0]['ParsedText'].delete("\n").delete("\r").strip
12
+ puts result
13
13
  rescue
14
14
  puts "Something went wrong, Please try again.".colorize(:red)
15
15
  end
@@ -2,7 +2,7 @@ require 'ocr_space/file_post'
2
2
 
3
3
  module OcrSpace
4
4
  module Convert
5
- def convert(apikey: @api_key, language: 'eng', isOverlayRequired: false, file: nil, url: nil, clean_result: false)
5
+ def convert(apikey: @api_key, language: 'eng', isOverlayRequired: false, file: nil, url: nil)
6
6
  if file
7
7
  @files = File.new(file)
8
8
  @data = OcrSpace::FilePost.post('/parse/image',
@@ -11,7 +11,6 @@ module OcrSpace
11
11
  isOverlayRequired: isOverlayRequired,
12
12
  file: @files })
13
13
  @data = @data.parsed_response['ParsedResults']
14
- clean_result == true ? @data[0]['ParsedText'].delete("\n").delete("\r").strip : @data = @data.parsed_response['ParsedResults']
15
14
  elsif url
16
15
  @data = HTTParty.post('https://api.ocr.space/parse/image',
17
16
  body: { apikey: apikey,
@@ -19,7 +18,6 @@ module OcrSpace
19
18
  isOverlayRequired: isOverlayRequired,
20
19
  url: url })
21
20
  @data = @data.parsed_response['ParsedResults']
22
- clean_result == true ? @data[0]['ParsedText'].delete("\n").delete("\r").strip : @data = @data.parsed_response['ParsedResults']
23
21
  else
24
22
  "You need to Pass either file or url."
25
23
  end
@@ -1,3 +1,3 @@
1
1
  module OcrSpace
2
- VERSION = '2.2'.freeze
2
+ VERSION = '2.3'.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: '2.2'
4
+ version: '2.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suyesh Bhandari