summaryrefslogtreecommitdiffstats
path: root/modules/portuguese/transform.pl
diff options
context:
space:
mode:
authorPeter von Kaehne <refdoc@gmx.net>2010-09-09 22:47:43 +0000
committerPeter von Kaehne <refdoc@gmx.net>2010-09-09 22:47:43 +0000
commitb270e5b7f32e5783cd130a789ec3c8b3094186f7 (patch)
tree4e3899e741b0b2be69885248e65cc514dc1e3796 /modules/portuguese/transform.pl
parentcc17b87634e36b66d082e79e395a620ec26997bd (diff)
downloadsword-tools-b270e5b7f32e5783cd130a789ec3c8b3094186f7.tar.gz
The portuguese module scripts
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@302 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'modules/portuguese/transform.pl')
-rwxr-xr-xmodules/portuguese/transform.pl78
1 files changed, 78 insertions, 0 deletions
diff --git a/modules/portuguese/transform.pl b/modules/portuguese/transform.pl
new file mode 100755
index 0000000..a9d308b
--- /dev/null
+++ b/modules/portuguese/transform.pl
@@ -0,0 +1,78 @@
+#!/usr/bin/perl
+
+
+my @files=`ls -1 *.xml`;
+# my @ident=`cat books`;
+
+foreach (@files){
+
+ my @lines;
+ my @text;
+ my $tag;
+ # my %vs;
+ # my %kw;
+
+ chop;
+ open SIMPLE, ">>$_.simple.xml";
+ chomp(@lines=`cat $_`);
+ # @lines[1]="\\id @ident[$_-1] ";
+
+
+ foreach (@lines) {
+
+ s/(size=\"17\"\ face=\".*?\-Bold\"\ color=\"\#EC008C\")/class=\"bookname\"\ \ $1/g;
+ s/(size=\"4\"\ face=\".*?\-Roman\"\ color=\"\#231F20\")/class=\"verse_no\"\ \ $1/g;
+ s/(size=\"8\"\ face=\".*?\-Roman\"\ color=\"\#231F20\")/class=\"maintext\"\ \ $1/g;
+ s/(size=\"8\"\ face=\".*?\-Bold\"\ color=\"\#EC008C\")/class=\"section_title\"\ $1/g;
+ s/(size=\"7\"\ face=\".*?\-Bold\"\ color=\"\#231F20\")/class=\"refverse_no\"\ $1/g;
+ s/(size=\"9\"\ face=\".*?\-Bold\"\ color=\"\#231F20\">)/class=\"refchapter_no\"\ $1/g;
+ s/<font\s*size=\"7\"\s*face=\".*?ZapfDingbats\"\s*color=\"\#231F20\">\s*.<\/font>//g;
+ s/(size=\"7\"\ face=\".*?\-Roman\"\ color=\"\#231F20\")/class=\"ref_text\"\ $1/g;
+ s/(size=\"7\"\ face\=\".*?\+Helvetica\"\ color=\"\#231F20\")/class=\"page_footer\"\ $1/g;
+ s/(size=\"6\"\ face=\".*?\-Roman\"\ color=\"\#231F20\")/class=\"Lords_Name\"\ $1/g;
+ # s/(size=\"8\"\ face=\".*?\-Bold\"\ color=\"\#EC008C\")/class=\"Intro_title\"\ $1/g;
+ s/<text.*?>/<text>\ $1/g;
+ s/(size=\"7\"\ face=\".*?\-Italic\"\ color=\"\#231F20\")/class=\"ref_key\"\ $1/g;
+ s/(size=\"20\"\ face=\".*?\-Bold\"\ color=\"\#6D6E70\")/class=\"chapter\"\ $1/g;
+ s/(size=\"8\"\ face=\".*?\-Italic\"\ color=\"\#231F20\")/class=\"intro_para\"\ $1/g;
+ s/(size=\"6\"\ face=\".*?\-Italic\"\ color=\"\#231F20\")/class=\"bookname2\"\ $1/g;
+ s/$/\n/;
+ }
+
+
+ foreach (@lines) {
+
+
+
+ s/<font\ class=\"(.*?)\".*?>/<$1>/;
+ $tag = $1;
+ s/<\/font/"<\/".$tag/e;
+ s/<\/>/<\/font>/;
+ }
+
+
+ $text = join ("",@lines);
+
+
+ $text =~ s/\n\s*<text>//g;
+ $text =~ s/<\/text>(\n\s*|)//g;
+ $text =~ s/(.)<\/intro_para>\n\s*<bookname2>\ (.*?)<\/bookname2>\n\s*<intro_para>/<bookname2>$1$2<\/bookname2>/g;
+ $text =~ s/(S)<\/maintext>\n\s*<Lords_Name>\s*(ENHOR)<\/Lords_Name>\n\s*<maintext>/<Lords_Name>$1$2<\/Lords_Name>/g;
+ $text =~ s/(<verse_no>.*?<\/verse_no>)\n\s*(<maintext>.*?<\/maintext>)\n\s*?:(<verse_no>)/<verse>$1$2<\/verse>\n<verse_no>/g;
+
+ # @lines = split(/\n/,$text);
+ # foreach (@lines) {
+
+
+
+
+ print (SIMPLE $text);
+ close SIMPLE;
+
+
+}
+
+
+
+
+