summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorPeter von Kaehne <refdoc@gmx.net>2010-02-02 18:34:52 +0000
committerPeter von Kaehne <refdoc@gmx.net>2010-02-02 18:34:52 +0000
commit2efb463de00da866e3ee047e95c9e647f8bae166 (patch)
treedc0308e181fd6fefdab410e66f8f7fd0678e710c /modules
parent7418ad6b59094e4d4683eb5310aff95c2832bb28 (diff)
downloadsword-tools-2efb463de00da866e3ee047e95c9e647f8bae166.tar.gz
poetic lines work now
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@275 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/geneve/transform.pl44
1 files changed, 40 insertions, 4 deletions
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/<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 @@ foreach (@files){
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 @@ 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;
}