[sword-svn] r275 - trunk/modules/geneve
refdoc at crosswire.org
refdoc at crosswire.org
Tue Feb 2 11:34:52 MST 2010
Author: refdoc
Date: 2010-02-02 11:34:52 -0700 (Tue, 02 Feb 2010)
New Revision: 275
Modified:
trunk/modules/geneve/transform.pl
Log:
poetic lines work now
Modified: trunk/modules/geneve/transform.pl
===================================================================
--- trunk/modules/geneve/transform.pl 2010-01-30 18:24:32 UTC (rev 274)
+++ trunk/modules/geneve/transform.pl 2010-02-02 18:34:52 UTC (rev 275)
@@ -1,6 +1,26 @@
#!/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];
$return =~ s/type=\"footnote_anchor\"\ style=\"\"\ xid=\".*?\"\ >//g;
@@ -8,7 +28,7 @@
$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 @@
s/props\=\".*?\"//g;
s/<p\ style=\"Kapitel\".*?><c.*?>(.*?)<\/c><\/p>/\n\\c\ $1\ \n\\v\ 1\ \ /g;
s/<p\ style=\"Psalm Nr\".*?><c.*?>Psalm\ (.*?)<\/c>(<field.*?|)<\/p>$/\n\\c\ $1\n\\s1\ Psalm\ $1\ $2\n\\p/g;
+ s/<p\ style=\"Textspalte links\".*?>/\n\\q\ /g;
+ s/\\q\s+<c\ style=\"Verszahl\".*?>(.*?)<\/c>/\n\\v\ $1\ \n\\q /g;
s/<c\ style=\"Verszahl\".*?>(.*?)<\/c>/\n\\v\ $1\ \ /g;
s/<p\ style=\"Buchtitel\".*?>/\n\\mt\ /g;
s/<p\ style=\"Bucheinleitung\".*?>/\n\\imt\ Einleitung\n\\ip\ /g;
@@ -68,7 +90,7 @@
s/<c\ style=\"Verweiswort\".*?><\/c>//g;
s/<c\ style=\"Verweiswort\".*?>(.*?)<\/c>/$1\ \\x\ \\xk\ $1\\x\*\ /g;
-
+ s/<br\/>/\n\\q\ /g;
s/xid\=\".*?\"//g;
s/<.*?>//g;
@@ -94,10 +116,15 @@
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 @@
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 (@lines) {
+ s/^$//;
+ }
print (USFM @lines);
close USFM;
}
More information about the sword-cvs
mailing list