[sword-cvs] swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS WLC2OSIS.java, NONE, 1.1 WLC2OSISMain.java, NONE, 1.1 package.html, NONE, 1.1

sword at www.crosswire.org sword at www.crosswire.org
Fri Jun 4 02:14:54 MST 2004


Committed by: mgruner

Update of /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS
In directory www:/tmp/cvs-serv15120/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS

Added Files:
	WLC2OSIS.java WLC2OSISMain.java package.html 
Log Message:
initial import of source files for the new BHS-replacement WLC (Westminster Leningrad Codex).
Not functional yet at all.

--- NEW FILE: WLC2OSIS.java ---
package WLC2OSIS ;

import WLC2OSIS.GUI.* ;
import WLC2OSIS.Parse.* ;
import WLC2OSIS.Translate.* ;
import WLC2OSIS.Utilities.* ;
import Utilities.* ;

import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
//=================================================================================================
/**
*
* <b>Core of WLC2OSIS, set Strings here before running program.<p></b>
*
*/
//=================================================================================================

public class WLC2OSIS implements Stoppable {

// Definitions of input and output to be set by user.

public String ProgramDate = "30 May 2004" ;
public String DefaultInputFilename = "" ;
public String InputFilename ;
public String DefaultInputDate = "5 March 2004" ;
public String Date ;
public String DefaultOutputDirectory = "" ;
public String OutputDirectory ;
// Define the title and descriptions.
public String Title = "The Westminster Leningrad Codex (WLC)" ;

public String ShortDescription = "from the electronic version of the Leningrad Codex "
    + "maintained by the Westminster Hebrew Institute." ;
    
public String[] Description = {
   "This text began as an electronic transcription by Whitaker and Parunak of the 1983 "
 + "printed edition of Biblia Hebraica Stuttgartensia (BHS). The " 
 + "transcription is called the Michigan-Claremont electronic text and was archived "
 + "at the Oxford Text Archive (OTA) in 1987. "
 + "Since that time, the text has been modified to "
 + "conform to the photo-facsimile of the Leningrad Codex, Firkovich "
 + "B19A, residing at the Russian National Library, St. "
 + "Petersberg; hence the change of name."
 + "This version contains all 6 of the "
 + "textual elements of the OTA document: consonants, vowels, cantillation "
 + "marks, \"paragraph\" (pe, samekh) markers, ketib-qere variants, and morphological divisions. ",
   
   "The BHS so-called \"paragraph\" markers (pe and samekh) do "
 + "not actually occur in the Leningrad Codex. The editors of BHS use them "
 + "to indicate open space deliberately left blank by the scribe. Pe "
 + "(\"open\" paragraph) represents a space between verses, where the new "
 + "verse begins on a new column line. This represents a major section of "
 + "the text. Samekh (\"closed\" paragraph) represents a space of less than "
 + "a line between verses. This is understood to be a subdivision of the "
 + "corresponding \"open\" section. Since these markers represent an actual "
 + "physical feature of the text, they have been retained. " ,
  
   "The transcription was based on the \"Supplement to the code manual for "
 + "the Michigan Old Testament\" by Alan Groves and includes the "
 + "transcription notes defined there. A listing of these notes can be "
 + "obtained by clicking on the \"Notes\" link of the index page. "
 + "Transcription notes appear as superscripts and can be viewed by clicking "
 + "on them.",
 
   "The book names in English and Hebrew of the Jewish Publication Society "
 + "(JPS) Tanach have been added."} ;  

public char MorphologicalDivisionMarker = '/' ;
//-----------------------------------------------------------------------------

public final int InputBufferSize = 4000000 ; // Length of input in bytes.
public SuperContainer SC ;
Container InputContainer ;
public Frame SuperFrame ;
public Container OverallContainer ; // Actually, the content pane.
public JRootPane RP ;
public char[] InputChars ;  // Input char[] array set by FileRead.
public Parser p ;
public XMLWriter w ;
public Fmt F = new Fmt() ;
public boolean StandAlone = true ;  // If used by another app, 
Messages M;
 
public WLC2OSIS( Container InputContainer ){
    this.InputContainer = InputContainer ;
    this.SC = new SuperContainer(InputContainer) ;
    OverallContainer =  SC.getContentPane() ;
    SuperFrame =  SC.superFrame() ;
    StandAlone = true ;
//-----------------------------------------------------------------------------

// Crude GUI

    M = new Messages(this) ;
    FileChoices fc = new FileChoices(this) ;
    
    M.initialMessage() ;
    InputFilename = fc.getInputFilename(DefaultInputFilename) ;
    GetDate gd = new GetDate(this) ;
    OutputDirectory = fc.getOutputDirectory(DefaultOutputDirectory) ;    
//-----------------------------------------------------------------------------

// Identifying printouts

    F.bar("=", 80) ;
    System.out.println("\nWLC2OSIS: " + Title + " " + ShortDescription ) ;
    System.out.println("\nInput file:       " + InputFilename ) ;
    System.out.println(  "Input file date:  " + Date ) ;
    System.out.println("\nOutput directory: " + OutputDirectory ) ;
        
    FileRead FR = new FileRead(this) ;
    FR.read(InputFilename) ;  
//-----------------------------------------------------------------------------
    
// *** DISABLED *** Test of CCAT format -> XML translation.

//L5253W.L\"815253)5253]4    
//YI&:RF)\"80L    
    if(false){
       String TestString = "HA/$.FMA73YIM" ;
       Test.test(this, TestString) ;
       }
//-----------------------------------------------------------------------------
    
// Read, parse, and write the book files.
    p = new Parser(this) ;
    p.parse() ;    
//-----------------------------------------------------------------------------

// Write the Tanach.xml file
        
    Index.writeIndex(this) ;
    System.out.println("\nThe index file, Tanach.xml, has been written.\n") ;
    
//-----------------------------------------------------------------------------
    M.doneMessage() ;
//-----------------------------------------------------------------------------

// Launch the browser on Tanach.xml

   try{
        BrowserLauncher.openURL("file:\\" + OutputDirectory
             + File.separator + "Tanach.xml") ;
        }
    catch(IOException e){
        System.out.println("WLC2OSIS: Couldn't launch browser.") ;
        }    
     
    done() ;
    } 
//-----------------------------------------------------------------------------

// Applet stop() method, calls done() method.

public void stop() {
    done() ;
    }
//------------------------------------------------------------------------------
/**
  *    Universal exit.
  */
public void done(){
    M.endMessage() ;
    System.out.println("\nWLC2OSIS: Normal end.") ;
    F.bar("=", 80) ;
    if(!SC.isApplet()){
        if(StandAlone){
            System.exit(0) ;
            }
        }
    }
//-----------------------------------------------------------------------------
// End of class
}
//========================================================================================
//========================================================================================

--- NEW FILE: WLC2OSISMain.java ---
package WLC2OSIS ;

import Utilities.* ;

import java.awt.*;
import javax.swing.*;
//==============================================================================
/**
 *  <b>WLC2OSISMain main method and applet launcher, 
 *     actual working program is in the WLC2OSIS class.</b><p>
 *
 *   This is a general purpose launching class. It can launch
 *
 *       1.  Applets 
 *       2.  Applications
 *       3.  Dialogs launched from other programs
 *
 */
//==============================================================================
public class WLC2OSISMain extends JApplet{

static WLC2OSIS A ;

//==============================================================================

//  Applet

/**
 *    Applet init() method for use as an applet.
 */
public void init(){
//  System.out.println ("init() called.") ; 
    }
//------------------------------------------------------------------------------
/**
 *    Applet start() method goes to WLC2OSISCore.start() 
 */
public void start() {
//  System.out.println ("start() called.") ; 
    A = new WLC2OSIS(this) ;
    this.setVisible(true) ;
    }
//------------------------------------------------------------------------------
/**
 *    Applet stop() method which goes to WLC2OSISCore.stop()
 */
public void stop() {
//  System.out.println("WLC2OSIS: stop() called.") ;
    A.stop() ;
    }
//==============================================================================
/**
 *    Static main() method for use as an application or dialog.
 *
 * @param args String[] un-used.
 */
public static void main( String[] args) {

    boolean Dialog = false ;  // Either a dialog or application window.
    
    Frame SuperFrame = GetParentFrame.GetParentFrame(new JFrame()) ;
    
    if (Dialog){

//  As a MODAL JDialog
        JDialog WLC2OSISDialog = new JDialog(SuperFrame, true) ;
        A = new WLC2OSIS( WLC2OSISDialog ) ;
        System.exit(0) ;
        }
    else{

//  Ss a JFrame
        JFrame ThisFrame = new JFrame() ;
        A = new WLC2OSIS(ThisFrame) ;
        }
    }
//  end of class
}
//==============================================================================
//==============================================================================

--- NEW FILE: package.html ---
<HTML>
<BODY>
<b>WLC2XML - Conversion of Westminister Leningrad Codex (WLC) to Unicode/XML format</b>.
<p/>
<p align="right"> <b><tt>(BHS2XML/package.html)</tt></b>
<p/>
Converts the <b>wlc.txt</b> file to 39 books and one index XML file for 
the Unicode/XML Tanach. 
<p/>This software consists of 5 packages which must be located
in the Java <i>classpath</i>.  That is, if your <i>classpath</i> is
<b><tt>X:\Y\Z</tt></b>, then:
<p/>
<table border="2" cellspacing="2" width="80%" align="center">
<th>
<tr><td>Package</td><td>Location</td><td>Content</td></tr>
</th>
<tr><td>Utilities</td><td><b><tt>X:\Y\Z\Utilites</tt></b></td>
    <td>General purpose Java utilities. Note that only 5 classes
    in this package are actually used by software.</td></tr>
<tr><td>WLC2XML</td><td><b><tt>X:\Y\Z\WLC2XML</tt></b></td>
    <td>Main class.</td></tr>
<tr><td>WLC2XML.Parse</td><td><b><tt>X:\Y\Z\WLC2XML\Parse</tt></b></td>
    <td>Parsing classes.</td></tr>
<tr><td>WLC2XML.Translate</td><td><b><tt>X:\Y\Z\WLC2XML\Translate</tt></b></td>
    <td>Translation from ASCII CCAT format to Unicode.</td></tr>
<tr><td>WLC2XML.Utilities</td><td><b><tt>X:\Y\Z\WLC2XML\Utilities</tt></b></td>
    <td>File read and XML writing utilities.</td></tr>
</table>
<p/>
The main,
launching class is <b><tt>WLC2XMLMain</tt></b>.
<p/>
To run this program, first set the following Strings in the WLC2XML class:
<p/>

<table border="2" cellspacing="2" width="80%" align="center">
<tr><td>InputFilename</td><td>Full path to input <b><tt>wlc.txt</tt></b> input file.</td></tr>
<tr><td>OutputDirectory</td><td>Full path to directory to contain the output files. Must
    terminate with a "/",</td></tr>
<tr><td>Title</td><td>Title to appear above "Tanach" on index page.</td></tr>
<tr><td>ShortDescription</td><td>Short description of output to appear
        below "Tanach" on index and book name on book pages.  Keep it short.</td></tr>
<tr><td>Description</td><td>String[] giving separate paragraphs of description to appear on
        the About page.</td></tr>
<tr><td>Date</td><td>The version date of the input file.</td></tr>
</table>
<p/>
Other parameters can be changed with only great caution and no warranty!
The program can be run by typing
<p/><center>
<b><tt>java    WLC2XML.WLC2XMLMain</tt></b>
</center>
<p/>
on a command line.  A confirmation print to System.out occurs during operation.  This print ends with "WLC2XML: Normal end." if the program completed successfully.
<p/>
</BODY>
</HTML>



More information about the sword-cvs mailing list