rhocr 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/lib/ocr_page.rb +3 -3
  3. data/rhocr.gemspec +1 -1
  4. metadata +1 -1
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('rhocr', '0.0.2') do |p|
5
+ Echoe.new('rhocr', '0.0.3') do |p|
6
6
  p.description = "Manipulate and use OCR data encode in HOCR"
7
7
  p.url = "http://github.com/daandi/rhocr"
8
8
  p.author = "Andreas Neumann"
data/lib/ocr_page.rb CHANGED
@@ -10,10 +10,10 @@ class OCRPage < OCRBox
10
10
 
11
11
  def hocr_lines( hocr_contents)
12
12
  hocr_array = []
13
- for line in hocr_contents.split(/<span class="ocr_line"/) do
13
+ for line in hocr_contents.split(/<span class=['"]ocr_line['"]/) do
14
14
  line_array = []
15
- for ocrx_word in line.scan(/<span class="ocrx_word"[^>]+>[^<]+<\/span>/) do
16
- ocrx_word =~ /title="bbox (\d+) (\d+) (\d+) (\d+)">([^<]+)</
15
+ for ocrx_word in line.scan(/<span class=['"]ocrx_word['"][^>]+>[^<]+<\/span>/) do
16
+ ocrx_word =~ /title=['"]bbox (\d+) (\d+) (\d+) (\d+)['"]>([^<]+)</
17
17
  current_word = OCRXWord.new($1,$2,$3,$4,$5)
18
18
  line_array << current_word
19
19
  end
data/rhocr.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rhocr}
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Andreas Neumann"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rhocr
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Andreas Neumann