From 17f1f887c2542e3e92139cd9ccb1eed9bd2420e3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 6 Jan 2014 21:59:03 -0500 Subject: v5: date 2014: headers bin/sisu & lib/; code constants.rb --- lib/sisu/v5/xhtml_epub2_concordance.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/sisu/v5/xhtml_epub2_concordance.rb') diff --git a/lib/sisu/v5/xhtml_epub2_concordance.rb b/lib/sisu/v5/xhtml_epub2_concordance.rb index 5668521b..e75b3366 100644 --- a/lib/sisu/v5/xhtml_epub2_concordance.rb +++ b/lib/sisu/v5/xhtml_epub2_concordance.rb @@ -8,7 +8,8 @@ * Author: Ralph Amissah * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011, 2012, 2013 Ralph Amissah, All Rights Reserved. + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Ralph Amissah, + All Rights Reserved. * License: GPL 3 or later: -- cgit v1.2.3 From 0e42ce6f34c3cfdf370f439f58c4e3de8b05ea92 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 6 Jan 2014 22:42:31 -0500 Subject: v5: cosmetic code, case statement --- lib/sisu/v5/xhtml_epub2_concordance.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v5/xhtml_epub2_concordance.rb') diff --git a/lib/sisu/v5/xhtml_epub2_concordance.rb b/lib/sisu/v5/xhtml_epub2_concordance.rb index e75b3366..6324a8cd 100644 --- a/lib/sisu/v5/xhtml_epub2_concordance.rb +++ b/lib/sisu/v5/xhtml_epub2_concordance.rb @@ -277,9 +277,9 @@ WOK @word_map[word] << location_seg("#{@seg}\##{toy}",toy) else @word_map[word] << case line - when @rxp_lv1; location_seg('T1',toy) - when @rxp_lv2; location_seg('T2',toy) - when @rxp_lv3; location_seg('T3',toy) + when @rxp_lv1 then location_seg('T1',toy) + when @rxp_lv2 then location_seg('T2',toy) + when @rxp_lv3 then location_seg('T3',toy) end end end -- cgit v1.2.3 From 5fb49b575a548313b827fd66fd7ecce514fe0e45 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 6 Jan 2014 23:02:50 -0500 Subject: v5: heading recalibration, code (downstream) changes * here no doubt remains breakage (test, fix & test again) --- lib/sisu/v5/xhtml_epub2_concordance.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v5/xhtml_epub2_concordance.rb') diff --git a/lib/sisu/v5/xhtml_epub2_concordance.rb b/lib/sisu/v5/xhtml_epub2_concordance.rb index 6324a8cd..6d7c4758 100644 --- a/lib/sisu/v5/xhtml_epub2_concordance.rb +++ b/lib/sisu/v5/xhtml_epub2_concordance.rb @@ -160,11 +160,13 @@ WOK @env,@md,@ao_array=particulars.env,particulars.md,particulars.ao_array @path="#{@env.processing_path.epub}" @freq=Hash.new(0) - @rxp_lv1=/^#{Mx[:lv_o]}1:/ #fix Mx[:lv_o] - @rxp_lv2=/^#{Mx[:lv_o]}2:/ #fix Mx[:lv_o] - @rxp_lv3=/^#{Mx[:lv_o]}3:/ #fix Mx[:lv_o] + @rxp_lv0=/^#{Mx[:lv_o]}0:/ + @rxp_lv1=/^#{Mx[:lv_o]}1:/ + @rxp_lv2=/^#{Mx[:lv_o]}2:/ + @rxp_lv3=/^#{Mx[:lv_o]}3:/ @rxp_seg=/^#{Mx[:lv_o]}4:(\S+?)#{Mx[:lv_c]}/ @rxp_title=Regexp.new("^#{Mx[:meta_o]}title#{Mx[:meta_c]}\s*(.+?)\s*$") + @rxp_t0=Regexp.new('^T0') @rxp_t1=Regexp.new('^T1') @rxp_t2=Regexp.new('^T2') @rxp_t3=Regexp.new('^T3') @@ -271,12 +273,14 @@ WOK end @freq[word] +=1 @word_map[word] ||= [] - if line !~@rxp_lv1 \ + if line !~@rxp_lv0 \ + and line !~@rxp_lv1 \ and line !~@rxp_lv2 \ and line !~@rxp_lv3 @word_map[word] << location_seg("#{@seg}\##{toy}",toy) else @word_map[word] << case line + when @rxp_lv0 then location_seg('T0',toy) when @rxp_lv1 then location_seg('T1',toy) when @rxp_lv2 then location_seg('T2',toy) when @rxp_lv3 then location_seg('T3',toy) -- cgit v1.2.3