From 2efb463de00da866e3ee047e95c9e647f8bae166 Mon Sep 17 00:00:00 2001 From: Peter von Kaehne Date: Tue, 2 Feb 2010 18:34:52 +0000 Subject: poetic lines work now git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@275 07627401-56e2-0310-80f4-f8cd0041bdcd --- modules/geneve/transform.pl | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/geneve/transform.pl b/modules/geneve/transform.pl index 3f94b95..170345e 100755 --- a/modules/geneve/transform.pl +++ b/modules/geneve/transform.pl @@ -1,5 +1,25 @@ #!/usr/bin/perl +sub vs2osis { + + my $context = $_[0]; + $context =~ s/([1-5]?[A-Z][a-z]+)\ .*/$1/; + + my $ref = $_[0]; + $ref =~ s/,/:/; + + my $return = `vs2osisref "$ref" $context de`; + $return =~ s/\n$//; + $return; + } + + +sub einleitung { + $return = $_[0]; +# $return =~ s/(([12345]?[A-Z][a-z]+)(;?\s[0-9]+(,[0-9]+(\-[0-9]+)?)?)+)(\s|\)|;)/\\rq\ $1\ \\rq*/g; + $return; + } + sub footnote { $return = $_[0]; @@ -8,7 +28,7 @@ sub footnote { $return =~ s/\]/\ \\add\*\ /g; $return =~ s/^\s*\(([0-9]+),([0-9]+)\)\s+/\ \\fr\ $1,$2\ \\ft\ /; $return =~ s/(w|od|bed|eig)\.\ /$1\.\ \\fqa\ /g; - $return =~ s/(bersetzung|bersetzen|)\:\ /$1\.\ \\fqa\ /g; + $return =~ s/(bersetzung|bersetzen|wiedergegeben)\:\ /$1\.\ \\fqa\ /g; $return =~ s/(=\ )/$1\.\ \\fqa\ /g; $return =~ s/(\\fqa\ .*?)\\fqa/$1\ /g; $return; @@ -50,6 +70,8 @@ foreach (@files){ s/props\=\".*?\"//g; s/(.*?)<\/c><\/p>/\n\\c\ $1\ \n\\v\ 1\ \ /g; s/Psalm\ (.*?)<\/c>($/\n\\c\ $1\n\\s1\ Psalm\ $1\ $2\n\\p/g; + s//\n\\q\ /g; + s/\\q\s+(.*?)<\/c>/\n\\v\ $1\ \n\\q /g; s/(.*?)<\/c>/\n\\v\ $1\ \ /g; s//\n\\mt\ /g; s//\n\\imt\ Einleitung\n\\ip\ /g; @@ -68,7 +90,7 @@ foreach (@files){ s/<\/c>//g; s/(.*?)<\/c>/$1\ \\x\ \\xk\ $1\\x\*\ /g; - + s//\n\\q\ /g; s/xid\=\".*?\"//g; s/<.*?>//g; @@ -94,10 +116,15 @@ foreach (@files){ s/\\f\ \+(.*?)\\f\*/"\\f +".footnote($1)." \\f*"/eg; s/^\\r\s+(Kapitel|\(Psalm)/\\mr $1/g; + s/^\\ip(.*?)$/"\\ip".einleitung($1)/eg; s/^\s*\\s2...$//; - s/\s+/\ /g; + s/^\\q\s*$//g; + s/^\s*$//g; + s/\s+([\,\.\;\:])/$1\ /g; + s/\s+/\ /g; + s/^$//; s/$/\n/; } @@ -106,6 +133,13 @@ foreach (@files){ s/\\v\ 1\s/\\c\ 1\n\\v\ 1\ /; } } + for ($i=0; $i<=@lines; $i++) { + if (@lines[$i]=~/^\\s2/) { + if (@lines[$i+1]=~/^\\q/) { + @lines[$i+1] =~ s/\\q/\\mt2/; + } + } + } for ($i=0; $i<=@lines; $i++) { if (@lines[$i]=~/^\\mr/) { @@ -147,7 +181,9 @@ foreach (@files){ } } } - + foreach (@lines) { + s/^$//; + } print (USFM @lines); close USFM; } -- cgit