summaryrefslogtreecommitdiffstats
path: root/versification
diff options
context:
space:
mode:
Diffstat (limited to 'versification')
-rw-r--r--versification/v11nsys.pl41
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;