[sword-svn] r302 - in trunk/modules: . portuguese
refdoc at crosswire.org
refdoc at crosswire.org
Thu Sep 9 15:47:43 MST 2010
Author: refdoc
Date: 2010-09-09 15:47:43 -0700 (Thu, 09 Sep 2010)
New Revision: 302
Added:
trunk/modules/portuguese/
trunk/modules/portuguese/transform.pl
trunk/modules/portuguese/transform.xsl
Log:
The portuguese module scripts
Added: trunk/modules/portuguese/transform.pl
===================================================================
--- trunk/modules/portuguese/transform.pl (rev 0)
+++ trunk/modules/portuguese/transform.pl 2010-09-09 22:47:43 UTC (rev 302)
@@ -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 ("", at 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;
+
+
+}
+
+
+
+
+
Property changes on: trunk/modules/portuguese/transform.pl
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/modules/portuguese/transform.xsl
===================================================================
--- trunk/modules/portuguese/transform.xsl (rev 0)
+++ trunk/modules/portuguese/transform.xsl 2010-09-09 22:47:43 UTC (rev 302)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text"/>
+
+<xsl:template match="/"><xsl:apply-templates/></xsl:template>
+<xsl:template match="page"><xsl:apply-templates/></xsl:template>
+<xsl:template match="page_footer"><xsl:apply-templates/></xsl:template>
+<xsl:template match="maintext"><xsl:apply-templates/></xsl:template>
+
+<xsl:template match="chapter">
+\c<xsl:value-of select="."/></xsl:template>
+
+<xsl:template match="verse_no">
+\v<xsl:value-of select="."/></xsl:template>
+
+
+
+<xsl:template match="intro_para"></xsl:template>
+
+<xsl:template match="bookname">
+\mt<xsl:value-of select="."/>
+\p
+</xsl:template>
+
+<xsl:template match="section_title">
+\s<xsl:value-of select="."/>
+\p
+</xsl:template>
+
+<xsl:template match="Lords_Name">\nd <xsl:value-of select="."/> \nd*</xsl:template>
+
+<xsl:template match="ref_text"></xsl:template>
+<xsl:template match="ref_key"></xsl:template>
+<xsl:template match="ref_no"></xsl:template>
+<xsl:template match="refverse_no"></xsl:template>
+<xsl:template match="refchapter_no"></xsl:template>
+<xsl:template match="font"></xsl:template>
+<xsl:template match="page_footer/img">IMAGE</xsl:template>
+<xsl:template match="title"></xsl:template>
+
+
+
+
+<xsl:strip-space elements="*"/>
+
+
+</xsl:stylesheet>
+
+
More information about the sword-cvs
mailing list