From 6cef237f0b55a03ded27daff9ccb4b7dffdedc19 Mon Sep 17 00:00:00 2001 From: Peter von Kaehne Date: Sat, 28 Oct 2017 16:21:17 +0000 Subject: added calculation of MinimumVersion number, based on the given v11n git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@517 07627401-56e2-0310-80f4-f8cd0041bdcd --- modules/conf/confmaker.pl | 56 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/modules/conf/confmaker.pl b/modules/conf/confmaker.pl index 355e7e1..e2c411d 100755 --- a/modules/conf/confmaker.pl +++ b/modules/conf/confmaker.pl @@ -47,10 +47,37 @@ use utf8; 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 [-o ] [-i ] [-m] [-l ]\n"; + print "Syntax: confmaker.pl [-o ] [-i ] [-m] [-l ] [-v ]\n"; print "- Arguments in braces < > are required. Arguments in brackets [ ] are optional.\n"; print "- If no -o option is specified 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 "-i") { 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 @@ if (@ARGV[$nextarg] eq "-l") { $nextarg += 2; } +if (@ARGV[$nextarg] eq "-v") { + $v11n = "@ARGV[$nextarg+1]"; + } + my $parser = XML::LibXML->new(); @@ -99,7 +130,7 @@ my $manager = new Sword::SWMgr(); $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 @@ if ((length($language)>0) && (length($doc_lang)==0)) { $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 @@ if ($doc_has_feature{'p'}) { } 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) { -- cgit