diff options
author | Chris Little <chrislit@crosswire.org> | 2009-03-12 11:10:36 +0000 |
---|---|---|
committer | Chris Little <chrislit@crosswire.org> | 2009-03-12 11:10:36 +0000 |
commit | f267de0ade85c6cfb926f4a3cb5a3c65f8066483 (patch) | |
tree | e7c7d7863b92cba7dd73a5dfa8f0a34e62f292cb /versification | |
parent | 0443d34ddc62566211fcca90f827950a0629772c (diff) | |
download | sword-tools-f267de0ade85c6cfb926f4a3cb5a3c65f8066483.tar.gz |
extended v11n system converter to derive a v11n definition from a VPL file
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@164 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'versification')
-rw-r--r-- | versification/v11nsys.pl | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/versification/v11nsys.pl b/versification/v11nsys.pl index 44b8349..bec4300 100644 --- a/versification/v11nsys.pl +++ b/versification/v11nsys.pl @@ -58,15 +58,34 @@ foreach $mapfile (@canons) { close (MAP);
}
-opendir (DIR, ".");
-@srcfiles = grep /Bible\.[^\.]+\.xml$/, readdir DIR;
-closedir(DIR);
+if (@ARGV[0] ne "") {
+ $n = 0;
+ while (@ARGV[$n] ne "") {
+ push @srcfiles, @ARGV[$n];
+ $n++;
+ }
+ $vplStyle = true;
+}
+else {
+ opendir (DIR, ".");
+ @srcfiles = grep /Bible\.[^\.]+\.xml$/, readdir DIR;
+ closedir(DIR);
+ $vplStyle = false;
+}
foreach $infile (@srcfiles) {
- $infile =~ /Bible\.([^\.]+)\.xml/;
- $v11n = $1;
- $outfile = lc("v11n$1.h");
+ if ($infile =~ /^Bible.+xml$/) {
+ $infile =~ /^Bible\.([^\.]+)\.xml/;
+ $v11n = $1;
+ $outfile = lc("v11n$1.h");
+ }
+ else {
+ $v11n = $infile;
+ $v11n =~ s/\.[^\.]*$//;
+ $v11n =~ s/^.+\///;
+ $outfile = lc("v11n$v11n.h");
+ }
open INF, $infile;
open OUTF, ">$outfile";
@@ -94,9 +113,17 @@ foreach $infile (@srcfiles) { $line = cleanupLine($line);
+ $osisID = "";
+
if ($line =~ /<osisID.+?code=\"(.+?)\"\/>/) {
$osisID = $1;
-
+ }
+ elsif ($vplStyle == true && $line =~ /^([^ ]+ [^ :]+:[^ :]+)/) {
+ $osisID = $1;
+ $osisID =~ s/[ :]/\./g;
+ }
+
+ if ($osisID ne "") {
$lastBook = $thisBook;
$lastChap = $thisChap;
$lastVers = $thisVers;
|