#!/usr/bin/perl my @osis_books = qw(Gen Exod Lev Num Deut Josh Judg Ruth 1Sam 2Sam 1Kgs 2Kgs 1Chr 2Chr Ezra Neh Esth Job Ps Prov Eccl Song Isa Jer Lam Ezek Dan Hos Joel Amos Obad Jonah Mic Nah Hab Zeph Hag Zech Mal Matt Mark Luke John Acts Rom 1Cor 2Cor Gal Eph Phil Col 1Thess 2Thess 1Tim 2Tim Titus Phlm Heb Jas 1Pet 2Pet 1John 2John 3John Jude Rev); my $last_ref = undef; my $last_book = undef; my $last_chapter = undef; my $last_verse = undef; my $_workID = 'MorphGNT'; my $_workName = 'MorphGNT'; my $_lang = 'gr'; my $_year = '2006'; # # Print the OSIS header. # print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "$_workName\n"; print "Bible.$_lang.$_workID.$_year\n"; print "Bible\n"; print "\n"; print "\n"; print "Bible\n"; print "\n"; print "
\n"; # # Print the text. # XXX morph # XXX part of speech # while () { chomp; my ($ref, $pos, $parse, $form, $lemma) = split(/\s+/, $_, 5); my ($book, $chapter, $verse) = $ref =~ /(\d\d)(\d\d)(\d\d)/; $book += 39; # 01 = Matthew my $osisID = sprintf("%s.%d.%d", $osis_books[$book - 1], $chapter, $verse); if ($ref != $last_ref) { print $close_verse, "\n" if $close_verse and $last_verse != $verse; print $close_chapter, "\n" if $close_chapter and $last_chapter != $chapter; print "\n" if defined $last_book and $last_book != $book; my $osis_id = $osis_books[$book - 1]; if ($last_book != $book) { print "
\n"; $last_book = $book; } $osis_id .= '.' . $chapter; if ($last_chapter != $chapter) { print "
\n"; $close_chapter = "
\n"; $last_chapter = $chapter; } $osis_id .= '.' . $verse; if ($last_verse != $verse) { print "\n"; $close_verse = ""; $last_verse = $verse; } } # XXX Convert morphological codes to Robinson or Packard? printf('%s ', $lemma, $parse, $form) if $form; $last_ref = $ref; } print $close_verse, "\n" if $close_verse; print $close_chapter, "\n" if $close_chapter; print "
\n" if defined $last_book; print "
\n"; print "
\n";