tesseract-ocr 0.0.1 → 0.0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,26 @@
1
+ #--
2
+ # Copyright 2011 meh. All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # THIS SOFTWARE IS PROVIDED BY meh ''AS IS'' AND ANY EXPRESS OR IMPLIED
11
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
12
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL meh OR
13
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
14
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
15
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
16
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
17
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
18
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
+ #
20
+ # The views and conclusions contained in the software and documentation are those of the
21
+ # authors and should not be interpreted as representing official policies, either expressed
22
+ # or implied, of meh.
23
+ #++
24
+
25
+ require 'tesseract/api'
26
+ require 'tesseract/engine'
data/lib/tesseract/api.rb CHANGED
@@ -23,6 +23,7 @@
23
23
  #++
24
24
 
25
25
  require 'namedic'
26
+ require 'iso_country_codes'
26
27
  require 'tesseract/c'
27
28
 
28
29
  module Tesseract
@@ -54,11 +55,9 @@ class API
54
55
  ##
55
56
  # Transform a language code to tesseract-ocr usable codes
56
57
  def self.to_language_code (code)
57
- case code.to_s.downcase
58
- when 'en' then 'eng'
59
- when 'pt' then 'por'
60
- when 'it' then 'ita'
61
- end or code
58
+ IsoCountryCodes.find(code).alpha3.downcase
59
+ rescue
60
+ code
62
61
  end
63
62
 
64
63
  Types = {
@@ -24,6 +24,6 @@
24
24
 
25
25
  module Tesseract
26
26
  def self.version
27
- '0.0.1'
27
+ '0.0.1.1'
28
28
  end
29
29
  end
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tesseract-ocr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-27 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: namedic
16
- requirement: &15027220 !ruby/object:Gem::Requirement
16
+ requirement: &9368800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15027220
24
+ version_requirements: *9368800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: ffi-extra
27
- requirement: &14985140 !ruby/object:Gem::Requirement
27
+ requirement: &9368000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *14985140
35
+ version_requirements: *9368000
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ffi-inliner
38
- requirement: &14981940 !ruby/object:Gem::Requirement
38
+ requirement: &9366580 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *14981940
46
+ version_requirements: *9366580
47
47
  description:
48
48
  email: meh@paranoici.org
49
49
  executables:
@@ -54,12 +54,13 @@ files:
54
54
  - README.md
55
55
  - Rakefile
56
56
  - bin/tesseract.rb
57
+ - lib/tesseract-ocr.rb
57
58
  - lib/tesseract.rb
58
59
  - lib/tesseract/api.rb
59
60
  - lib/tesseract/c.rb
60
61
  - lib/tesseract/engine.rb
61
62
  - lib/tesseract/version.rb
62
- - tesseract.gemspec
63
+ - tesseract-ocr.gemspec
63
64
  - test/first.png
64
65
  - test/second.png
65
66
  - test/tesseract_spec.rb