summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter von Kaehne <refdoc@gmx.net>2009-12-30 00:00:14 +0000
committerPeter von Kaehne <refdoc@gmx.net>2009-12-30 00:00:14 +0000
commit03005158d9a910699256e9cec660af2a5a2ebf2c (patch)
treeff77dc06032f3ff8cf6a0fa1220668526473b2f3
parentc8deb706d6fbdf34f663e7e71d628e6b5d1f31ee (diff)
downloadsword-tools-03005158d9a910699256e9cec660af2a5a2ebf2c.tar.gz
dictionary transformation added. Needs still handling of verse references
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@261 07627401-56e2-0310-80f4-f8cd0041bdcd
-rwxr-xr-xmodules/geneve/wb.pl70
1 files changed, 70 insertions, 0 deletions
diff --git a/modules/geneve/wb.pl b/modules/geneve/wb.pl
new file mode 100755
index 0000000..da8bfc2
--- /dev/null
+++ b/modules/geneve/wb.pl
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+
+my @files=`ls -1 *.abw`;
+
+foreach (@files){
+
+ my @lines;
+ chop;
+ open USFM, ">>$_.tei";
+ @lines=`cat $_`;
+
+
+ foreach (@lines) {
+ s/props\=\".*?\"//g;
+
+ # entry (ordinary)
+ s/<p\ style=\"T3\".*?><c.*?>(.*?)<\/c><c.*?><\/c><\/p>/<\/entryFree>\n<entryFree\ sortKey=\"$1\"\ split=\"$1\"><form\ type=\"headword\"><orth\ rend\=\"bold\">$1<\/orth><\/form>/g;
+
+ # entry (referring somewhere else)
+ s/<p\ style=\"T3\".*?><c.*?>(.*?)<\/c><c.*?><\/c><c.*?>s\.(.*?)<\/c><\/p>/<\/entryFree>\n<entryFree\ sortKey=\"$1\"\ split=\"$1\"><form\ type=\"headword\"><orth\ rend\=\"bold\">$1<\/orth><\/form>\n\t<ref target=\"$2\">s\.\ $2<\/ref>/g;
+
+ # content
+ s/<p.*?>(.*?)<\/p>/\t<def>\n\t\t$1\n\t<\/def>/;
+ s/<c\ style=\"Kursiv ZF\"\ >(.*?)<\/c>/<hi rend=\"italic\">$1<\/hi>/g;
+
+
+ # clean up
+ s/<c.*?>//g;
+ s/<\/c\s*>//g;
+
+ }
+ print (USFM "<?xml\ version=\"1.0\"\ encoding=\"utf-8\"?>\n<TEI\ xmlns=\"http://www.crosswire.org/2008/TEIOSIS/namespace\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xsi:schemaLocation=\"http://www.crosswire.org/2008/TEIOSIS/namespace
+ http://www.crosswire.org/OSIS/teiP5osis.1.4.xsd\">
+
+ <teiHeader>
+ <fileDesc>
+ <titleStmt>
+ <title>Worterklaerung Schlachter</title>
+ <author></author>
+ </titleStmt>
+
+ <editionStmt>
+ <edition></edition>
+ </editionStmt>
+
+ <publicationStmt>
+ <publisher></publisher>
+ <date></date>
+ </publicationStmt>
+
+ <sourceDesc><p>http://sourceforge.net/project/showfiles.php?group_id=89078&amp;package_id=93370&amp;release_id=278981</p></sourceDesc>
+ </fileDesc>
+
+ <revisionDesc>
+ <change when=\"2008-11-25\">initial conversion to TEI</change>
+ </revisionDesc>
+ </teiHeader>
+
+ <text>
+ <body>");
+
+
+
+
+ print (USFM @lines,"\n");
+
+ print (USFM "</body>\n</text>\n</TEI>");
+ close USFM;
+}