From 25e9f4f2a37608f9704645f92a50615a01a50db5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 29 May 2013 19:36:42 -0400 Subject: v4 v5: document version check, disable * automatic check disabled * check and correction of pre 0.38 markup removed --- lib/sisu/v4/dal_doc_str.rb | 48 ---------------------------------------------- 1 file changed, 48 deletions(-) (limited to 'lib/sisu/v4/dal_doc_str.rb') diff --git a/lib/sisu/v4/dal_doc_str.rb b/lib/sisu/v4/dal_doc_str.rb index dfea4ad4..25c6f854 100644 --- a/lib/sisu/v4/dal_doc_str.rb +++ b/lib/sisu/v4/dal_doc_str.rb @@ -556,7 +556,6 @@ module SiSU_DAL_DocumentStructureExtract @md,@dob=md,dob end def structure - structure_markup_normalize structure_markup @dob end @@ -590,53 +589,6 @@ module SiSU_DAL_DocumentStructureExtract end @dob end - def structure_markup_normalize #needs a bit of thinking - dob=if @md.markup_version.determined < 0.38 #%convert internal representation, consider making 0.38 structure default ([A-C1-6] instead of [1-9]), requires downstream changes - @dob=@dob.gsub(/^[456]~/,'!_'). - gsub(/^3~(\S+)/,"#{Mx[:lv_o]}6:\\1#{Mx[:lv_c]}"). - gsub(/^3~\s+/,"#{Mx[:lv_o]}6:#{Mx[:lv_c]}"). - gsub(/^2~(\S+)/,"#{Mx[:lv_o]}5:\\1#{Mx[:lv_c]}"). - gsub(/^2~\s+/,"#{Mx[:lv_o]}5:#{Mx[:lv_c]}"). - gsub(/^1~(\S+)/,"#{Mx[:lv_o]}4:\\1#{Mx[:lv_c]}"). - gsub(/^1~\s+/,"#{Mx[:lv_o]}4:#{Mx[:lv_c]}"). - gsub(/^:?C~(\S+)/,"#{Mx[:lv_o]}3:\\1#{Mx[:lv_c]}"). - gsub(/^:?C~\s+/,"#{Mx[:lv_o]}3:#{Mx[:lv_c]}"). - gsub(/^:?B~(\S+)/,"#{Mx[:lv_o]}2:\\1#{Mx[:lv_c]}"). - gsub(/^:?B~\s+/,"#{Mx[:lv_o]}2:#{Mx[:lv_c]}"). - gsub(/^:?A~(\S+)/,"#{Mx[:lv_o]}1:\\1#{Mx[:lv_c]}"). - gsub(/^:?A~\s+/,"#{Mx[:lv_o]}1:#{Mx[:lv_c]}") - @dob=if @dob =~/^@(?:level|markup):\s/ - @dob=@dob.gsub(/3/,'6'). - gsub(/2/,'5'). - gsub(/1/,'4'). - gsub(/:?C/,'3'). - gsub(/:?B/,'2'). - gsub(/:?A/,'1') - @dob - else @dob - end - else @dob - end - end - def structure_marks - t_o=if @md.markup_version.determined < 0.38 - @t_o=@t_o.gsub(/^1~(\S+)/,"#{Mx[:lv_o]}1:\\1#{Mx[:lv_c]}"). - gsub(/^1~\s+/,"#{Mx[:lv_o]}1:#{Mx[:lv_c]}"). - gsub(/^2~(\S+)/,"#{Mx[:lv_o]}2:\\1#{Mx[:lv_c]}"). - gsub(/^2~\s+/,"#{Mx[:lv_o]}2:#{Mx[:lv_c]}"). - gsub(/^3~(\S+)/,"#{Mx[:lv_o]}3:\\1#{Mx[:lv_c]}"). - gsub(/^3~\s+/,"#{Mx[:lv_o]}3:#{Mx[:lv_c]}"). - gsub(/^4~(\S+)/,"#{Mx[:lv_o]}4:\\1#{Mx[:lv_c]}"). - gsub(/^4~\s+/,"#{Mx[:lv_o]}4:#{Mx[:lv_c]}"). - gsub(/^5~(\S+)/,"#{Mx[:lv_o]}5:\\1#{Mx[:lv_c]}"). - gsub(/^5~\s+/,"#{Mx[:lv_o]}5:#{Mx[:lv_c]}"). - gsub(/^6~(\S+)/,"#{Mx[:lv_o]}6:\\1#{Mx[:lv_c]}"). - gsub(/^6~\s+/,"#{Mx[:lv_o]}6:#{Mx[:lv_c]}"). - gsub(/^[789]~/,'!_') - @t_o - else @t_o - end - end end class OCN def initialize(md,data) -- cgit v1.2.3