diff options
Diffstat (limited to 'lib/sisu/v3/dal_idx.rb')
-rw-r--r-- | lib/sisu/v3/dal_idx.rb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/sisu/v3/dal_idx.rb b/lib/sisu/v3/dal_idx.rb index 63735bde..a90217c4 100644 --- a/lib/sisu/v3/dal_idx.rb +++ b/lib/sisu/v3/dal_idx.rb @@ -79,7 +79,11 @@ module SiSU_DAL_BookIndex && dob.ln==4 @seg=dob.name end - idx_array << "#{dob.idx}~#{dob.ocn}~#{@seg}" if defined? dob.idx and not (dob.idx.nil? or dob.idx.empty?) + if defined? dob.idx \ + and dob.idx.is_a?(String) \ + and not dob.idx.empty? + idx_array << "#{dob.idx}~#{dob.ocn}~#{@seg}" + end tuned_file << dob if dob end idx_array=construct_idx_array(idx_array) if idx_array.length > 0 @@ -193,7 +197,7 @@ module SiSU_DAL_BookIndex idx[:xhtml] << %{\n<p class="letter" id="numeral">0 - 9</p>} the_idx.each do |i| i.each do |x| - if x.class==String + if x.is_a?(String) f=/^(\S)/.match(x)[1] if letter < f while letter < f @@ -216,11 +220,11 @@ module SiSU_DAL_BookIndex @q=idx[:html].index(idx[:html].last) @r=idx[:xhtml].index(idx[:xhtml].last) print "\n" + x + ', ' if @md.opt.cmd =~/V/ - elsif x.class==Array + elsif x.is_a?(Array) p 'array error? -->' print x - elsif x.class==Hash - if x['term_node_lev1'].class==Array + elsif x.is_a?(Hash) + if x['term_node_lev1'].is_a?(Array) x['term_node_lev1'].each do |a| if a[:range] idx[:sst_rel_html_seg][@o]=idx[:sst_rel_html_seg][@o] + %{#{Mx[:lnk_o]}#{a[:range]}#{Mx[:lnk_c]}#{Mx[:rel_o]}/#{a[:seg]}.html##{a[:ocn]}#{Mx[:rel_c]}, } @@ -283,13 +287,13 @@ module SiSU_DAL_BookIndex def screen_print(the_idx) the_idx.each do |i| i.each do |x| - if x.class==String + if x.is_a?(String) print "\n" + x + ', ' - elsif x.class==Array + elsif x.is_a?(Array) p 'array error? -->' print x - elsif x.class==Hash - if x['term_node_lev1'].class==Array + elsif x.is_a?(Hash) + if x['term_node_lev1'].is_a?(Array) x['term_node_lev1'].each do |a| if a[:range] print a[:range] + ', ' |