summaryrefslogtreecommitdiffstats
path: root/modules/mt-lxx-parallel/convert.pl
diff options
context:
space:
mode:
authorMartin Gruner <mg.pub@gmx.net>2005-11-17 21:03:01 +0000
committerMartin Gruner <mg.pub@gmx.net>2005-11-17 21:03:01 +0000
commit89e2be0015cae6a94c55c511ddc9863e16ae1314 (patch)
treec755412f06cc1d5fd10686f811beea41029e370b /modules/mt-lxx-parallel/convert.pl
parentd7b2907b2906b1fa1da2687ff87de291380469ae (diff)
downloadsword-tools-89e2be0015cae6a94c55c511ddc9863e16ae1314.tar.gz
OT except PS and DAN parses
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@52 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'modules/mt-lxx-parallel/convert.pl')
-rw-r--r--modules/mt-lxx-parallel/convert.pl49
1 files changed, 33 insertions, 16 deletions
diff --git a/modules/mt-lxx-parallel/convert.pl b/modules/mt-lxx-parallel/convert.pl
index 5cca6f9..6d08142 100644
--- a/modules/mt-lxx-parallel/convert.pl
+++ b/modules/mt-lxx-parallel/convert.pl
@@ -224,9 +224,13 @@ my %notes = (
"{t.}" => "Transliterated Hebrew word.", # TODO: unknown
"<t?>" => "Transliterated Hebrew word.", # TODO: unknown
"{t?}" => "Transliterated Hebrew word?",
+
"{c}" => "Unknown.", # TODO: unknown
"{c}?" => "Unknown.", # TODO: unknown
+"{z}" => "Unknown.", # TODO: unknown
"<qla>" => "Unknown.", # TODO: unknown
+"#\"" => "Unknown.", # TODO: unknown
+".vs" => "Unknown.", # TODO: unknown, can hardly be a change of cons. Ezek 40:49
"#" => "Long line continuing in next one, placed both at the end of the line running over and at the beginning of the following line in the opposite column.",
@@ -244,6 +248,7 @@ my %notes = (
"\%vpa" => "Change from passive to active form in verbs.",
"=vpa" => "Change from passive to active form in verbs.", # TODO: my addition, check
"=\%p" => "Difference in preposition or particle.",
+"=p\%" => "Difference in preposition or particle.",
"=\%p?" => "Difference in preposition or particle?",
"=p" => "Difference in preposition or particle.", # TODO: my addition, check, uncertain?
"={d}\%p" => "Difference in preposition or particle.", # TODO: my addition, check, uncertain? DOUBLET?
@@ -370,9 +375,6 @@ sub translateHebrewNote(){
($origNote =~ m/^=?@([?$hebrewLetters]+)/) and
return( &createNote( $notes{ "=\@" } ) . &translateHebrewWordorNote( $1 ) );
- ($origNote =~ m/^={d}@([?$hebrewLetters]+)a/) and #special case ;)
- return( &createNote( $notes{"{d}"} ." ". $notes{ "=\@a" } ) . &translateHebrewWordorNote( $1 ) );
-
($origNote =~ m/^=?\^([?$hebrewLetters]+)/) and
return( "^" . &translateHebrewWordorNote( $1 ) ); # TODO: check, what is ^?
@@ -390,9 +392,6 @@ sub translateHebrewNote(){
elsif ($origNote =~ m/^=([?$hebrewLetters]+)/){
return( &translateHebrewWordorNote( $1 ) );
}
- else {
- goto HANDLE_NOTE_FALLBACK; #try to split up the note
- }
}
#special case: no note, but a crossref (no book ID) # TODO: for now OSIS refs are not parsed
@@ -409,6 +408,9 @@ sub translateHebrewNote(){
($origNote =~ m/^(.+),(.+)$/) and # 2 Notes / Words, split up, but only at the end
return( &translateHebrewWordorNote( $1 ). "," .&translateHebrewWordorNote( $2 ) );
+ ($origNote =~ m/^={d}@([?$hebrewLetters]+)a/) and #special case ;)
+ return( &createNote( $notes{"{d}"} ." ". $notes{ "=\@a" } ) . &translateHebrewWordorNote( $1 ) );
+
HANDLE_NOTE_FALLBACK: for my $i ( 1..(length($origNote)-1) ){ #last try, split up into chunks
my $currentLength = length( $origNote ) - 1 - $i; #start with the longest and become shorter, to find the complicated notes {!}p before the simple {!}
if ( $notes{ substr($origNote,0,$currentLength) } ){
@@ -479,6 +481,9 @@ sub translateGreekNote(){
($origNote =~ m/^=?{c(.+)}/) and
return( &createNote("(".&translateGreekWordorNote( $1 ).") ". $notes{ "{c}" }) ); # TODO: occurs {cXXX}, not documented
+ ($origNote =~ m/^=?{g(.+)}/) and
+ return( &createNote("(".&translateGreekWordorNote( $1 ).") ". $notes{ "{g}" }) );
+
#Special cases: the note includes more than one word, "cat" the results together
($origNote =~ m/^=?{\.\.d([^}]+)$/) and
return( &openNote( $notes{"{..d}"} . "(".&translateGreekWordorNote($1) ." " ) );
@@ -509,12 +514,14 @@ sub translateGreekNote(){
($origNote =~ m/^([^{]+)}\?$/) and
return( &closeNote(&translateGreekWordorNote( $1 )."?)" ) );
- ($origNote =~ m/^{([^}]+}?)$/) and # TODO: occurs, seems unreasonable
- return( "(" .&translateGreekWordorNote($1) ." " );
-
($origNote =~ m/^(.+),(.+)$/) and # 2 Notes / Words, split up, but only at the end
return( &translateGreekWordorNote( $1 ). "," .&translateGreekWordorNote( $2 ) );
+ ($origNote eq "}") and return $origNote; #special case in EZEK 47:20, superfluous bracket
+
+ ($origNote =~ m/^{([^}]+}?)$/) and # TODO: occurs, seems unreasonable
+ return( "(" .&translateGreekWordorNote($1) ." " );
+
HANDLE_NOTE_FALLBACK: for my $i ( 1..(length($origNote)-1) ){ #last try, split up into chunks
my $currentLength = length( $origNote ) - 1 - $i; #start with the longest and become shorter, to find the complicated notes {!}p before the simple {!}
if ( $notes{ substr($origNote,0,$currentLength) } ){
@@ -531,13 +538,14 @@ sub translateHebrewWordorNote(){ #will return unicode hebrew with morph separati
# print("TranslateHebrew of: $hebrew\n");
- ( $hebrew =~ m/^[^$hebrewLetters]/ ) and return &translateHebrewNote( $hebrew );
+ $hebrew =~ s/^mn$/.mn/; #Ezek 24:17, error?
+ ( $notes{ $hebrew } ) and return &translateHebrewNote( $hebrew ); # exact match first
+
+ ( $hebrew =~ m/^[^$hebrewLetters]/ ) and return &translateHebrewNote( $hebrew );
( $hebrew =~ m/^([$hebrewLetters]+)(\[.+\])/ ) and
return &translateHebrewWordorNote( $1 ) . &translateHebrewNote( $2 );
-
( $hebrew =~ m/[}]$/ ) and return &translateHebrewNote( $hebrew );
- ( $notes{ $hebrew } ) and return &translateHebrewNote( $hebrew );
my $length = length($hebrew);
my $index = 0;
@@ -558,6 +566,8 @@ sub translateGreekWordorNote(){
printf("TranslateGreek of $greek\n");
+ ( $notes {$greek} ) and return &translateGreekNote( $greek ); # exact match first
+
( $greek =~ m/^[^$greekLetters]/ ) and return &translateGreekNote( $greek );
( $greek =~ m/[}]\??$/ ) and return &translateGreekNote( $greek );
( $greek eq "#" ) and return &translateGreekNote( "#" );
@@ -604,6 +614,8 @@ sub parseLine(){
$origLine =~ s/{\.\.\^EPIQEI\\S\.\.\^E\)FI\/LHSA}/{..^EPIQEI\\S E)FI\/LHSA}/;# TODO: UGLY HACK, strange note
$origLine =~ s/E\t\)KPE\/SH\|/\tE)KPE\/SH|/; #occurs, tab misplaced
+ $origLine =~ s/^\(..r\(L\/YK}/{..r(L\/YK}/; # in EZEK
+
$origLine =~ m/^W\(\/SPER/ and return; #ignore, probably an error
($origLine eq "W/)T H/GRG\$Y ^ =W/)T W/H/)MRY KAI\\ TO\\N AMORRAI=ON ") and
@@ -829,6 +841,12 @@ sub loadFile(){ #$fileName loads the file into the buffer and makes small correc
elsif ($buffer[$index] =~ m/^ISA/){ # a few lines in ISAIAH have this in different styles
$result[$#result-1] .= $buffer[$index]; # no space
}
+ elsif ($buffer[$index] =~ m/^LAMYAN/){ # in LAM
+ $result[$#result-1] .= $buffer[$index]; # no space
+ }
+ elsif ($buffer[$index] =~ m/^EZEKIHL/){ # in LAM
+ $result[$#result-1] .= $buffer[$index]; # no space
+ }
else{
push(@result, $buffer[$index] );
}
@@ -864,16 +882,15 @@ my @result;
# #This might need special handling
# #push(@result, &processBook("Psalms.par", "Ps", "Ps", "Ps", "Psalms",
#
-#push(@result, &processBook("23.Prov.par", "Prov", "Prov", "Prov", "Proverbs") );
+# push(@result, &processBook("23.Prov.par", "Prov", "Prov", "Prov", "Proverbs") );
# push(@result, &processBook("24.Qoh.par", "Qoh", "Eccl", "Eccl", "Ecclesiastes") );
# push(@result, &processBook("25.Cant.par", "Song", "Song", "Song", "Song of Solomon") );
- push(@result, &processBook("40.Isaiah.par", "Isa", "Isa", "Isa", "Isaiah") );
+# push(@result, &processBook("40.Isaiah.par", "Isa", "Isa", "Isa", "Isaiah") );
# push(@result, &processBook("41.Jer.par", "Jer", "Jer", "Jer", "Jeremiah") );
# push(@result, &processBook("43.Lam.par", "Lam", "Lam", "Lam", "Lamentations") );
# push(@result, &processBook("44.Ezekiel.par", "Ezek", "Ezek", "Ezek", "Ezekiel") );
#
-# my @danielTmp = &processBookVariant("45.DanielOG.par", "Dan", "Old Greek:", "46.DanielTh.par", "DanTh", "Theodotion:", "Dan", "Dan", "Daniel");
-# push(@result, &fixDaniel( @danielTmp ) );
+ push(@result, &processBookVariant("45.DanielOG.par", "Dan", "Old Greek:", "46.DanielTh.par", "DanTh", "Theodotion:", "Dan", "Dan", "Daniel"));
#
# push(@result, &processBook("28.Hosea.par", "Hos", "Hos", "Hos", "Hosea") );
# push(@result, &processBook("31.Joel.par", "Joel", "Joel", "Joel", "Joel") );