mork 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cedc2c2924bff45051c7d4fdace910882b95ade7
4
- data.tar.gz: 4a97e442ee44a1e615e9d92dd1be2dfa8af01545
3
+ metadata.gz: 59b94f585fff925a78dc0fc848c267503cfdc8c0
4
+ data.tar.gz: 0a71421a1f6a1fd9790047ea4b913397572799ea
5
5
  SHA512:
6
- metadata.gz: 77283aab2e31e1189a7579f49b6a535b374381254df3b75a4ded1eb2ea871ba11987b441237afef320e59a5fd605a8b9a1863b80c27547221064696f52a75642
7
- data.tar.gz: b2ea3c69c2fd974d4d047af7ad2aec052dcd34046ca06a5ad20666dd31df1485dd906b52164929ae8c826c857783f7ac25f0aa84da5ea6f2f1266e6548f7226e
6
+ metadata.gz: 2d8863ac600a282190b719b433db6ac761422f4ad8485fe979230b6e1ee609685e1a611f996ef2fe33785e2185dfde23ac9f8253c5c4351d0f937a262ef487df
7
+ data.tar.gz: ec876a3c40eb586f462d9b7127537b5562a0402a7ad6f96063ca5434dd5ad5d6151e96de92913b6ee8845fb677c0133766c63986f5c475dd271705b641d0013f
data/README.md CHANGED
@@ -152,18 +152,19 @@ If the `layout` argument is omitted, Mork will search for a file named `layout.y
152
152
 
153
153
  ## Scoring response sheets with `SheetOMR`
154
154
 
155
- Assuming that a person has filled out a response sheet by darkening with a pen the selected choices, and that sheet has been acquired as an image file, response scoring is performed by the `Mork::SheetOMR` class. Again, two pieces of information must be provided to the class constructor:
155
+ Assuming that a person has filled out a response sheet by darkening with a pen the selected choices, and that sheet has been acquired as an image file, response scoring is performed by the `Mork::SheetOMR` class. Three pieces of information must be provided to the class constructor:
156
156
 
157
157
  - **image**: the path/filename of the bitmap image (currently accepts JPG, JPEG, PNG, PDF extensions; a resolution of 150-200 dpi is usually more than sufficient to obtain accurate readings)
158
- - **layout**: same as for the SheetPDF class
158
+ - **choices**: equivalent to the `choices` array of integers passed to the `SheetPDF` constructor as part of the `content` parameter (see above)
159
+ - **layout**: same as for the `SheetPDF` class
159
160
 
160
161
  The following code shows how to create and analyze a SheetOMR based on a bitmap file named `image.jpg`:
161
162
 
162
163
  ```ruby
163
164
  # instantiating the object
164
- s = SheetOMR.new 'image.jpg', 'layout.yml'
165
+ s = SheetOMR.new 'image.jpg', [5]*100, 'layout.yml'
165
166
  # detecting darkened choice cells for the 100 items
166
- chosen = s.mark_array 100
167
+ chosen = s.mark_array
167
168
  ```
168
169
 
169
170
  If all goes well, the `chosen` array will contain 100 sub-arrays, each containing the list of darkened choices for that item, where the first cell is indicated by a 0, the second by a 1, etc. It is also possible to show the scoring graphically:
data/lib/mork/mimage.rb CHANGED
@@ -2,12 +2,14 @@ require 'mini_magick'
2
2
  require 'mork/npatch'
3
3
 
4
4
  module Mork
5
- # The class Mimage is a wrapper for the core image library, currently mini_magick
5
+ # The class Mimage manages the image. It is also a wrapper for the core image library
6
+ # currently mini_magick. TODO: consider moving out the interaction with mini_magick.
7
+ # Note that Mimage is NOT intended as public API, it should only be called by SheetOMR
6
8
  class Mimage
7
- def initialize(path, grom, page=0)
8
- raise "File '#{path}' not found" unless File.exists? path
9
- @path = path
10
- @grom = grom
9
+ def initialize(path, nitems, grom)
10
+ @path = path
11
+ @grom = grom
12
+ @nitems = nitems
11
13
  @grom.set_page_size width, height
12
14
  @rm = {} # registration mark centers
13
15
  @rmsa = {} # registration mark search area
@@ -30,24 +32,12 @@ module Mork
30
32
  }
31
33
  end
32
34
 
33
- def ink_black
34
- reg_pixels.average @grom.ink_black_area
35
- end
36
-
37
- def paper_white
38
- reg_pixels.average @grom.paper_white_area
39
- end
40
-
41
- def cal_cell_mean
42
- @grom.calibration_cell_areas.collect { |c| reg_pixels.average c }.mean
35
+ def marked?(q,c)
36
+ shade_of(q,c) < choice_threshold
43
37
  end
44
38
 
45
- def shade_of_barcode_bit(i)
46
- reg_pixels.average @grom.barcode_bit_area i+1
47
- end
48
-
49
- def shade_of(q,c)
50
- reg_pixels.average @grom.choice_cell_area(q, c)
39
+ def barcode_bit?(i)
40
+ reg_pixels.average(@grom.barcode_bit_area i+1) < barcode_threshold
51
41
  end
52
42
 
53
43
  def width
@@ -65,7 +55,7 @@ module Mork
65
55
  def outline(cells, roundedness=nil)
66
56
  return if cells.empty?
67
57
  @cmd << [:stroke, 'green']
68
- @cmd << [:strokewidth, '4']
58
+ @cmd << [:strokewidth, '2']
69
59
  @cmd << [:fill, 'none']
70
60
  coordinates_of(cells).each do |c|
71
61
  roundedness ||= [c[:h], c[:w]].min / 2
@@ -163,6 +153,44 @@ module Mork
163
153
  @cmd.each { |cmd| c.send *cmd }
164
154
  end
165
155
 
156
+ def shade_of(q,c)
157
+ choice_cell_averages[q][c]
158
+ end
159
+
160
+ def choice_cell_averages
161
+ @choice_cell_averages ||= begin
162
+ @nitems.each_with_index.collect do |cho, q|
163
+ cho.times.collect do |c|
164
+ reg_pixels.average @grom.choice_cell_area(q, c)
165
+ end
166
+ end
167
+ end
168
+ end
169
+
170
+ def choice_threshold
171
+ @choice_threshold ||= (cal_cell_mean - darkest_cell_mean) * 0.75 + darkest_cell_mean
172
+ end
173
+
174
+ def barcode_threshold
175
+ @barcode_threshold ||= (paper_white + ink_black) / 2
176
+ end
177
+
178
+ def cal_cell_mean
179
+ @grom.calibration_cell_areas.collect { |c| reg_pixels.average c }.mean
180
+ end
181
+
182
+ def darkest_cell_mean
183
+ @choice_cell_averages.flatten.min
184
+ end
185
+
186
+ def ink_black
187
+ reg_pixels.average @grom.ink_black_area
188
+ end
189
+
190
+ def paper_white
191
+ reg_pixels.average @grom.paper_white_area
192
+ end
193
+
166
194
  def img_size
167
195
  @img_size ||= IO.read("|identify -format '%w,%h' #{@path}").split ','
168
196
  end
data/lib/mork/npatch.rb CHANGED
@@ -22,6 +22,10 @@ module Mork
22
22
  crop(c).mean
23
23
  end
24
24
 
25
+ def stddev(c=nil)
26
+ crop(c).stddev
27
+ end
28
+
25
29
  def length
26
30
  @patch.length
27
31
  end
@@ -4,9 +4,19 @@ require 'mork/mimage_list'
4
4
 
5
5
  module Mork
6
6
  class SheetOMR
7
- def initialize(path, grom=nil)
8
- @grom = GridOMR.new grom
9
- @mim = Mimage.new path, @grom
7
+
8
+ def initialize(path, nitems=nil, grom=nil)
9
+ raise "File '#{path}' not found" unless File.exists? path
10
+ @grom = GridOMR.new grom
11
+ @nitems = case nitems
12
+ when nil
13
+ [@grom.max_choices_per_question] * @grom.max_questions
14
+ when Fixnum
15
+ [@grom.max_choices_per_question] * nitems
16
+ when Array
17
+ nitems
18
+ end
19
+ @mim = Mimage.new path, @nitems, @grom
10
20
  end
11
21
 
12
22
  def valid?
@@ -31,7 +41,7 @@ module Mork
31
41
  # bits long, with most significant bits to the left
32
42
  def barcode_string
33
43
  return if not_registered
34
- cs = @grom.barcode_bits.times.inject("") { |c, v| c << barcode_bit_value(v) }
44
+ cs = @grom.barcode_bits.times.inject("") { |c, v| c << barcode_bit_string(v) }
35
45
  cs.reverse
36
46
  end
37
47
 
@@ -41,17 +51,18 @@ module Mork
41
51
  # false otherwise
42
52
  def marked?(q, c)
43
53
  return if not_registered
44
- @mim.shade_of(q, c) < choice_threshold
54
+ @mim.marked? q, c
45
55
  end
46
56
 
47
57
  # TODO: define method ‘mark’ to retrieve the choice array for a single item
48
58
 
59
+
49
60
  # mark_array(range)
50
61
  #
51
62
  # returns an array of arrays of marked choices.
52
63
  # takes either a range of questions, an array of questions, or a fixnum,
53
64
  # in which case the choices for the first n questions will be returned.
54
- # if called without arguments, all available choices will be evaluated
65
+ # if called without arguments, all available choices will be evaluated.
55
66
  def mark_array(r = nil)
56
67
  return if not_registered
57
68
  question_range(r).collect do |q|
@@ -63,6 +74,24 @@ module Mork
63
74
  end
64
75
  end
65
76
 
77
+ # mark_char_array(range)
78
+ #
79
+ # returns an array of arrays of the characters corresponding to marked choices.
80
+ # WARNING: at this time, only the latin sequence 'A, B, C...' is supported.
81
+ # takes either a range of questions, an array of questions, or a fixnum,
82
+ # in which case the choices for the first n questions will be returned.
83
+ # if called without arguments, all available choices will be evaluated.
84
+ def mark_char_array(r = nil)
85
+ return if not_registered
86
+ question_range(r).collect do |q|
87
+ cho = []
88
+ (0...@grom.max_choices_per_question).each do |c|
89
+ cho << (65+c).chr if marked?(q, c)
90
+ end
91
+ cho
92
+ end
93
+ end
94
+
66
95
  def mark_logical_array(r = nil)
67
96
  return if not_registered
68
97
  question_range(r).collect do |q|
@@ -134,10 +163,15 @@ module Mork
134
163
  # ============================================================#
135
164
  private #
136
165
  # ============================================================#
137
-
166
+
167
+ def barcode_bit_string(i)
168
+ @mim.barcode_bit?(i) ? "1" : "0"
169
+ end
170
+
138
171
  def question_range(r)
172
+ # TODO: help text: although not API, people need to know this!
139
173
  if r.nil?
140
- (0...@grom.max_questions)
174
+ (0...@nitems.length)
141
175
  elsif r.is_a? Fixnum
142
176
  (0...r)
143
177
  elsif r.is_a? Array
@@ -146,23 +180,7 @@ module Mork
146
180
  raise "Invalid argument"
147
181
  end
148
182
  end
149
-
150
- def barcode_bit_value(i)
151
- @mim.shade_of_barcode_bit(i) < barcode_threshold ? "1" : "0"
152
- end
153
-
154
- def barcode_threshold
155
- @barcode_threshold ||= (@mim.paper_white + ink_black) / 2
156
- end
157
-
158
- def choice_threshold
159
- @choice_threshold ||= (@mim.cal_cell_mean - ink_black) * 0.9 + ink_black
160
- end
161
-
162
- def ink_black
163
- @ink_black ||= @mim.ink_black
164
- end
165
-
183
+
166
184
  def not_registered
167
185
  unless valid?
168
186
  puts "---=={ Unregistered image. Reason: '#{@mim.status.inspect}' }==---"
data/lib/mork/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mork
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -2,45 +2,74 @@ require 'spec_helper'
2
2
 
3
3
  module Mork
4
4
  describe Mimage do
5
- let(:sgi) { sample_img 'sample-gray' }
6
- let(:sg) { Mimage.new sgi.filename, GridOMR.new(sgi.grid_file) }
7
-
8
- describe 'basics' do
9
- it 'returns the width' do
10
- expect(sg.width).to eq sgi.width
11
- end
5
+ let(:qna) { [5] * 100 }
6
+ context 'problematic sheets' do
7
+ let(:mim) { Mimage.new 'spec/samples/out-1.jpg', qna, GridOMR.new('spec/samples/grid.yml') }
8
+ let(:bila) { Mimage.new 'spec/samples/syst/bila0.jpg', qna, GridOMR.new('spec/samples/grid.yml') }
12
9
 
13
- it 'returns the height' do
14
- expect(sg.height).to eq sgi.height
10
+ xit 'writes all cell values to a text file' do
11
+ d=Dir['spec/samples/syst/*.jpg']
12
+ d.each do |f|
13
+ fn = File.basename f, '.jpg'
14
+ m = Mimage.new "spec/samples/syst/#{fn}.jpg", qna, GridOMR.new('spec/samples/grid.yml')
15
+ puts fn
16
+ File.open("spec/samples/syst/#{fn}.txt",'w') do |f|
17
+ f.puts "ink:#{m.send :ink_black}"
18
+ f.puts "drk:#{m.send :darkest_cell_mean}"
19
+ f.puts "pap:#{m.send :paper_white}"
20
+ f.puts "cal:#{m.send :cal_cell_mean}"
21
+ f.puts "cho:#{m.send :choice_threshold}"
22
+ 100.times do |q|
23
+ 5.times do |c|
24
+ f.puts m.send('choice_cell_averages')[q, c]
25
+ end
26
+ end
27
+ end
28
+ end
15
29
  end
30
+ end
31
+
32
+ context 'Old specs' do
33
+ let(:sgi) { sample_img 'sample-gray' }
34
+ let(:sg) { Mimage.new sgi.filename, qna, GridOMR.new(sgi.grid_file) }
35
+
36
+ describe 'basics' do
37
+ it 'returns the width' do
38
+ expect(sg.width).to eq sgi.width
39
+ end
16
40
 
17
- it 'returns the pixels as an array' do
18
- expect(sg.send :raw_pixels).to be_a NPatch
19
- end
41
+ it 'returns the height' do
42
+ expect(sg.height).to eq sgi.height
43
+ end
20
44
 
21
- it 'returns the correct number of pixels' do
22
- expect(sg.send(:raw_pixels).length).to eq sgi.width * sgi.height
23
- end
45
+ it 'returns the pixels as an array' do
46
+ expect(sg.send :raw_pixels).to be_a NPatch
47
+ end
48
+
49
+ it 'returns the correct number of pixels' do
50
+ expect(sg.send(:raw_pixels).length).to eq sgi.width * sgi.height
51
+ end
24
52
 
25
- it 'returns the stretched array' do
26
- expect(sg.send(:reg_pixels).length).to eq sgi.width * sgi.height
27
- end
53
+ it 'returns the stretched array' do
54
+ expect(sg.send(:reg_pixels).length).to eq sgi.width * sgi.height
55
+ end
28
56
 
29
- it 'raises an error if the file is not found' do
30
- expect { Mimage.new 'non_existing_file' }.to raise_error
57
+ it 'raises an error if the file is not found' do
58
+ expect { Mimage.new 'non_existing_file' }.to raise_error
59
+ end
31
60
  end
32
- end
33
61
 
34
- describe 'inspecting' do
35
- it 'writes out average whiteness of choice cells' do
36
- qz = sample_img 'silvia'
37
- s = Mimage.new qz.filename, GridOMR.new(qz.grid_file)
38
- File.open('spec/out/choices.txt', 'w') do |f|
39
- 120.times do |q|
40
- t = (0..4).collect do |c|
41
- s.send(:shade_of, q, c).round
62
+ describe 'inspecting' do
63
+ xit 'writes out average whiteness of choice cells' do
64
+ qz = sample_img 'silvia'
65
+ s = Mimage.new qz.filename, [5] * 5, GridOMR.new(qz.grid_file)
66
+ File.open('spec/out/choices.txt', 'w') do |f|
67
+ 5.times do |q|
68
+ t = (0..4).collect do |c|
69
+ s.send(:shade_of, q, c).round
70
+ end
71
+ f.puts "#{q+1}: #{t.join(' ')}"
42
72
  end
43
- f.puts "#{q+1}: #{t.join(' ')}"
44
73
  end
45
74
  end
46
75
  end
@@ -32,7 +32,7 @@ module Mork
32
32
  # since these specs change the @crop, they must be run in isolation
33
33
  # with the SheetOMR rebuilt each time, even though it is time consuming!
34
34
  let(:shinfo) { sample_img 'sample-gray' }
35
- let(:sheet) { SheetOMR.new shinfo.filename, shinfo.grid_file }
35
+ let(:sheet) { SheetOMR.new shinfo.filename, [5]*100, shinfo.grid_file }
36
36
 
37
37
  it 'highlights the registration areas and frame' do
38
38
  sheet.highlight_registration
@@ -66,7 +66,7 @@ module Mork
66
66
 
67
67
  it 'outlines some responses in-place (rewriting the source image)' do
68
68
  FileUtils.cp shinfo.filename, 'spec/out/inplace.jpg'
69
- tsheet = SheetOMR.new 'spec/out/inplace.jpg', shinfo.grid_file
69
+ tsheet = SheetOMR.new 'spec/out/inplace.jpg', [5]*100, shinfo.grid_file
70
70
  tsheet.outline [[1],[1],[2],[2],[3,4],[],[0,1,2,3,4], [],[1],[2],[2],[3,4],[],[0,1,2,3,4]]
71
71
  tsheet.write
72
72
  end
@@ -76,26 +76,26 @@ module Mork
76
76
  sheet.outline [[1],[1],[2],[2],[3,4],[],[0,1,2,3,4], [],[1],[2],[2],[3,4],[],[0,1,2,3,4]]
77
77
  sheet.write 'spec/out/marks_and_outs.jpg'
78
78
  end
79
-
79
+
80
80
  it 'highlights marked cells of a problematic one' do
81
81
  si = sample_img 'silvia'
82
- s = SheetOMR.new si.filename, si.grid_file
82
+ s = SheetOMR.new si.filename, [5]*100, si.grid_file
83
83
  s.highlight_marked
84
84
  s.write 'spec/out/problem.jpg'
85
85
  end
86
86
 
87
87
  it 'highlights the barcode' do
88
88
  si = sample_img 'sample-gray'
89
- s = SheetOMR.new si.filename, si.grid_file
89
+ s = SheetOMR.new si.filename, [5]*100, si.grid_file
90
90
  s.highlight_barcode
91
91
  s.write 'spec/out/code_bits.jpg'
92
92
  end
93
93
  end
94
-
94
+
95
95
  context 'marking a nicely printed and scanned sheet' do
96
96
  before(:all) do
97
97
  @shinfo = sample_img 'sample-gray'
98
- @sheet = SheetOMR.new @shinfo.filename, @shinfo.grid_file
98
+ @sheet = SheetOMR.new @shinfo.filename, [5]*120, @shinfo.grid_file
99
99
  end
100
100
 
101
101
  describe '#valid?' do
@@ -118,8 +118,7 @@ module Mork
118
118
  end
119
119
 
120
120
  it 'writes out markedness' do
121
- puts "Choice threshold: #{@sheet.send :choice_threshold}"
122
- mf = File.open('spec/out/marked.txt', 'w')
121
+ mf = File.open('spec/out/marked.txt', 'w')
123
122
  120.times do |q|
124
123
  x = 5.times.collect do |c|
125
124
  @sheet.marked?(q,c) ? '1' : '0'
@@ -164,19 +163,90 @@ module Mork
164
163
 
165
164
  it 'should read another bit string' do
166
165
  barcode_string = '0000000000000000000000000010000110100000'
167
- s2 = SheetOMR.new('spec/samples/sample02.jpg')
166
+ s2 = SheetOMR.new('spec/samples/sample02.jpg', [5]*100)
168
167
  s2.barcode_string.should == barcode_string
169
168
  s2.barcode.should == 8608
170
169
  end
171
170
 
172
171
  it 'should read the 666 bit string' do
173
172
  sh = sample_img 'code666'
174
- s2 = SheetOMR.new sh.filename, sh.grid_file
173
+ s2 = SheetOMR.new sh.filename, [5]*100, sh.grid_file
175
174
  s2.barcode.should == sh.barcode_int
176
175
  end
177
176
  end
178
177
 
179
178
  end
179
+
180
+ context 'marking a problematic sheet' do
181
+ let(:sheet) { SheetOMR.new 'spec/samples/out-1.jpg', [5]*100, 'spec/samples/grid.yml' }
182
+
183
+ it 'highlights marked cells and outline correct responses' do
184
+ sheet.cross_marked
185
+ sheet.outline [[0,1,2,3,4]] * 100
186
+ sheet.write 'spec/out/marks_and_outs.jpg'
187
+ end
188
+
189
+ it 'highlights the barcode' do
190
+ sheet.highlight_barcode
191
+ sheet.write 'spec/out/barcode.jpg'
192
+ end
193
+ end
194
+
195
+ context 'systematic tests' do
196
+ let(:bila) { 'CCEBEBCEEACCDCABDBEBCADEADDCCCACCACDBBDAECDDABDEEBCEEDCBAAADEEEEDCADEABCBDECCCCDDDCABBECAADADBBEEABA'.split '' }
197
+ let(:bila0) { SheetOMR.new 'spec/samples/syst/bila0.jpg', [5]*100, 'spec/samples/grid.yml'}
198
+ let(:bila1) { SheetOMR.new 'spec/samples/syst/bila1.jpg', [5]*100, 'spec/samples/grid.yml'}
199
+ let(:bila2) { SheetOMR.new 'spec/samples/syst/bila2.jpg', [5]*100, 'spec/samples/grid.yml'}
200
+ let(:bila3) { SheetOMR.new 'spec/samples/syst/bila3.jpg', [5]*100, 'spec/samples/grid.yml'}
201
+ let(:dald) { 'DDDBECAAADBAEEEAEEEBAACAEDBDECDBDCDCDDEDCCDCDBDCADEEDBCCBEBBAADDCDBBECBBBDEABADABADADBABAEABACBDADDA'.split '' }
202
+ let(:dald0) { SheetOMR.new 'spec/samples/syst/dald0.jpg', [5]*100, 'spec/samples/grid.yml'}
203
+ let(:dald1) { SheetOMR.new 'spec/samples/syst/dald1.jpg', [5]*100, 'spec/samples/grid.yml'}
204
+ let(:dald2) { SheetOMR.new 'spec/samples/syst/dald2.jpg', [5]*100, 'spec/samples/grid.yml'}
205
+ let(:dald3) { SheetOMR.new 'spec/samples/syst/dald3.jpg', [5]*100, 'spec/samples/grid.yml'}
206
+ let(:cost) { 'ABBDDBAEAEBAADEAAECBCDBBDABABADEECCACBCAEDDAEBEABBCDABECAACEEEBADECBBEAADBBBEABDAEBDEEABBABEBEDDAEEC'.split '' }
207
+ let(:cost0) { SheetOMR.new 'spec/samples/syst/cost0.jpg', [5]*100, 'spec/samples/grid.yml'}
208
+ let(:cost1) { SheetOMR.new 'spec/samples/syst/cost1.jpg', [5]*100, 'spec/samples/grid.yml'}
209
+ let(:cost2) { SheetOMR.new 'spec/samples/syst/cost2.jpg', [5]*100, 'spec/samples/grid.yml'}
210
+ let(:cost3) { SheetOMR.new 'spec/samples/syst/cost3.jpg', [5]*100, 'spec/samples/grid.yml'}
211
+ let(:bone) { 'CECBBABAECADEDCACBBDEECBADBECDCEDECABCAADCBDEDACAEEDCCADBEDCEBCCBBDCCACDEDDAAECEBDBADCBAAEBAEDABCBDC'.split '' }
212
+ let(:bone0) { SheetOMR.new 'spec/samples/syst/bone0.jpg', [5]*100, 'spec/samples/grid.yml'}
213
+ let(:bone1) { SheetOMR.new 'spec/samples/syst/bone1.jpg', [5]*100, 'spec/samples/grid.yml'}
214
+ let(:barr) { 'ACECAAADDBCECCCDBEBECDEDAECEDDEEDCDEADDCCBCCCBBEACBCAEDEEDDDABBBBABEBDCEADEEDEBCBADBCEDCDBACEBCBDCDA'.split '' }
215
+ let(:barr0) { SheetOMR.new 'spec/samples/syst/barr0.jpg', [5]*100, 'spec/samples/grid.yml'}
216
+ let(:barr1) { SheetOMR.new 'spec/samples/syst/barr1.jpg', [5]*100, 'spec/samples/grid.yml'}
217
+
218
+ it 'checks bila' do
219
+ expect(bila0.mark_char_array.flatten).to eq(bila)
220
+ expect(bila1.mark_char_array.flatten).to eq(bila)
221
+ expect(bila2.mark_char_array.flatten).to eq(bila)
222
+ expect(bila3.mark_char_array.flatten).to eq(bila)
223
+ end
224
+
225
+ it 'checks dald' do
226
+ expect(dald0.mark_char_array.flatten).to eq(dald)
227
+ expect(dald1.mark_char_array.flatten).to eq(dald)
228
+ expect(dald2.mark_char_array.flatten).to eq(dald)
229
+ expect(dald3.mark_char_array.flatten).to eq(dald)
230
+ end
231
+
232
+ it 'checks cost' do
233
+ expect(cost0.mark_char_array.flatten).to eq(cost)
234
+ expect(cost1.mark_char_array.flatten).to eq(cost)
235
+ expect(cost2.mark_char_array.flatten).to eq(cost)
236
+ expect(cost3.mark_char_array.flatten).to eq(cost)
237
+ end
238
+
239
+ it 'checks bone' do
240
+ expect(bone0.mark_char_array.flatten).to eq(bone)
241
+ expect(bone1.mark_char_array.flatten).to eq(bone)
242
+ end
243
+
244
+ it 'checks barr' do
245
+ expect(barr0.mark_char_array.flatten).to eq(barr)
246
+ expect(barr1.mark_char_array.flatten).to eq(barr)
247
+ end
248
+
249
+ end
180
250
 
181
251
  # context "multi-page pdf" do
182
252
  # before(:all) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giuseppe Bertini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-02 00:00:00.000000000 Z
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: narray