[sword-svn] r517 - trunk/modules/conf

refdoc at crosswire.org refdoc at crosswire.org
Sat Oct 28 09:21:18 MST 2017


Author: refdoc
Date: 2017-10-28 09:21:17 -0700 (Sat, 28 Oct 2017)
New Revision: 517

Modified:
   trunk/modules/conf/confmaker.pl
Log:
added calculation of MinimumVersion number, based on the given v11n


Modified: trunk/modules/conf/confmaker.pl
===================================================================
--- trunk/modules/conf/confmaker.pl	2017-10-28 14:30:00 UTC (rev 516)
+++ trunk/modules/conf/confmaker.pl	2017-10-28 16:21:17 UTC (rev 517)
@@ -47,10 +47,37 @@
 use Sword;
 use HTML::Strip;
 
+my %version	 = (  KJV     		=> '1.5.9',
+                      KJVA    		=> '1.6.0',
+                      NRSV    		=> '1.6.0',
+                      NRSVA		=> '1.6.0',
+                      MT		=> '1.6.0',
+                      Leningrad		=> '1.6.0',
+                      Synodal		=> '1.6.1',
+                      Vulg		=> '1.6.1',
+                      Luther		=> '1.6.1',
+                      German		=> '1.6.1',
+                      Catholic		=> '1.6.2',
+                      Catholic2		=> '1.6.2',
+                      LXX		=> '1.7.2',
+                      Orthodox		=> '1.7.2',
+                      SynodalProt	=> '1.7.2',
+                      DarbyFr		=> '1.8.0',
+                      Segond		=> '1.8.0',
+                      Calvin		=> '1.8.0'
+                   );
+
+my @av11n	= ( 'KJV', 'KJVA', 'NRSV', 'NRSVA', 'MT', 'Leningrad', 'Synodal', 'Vulg', 
+                    'Luther', 'German', 'Catholic', 'Catholic2', 'LXX', 'Orthodox', 
+                    'SynodalProt', 'DarbyFR', 'Segond', 'Calvin' 
+                  );
+                  
+my $v11n	= "KJV"; # If the script is called without a v11n chosen it will set KJV as standard. 
+
 ## Obtain arguments
 if (scalar(@ARGV) < 1) {
     print "\nconfmaker.pl -- - provides a initial conf file for a new module by analysing  given OSIS xml file.\n";
-    print "Syntax: confmaker.pl <osis XML file> [-o <conf-output-file>] [-i <conf-input-file>] [-m] [-l <language-code>]\n";
+    print "Syntax: confmaker.pl <osis XML file> [-o <conf-output-file>] [-i <conf-input-file>] [-m] [-l <language-code>] [-v <v11n>]\n";
     print "- Arguments in braces < > are required. Arguments in brackets [ ] are optional.\n";
     print "- If no -o option is specified <STDOUT> is used.\n";
     print "- if the -m option is used no -i option may be used. -m expects parametres added by other means, e.g. a makefile";
@@ -78,7 +105,7 @@
 
 if (@ARGV[$nextarg] eq "-m") {
        if ($inputFileName) {
-          print "You can not define both an input file and use the -m option, sorry...\n";
+          print STDERR "You can not define both an input file and use the -m option, sorry...\n";
           exit 1;}
        $makefile=true;
        $nextarg +=1;
@@ -89,6 +116,10 @@
        $nextarg += 2;
        }
 
+if (@ARGV[$nextarg] eq "-v") {
+       $v11n = "@ARGV[$nextarg+1]";
+       }
+
  
 
 my $parser = XML::LibXML->new();
@@ -99,7 +130,7 @@
 $manager->setGlobalOption("Hebrew Vowel Points", "Off");
 $manager->setGlobalOption("Hebrew Cantillation", "Off");
 $manager->setGlobalOption("Arabic Vowel Points", "Off");
-#$manager->setGlobalOption("Greek Accents", "Off");
+$manager->setGlobalOption("Greek Accents", "Off");
 
 my $hs = HTML::Strip->new();
 my $doc_text = new Sword::SWBuf($hs->parse($doc->toString()));
@@ -131,7 +162,24 @@
    $doc_lang_name = I18N::LangTags::List::name($language);
    }
 
+if (!(exists $version{$v11n}))  {
+    print STDERR "This versification does not exist (yet) \n";
+    print STDERR "Valid versfication systems are\n\t";
 
+    my $notmorethan4 = 1;
+    foreach (@av11n) {
+      $notmorethan4++;
+      if ($notmorethan4 <= 5) {
+        print STDERR "$_ ";
+      }
+      else {
+        print STDERR "\n\t$_ ";
+        $notmorethan4 = 2;
+      }
+    }
+    print STDERR "\n";
+    exit(-1);
+  }
 
 ##GlobalOptionsFilter - prepare
 
@@ -271,6 +319,8 @@
    }
 
 print  "LCSH=".$doc_type.".".I18N::LangTags::List::name($doc_lang)."\n";
+print "MinimumVersion=".$version{$v11n}."\n";
+print "Versification=".$v11n."\n";
 
 if (@inputFile>0) {
    foreach(@inputFile) {




More information about the sword-cvs mailing list