From 08c69d074001507d64cd5960c8679ec91a5a8353 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 23 Aug 2008 12:01:59 -0400 Subject: pass Hash to Format classes; some match tuning in dal --- lib/sisu/v0/shared_txt.rb | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) (limited to 'lib/sisu/v0/shared_txt.rb') diff --git a/lib/sisu/v0/shared_txt.rb b/lib/sisu/v0/shared_txt.rb index 41d6d815..198b8ce8 100644 --- a/lib/sisu/v0/shared_txt.rb +++ b/lib/sisu/v0/shared_txt.rb @@ -222,50 +222,4 @@ module SiSU_text_utils end end end -module SiSU_text_parts_flatfile - class Split_text_object - @@dl=nil - attr_reader :format,:text,:ocn,:lev_para_ocn - def initialize(md,para) - @md,@para=md,para - @format,@ocn='ordinary','ordinary' - @@dl ||=SiSU_Env::Info_env.new.digest.length - end - def lev_segname_para_ocn - if @para =~/^(?:#{Mx[:lv_o]}[1-9]:\S*?#{Mx[:lv_c]}|<:.+?>).+?#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}.*/ - if /^(#{Mx[:lv_o]}([1-6]):(\S+?)#{Mx[:lv_c]})\s*(\S.+?)#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) - @format,segname,@text,@ocn=$1,$2,$3,$4 - @format="#@format~#{segname}" # - elsif /^(#{Mx[:lv_o]}([1-6]):#{Mx[:lv_c]})\s*(\S.+?)#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) - @format,@text,@ocn=$1,$2,$3 - elsif /<:(.+?)>\s*(\S.+?)#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) - @format,@text,@ocn=$1,$2,$3 - elsif /^(#{Mx[:lv_o]}([1-6]):(\S+?)#{Mx[:lv_c]})\s*(\S.+?)#{Mx[:id_o]}~(0);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) - @@alt_id_count+=1 - @format,segname,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}" - @format="#@format~#{segname}" # - elsif /^(#{Mx[:lv_o]}([1-6]):#{Mx[:lv_c]})\s*(\S.+?)#{Mx[:id_o]}~(0);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) - @@alt_id_count+=1 - @format,@text,@ocn=$1,$2,"x#{@@alt_id_count}" - end - else - if /(.+?)#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) - @text,@ocn=$1,$2 - end - if @para !~/#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}|^$/ #added 2002w06 - @text=/(.+?)/m.match(@para)[1] - end - if /^(#{Mx[:lv_o]}([1-9]):\S*?#{Mx[:lv_c]})\s*(.+)/m.match(@para) - @format,@text=$1,$2 - end - end - @lev_para_ocn=if @para =~/.+<~\d+>/ #hmmm, watch - Format::ParaSiSU.new(@md,@format,@text,@ocn) - else Format::ParaSiSU.new(@md,@format,@text,'<~0>') - end - self - end - end -end __END__ - -- cgit v1.2.3