next up previous
Next: 3.5 Status Up: 3 Annotation Previous: 3.3 Input Formats

3.4 The Annotation Process

This project could not have been undertaken if the input or target formats required any but the most minimal manual effort. Fortunately, it appears that a simple perl script suffices for each of the versions we have looked at so far, and once a script has been written for one language it is adapted fairly easily for others. We do not yet have firm data on how long it takes to write or adapt scripts, but in simple cases scripts have been written and executed in less than an hour; we are confident that an input version in any given language should not require more than a few days' effort at the outside. While code fragments are generally not suitable for inclusion in a paper of this kind, the simplicity of the program's main loop should be apparent even for those not familiar with the perl programming language:

  while (<STDIN>)
  {
    if (($chapter, $verse, $line) = /^(\d+):(\d+)\s+(.*)\r$/)
    {
      # Possibly deal with boundary between chapters
      if ($chapter != $current_chapter)
      {
         # Close old chapter element if there is one
         # and upate current chapter
         if ($current_chapter != 0) 
         { 
            print "</c>\n"; 
         } 

         # Open new chapter element
         $current_chapter = $chapter;
         print "<c id=\"$book:$chapter\">\n";
      }

      # Print verse element
      print "<v id=\"$book:$chapter:$verse\">$line</v>\n";

    }
  }

next up previous
Next: 3.5 Status Up: 3 Annotation Previous: 3.3 Input Formats

Philip Resnik
Tue Oct 21 19:23:13 EDT 1997