work on tagged OGNT

This commit is contained in:
Henry Whitney 2020-06-18 17:44:16 -04:00
parent 7c454c4ce3
commit 2f76e751b4
1 changed files with 8 additions and 8 deletions

View File

@ -7,7 +7,7 @@ use utf8;
#use open IN => ":utf8", OUT => ":utf8";
use open IO => ":utf8";
binmode STDOUT, ":encoding(UTF-8)";
mkdir "OGNT";
mkdir "OGNT_for_tagging";
mkdir "Logs";
open LOG, ">Logs/log.log";
@ -34,7 +34,7 @@ while (<IN>) {
Separate();
}
say OUT " </verse>\n </chapter>\n </book>\n</xml>";
say OUT " </verse>\n </chapter>\n </div>\n </book>\n</xml>";
say "Closing input and output files ...";
@ -54,23 +54,23 @@ sub Separate {
my ($this_bk) = ($bk{$bn});
$bklc = lc $bk{$bn};
if (OUT-> opened()) {
say OUT " </verse>\n </chapter>\n </book>\n</xml>";
say OUT " </verse>\n </chapter>\n </div>\n </book>\n</xml>";
close OUT;
}
open OUT, ">:utf8", "OGNT/$bn-$bk{$bn}.xml" or die "$! $bn-$bk{$bn}.xml";
say OUT "\n<xml>\n <div type=\"book\" osisID=\"$bklc\">\n <chapter osisID=\"$bklc.$ch\">\n <verse osisID=\"$bklc.$ch.$vs\">";
open OUT, ">:utf8", "OGNT_for_tagging/$bn-$bk{$bn}.xml" or die "$! $bn-$bk{$bn}.xml";
say OUT "\n<xml>\n <book>\n <div type=\"book\" osisID=\"$bklc\">\n <chapter osisID=\"$bklc.$ch\">\n <verse osisID=\"$bklc.$ch.$vs\">";
($last_bn, $last_ch, $last_vs) = ($bn, $ch, $vs)
}
elsif ($ch ne $last_ch) {
say OUT " </verse>\n </chapter>\n <chapter osisID=\"$bklc.$ch\">\n <verse osisID=\"$bklc.$ch.$vs\">";
say OUT " </verse>\n </chapter>\n <chapter osisID=\"$bklc.$ch\">\n <verse osisID=\"$bklc.$ch.$vs\">";
($last_ch, $last_vs) = ($ch, $vs)
}
elsif ($vs ne $last_vs) {
my ($this_bk, $bklc) = ($bk{$bn}, lc $bk{$bn});
say OUT " </verse>\n <verse osisID=\"$bklc.$ch.$vs\">";
say OUT " </verse>\n <verse osisID=\"$bklc.$ch.$vs\">";
$last_vs = $vs;
}
say OUT "\t\t\t\t<w OGNTsort=\"$OGNTSort\" ULBorder=\"\<##\>\"lemma=\"$sn\" morph=\"$gram\" lexeme=\"$lexeme\">$word</w>"
say OUT "\t\t\t\t\t<w OGNTsort=\"$OGNTSort\" ULBorder=\"\<##\>\"lemma=\"G$sn\" morph=\"$gram\" lexeme=\"$lexeme\">$word</w>"
}
}