[sword-svn] r69 - in trunk/modules/hebrew-wlc: . WLC2OSIS/WLC2OSIS WLC2OSIS/WLC2OSIS/Parse WLC2OSIS/WLC2OSIS/Translate WLC2OSIS/WLC2OSIS/Utilities

mgruner at crosswire.org mgruner at crosswire.org
Fri Jul 7 13:27:58 MST 2006


Author: mgruner
Date: 2006-07-07 13:27:39 -0700 (Fri, 07 Jul 2006)
New Revision: 69

Removed:
   trunk/modules/hebrew-wlc/source/
Modified:
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Books.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Chapters.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Markers.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Verses.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Words.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/BookName.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/MC.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSIS.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSISMain.java
Log:
some more work, more needed


Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Books.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Books.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Books.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -2,7 +2,6 @@
 
 import WLC2OSIS.* ;
 import WLC2OSIS.Translate.* ;
-//import WLC2OSIS.Utilities.* ;
 //==============================================================================
 /**
  *  <b>Processes books.</b>
@@ -44,12 +43,12 @@
     P.ChapterNumber = 0 ;
     P.VerseNumber = 0 ;
     P.WordNumber = 0 ;
-//     A.w.openTag("tanach", 0) ;
-    A.w.openTag("div type=\"book\" osisID=\"" + BookObject.abbrev + "\"", 1) ;
+//     A.wlc.openTag("tanach", 0) ;
+    A.wlc.openTag("div type=\"book\" osisID=\"" + BookObject.abbrev + "\"", 1) ;
 
-/*    A.w.writeAttributedString("title", 2, "type=\"section\" subType=\"x-Section\" subtype=\"x-preverse\"",
+/*    A.wlc.writeAttributedString("title", 2, "type=\"section\" subType=\"x-Section\" subtype=\"x-preverse\"",
       BookObject.hebrewname);
-    A.w.writeAttributedString("title", 2, "type=\"main\" ",    	BookObject.hebrewname);*/
+    A.wlc.writeAttributedString("title", 2, "type=\"main\" ",    	BookObject.hebrewname);*/
       
     
     }
@@ -63,7 +62,7 @@
         P.BookChapterCount = P.ChapterNumber ;
         P.TanachChapterCount = P.TanachChapterCount + P.ChapterNumber ;
         
-        A.w.closeTag("div", 1) ;
+        A.wlc.closeTag("div", 1) ;
         System.out.println( BookObject.name + " has been written." ) ;
         }
     }

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Chapters.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Chapters.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Chapters.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -26,7 +26,7 @@
     P.VerseNumber = 0 ;
     P.WordNumber = 0 ;
     String num = new Integer(P.ChapterNumber).toString();
-    A.w.openTag("chapter osisID=\"" + P.BookAbbrev + "." + num + "\"", 2) ;
+    A.wlc.openTag("chapter osisID=\"" + P.BookAbbrev + "." + num + "\"", 2) ;
     }
 //------------------------------------------------------------------------------
 
@@ -38,7 +38,7 @@
         P.BookVerseCount = P.BookVerseCount + P.VerseNumber ;
         P.TanachVerseCount = P.TanachVerseCount + P.VerseNumber ;
     
-    	A.w.closeTag("chapter", 2) ;
+    	A.wlc.closeTag("chapter", 2) ;
 	
         }
     }

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Markers.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Markers.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Markers.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -29,8 +29,8 @@
 // Samek
 public void samek(){ //parasah setumah, closed paragraph == small space in line
     testMaqafWord() ;
-//     A.w.writeMarker("samekh", 4) ;
-    A.w.appendText("   " + H.samekh + "   ") ;
+//     A.wlc.writeMarker("samekh", 4) ;
+    A.wlc.appendText("   " + H.samekh + "   ") ;
     P.MarkerWritten = true ;
     }
 //------------------------------------------------------------------------------
@@ -38,8 +38,8 @@
 // Pe
 public void pe(){ // parasah petuhah, open paragraph == new line
     testMaqafWord() ;
-//     A.w.writeMarker("pe", 4) ;
-    A.w.appendText(" " + H.pe + " " + "<p/>") ;
+//     A.wlc.writeMarker("pe", 4) ;
+    A.wlc.appendText(" " + H.pe + " " + "<p/>") ;
     P.MarkerWritten = true ;
     }
 //------------------------------------------------------------------------------

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -15,7 +15,6 @@
 public class Parser{
 
 WLC2OSIS A ;
-Tokenizer t ;
 
 //  Working classes
 
@@ -64,10 +63,7 @@
     this.A = A ;
 
     T = new Translate(A, this) ;
-    
-// Set up the tokenizer
-    t = new Tokenizer(A) ;
-    
+  
 // Set up the Tanach, Books, Chapters, Verses, Words, and Markers classes.
     b = new Books(A, this) ;
     c = new Chapters(A, this) ;
@@ -89,16 +85,14 @@
     boolean PreviousEOL = true ;
     System.out.println("\n") ;
     
-     // Write the header
-    Header.writeHeader(A, A.wlc) ;
-    Header.writeHeader(A, A.morph) ;
-    
    	try{
 	    file = new BufferedReader( new FileReader( A.InputFilename ));
 	}
 	catch (IOException e) {
 		System.out.println("File not found: " + e) ;
     }
+
+    java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("(\\w\\w)(\\d+):(\\d+),(\\d+)\\.(\\d+)\\S*\\s(\\S+)\\s(\\S+)(?:@|%)(\\S+)");
      
     while ( true ){
     	s="";
@@ -110,14 +104,11 @@
 			break;
         }
     
-//        System.out.println("processing: " + s);
-        
         if ( s.startsWith(">") ){ //ignore this line
         	continue;
         }
         
-        java.util.regex.Pattern p = java.util.regex.Pattern.compile("(\\w\\w)(\\d+):(\\d+),(\\d+)\\.(\\d+)\\S*\\s(\\S+)\\s(\\S+)(?:@|%)(\\S+)");
-		java.util.regex.Matcher m = p.matcher( s );
+		java.util.regex.Matcher m = pattern.matcher( s );
 		if (!m.matches()){
 			System.out.println("No match!");
 			System.exit(1);
@@ -190,12 +181,7 @@
     v.end() ;
     c.end() ;
     b.end() ;   
-
-     // Write the footer
-    Header.writeFooter(A, A.w) ;
-
     
-    A.w.close();
     return ;
     }
 //----------------------------------------------------------------------------
@@ -215,11 +201,11 @@
 
 // Prints a verse identification.
 
-public void printPosition(){
+/*public void printPosition(){
     System.out.print(" at " + Book + " " + A.F.i(ChapterNumber,3) + ":" 
         + A.F.i(VerseNumber,2) 
             + "." + A.F.i(WordNumber,2) + "\n") ;
-    }
+    }*/
 //------------------------------------------------------------------------------
 }
 //==============================================================================

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Verses.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Verses.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Verses.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -26,7 +26,7 @@
     
     String chapternum = new Integer(P.ChapterNumber).toString();
     String versenum =   new Integer(P.VerseNumber).toString();
-    A.w.openTag("verse osisID=\""+P.BookAbbrev+"."+chapternum+"."+versenum+"\"", 3) ;
+    A.wlc.openTag("verse osisID=\""+P.BookAbbrev+"."+chapternum+"."+versenum+"\"", 3) ;
     }
 //------------------------------------------------------------------------------
 
@@ -34,7 +34,7 @@
 
 public void end(){
     if( P.VerseNumber != 0){
-    	A.w.closeTag("verse", 3) ;
+    	A.wlc.closeTag("verse", 3) ;
         }
     }
 //----------------------------------------------------------------------------

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Words.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Words.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Words.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -27,30 +27,15 @@
 //------------------------------------------------------------------------------
 
 // Processes a word,
-
 public void process(String W){
-
-//----------------------------------------------------------------------------------
-
-// Process WKQ 
         P.wkq.process(W) ;
-        
-//----------------------------------------------------------------------------------
-
-    
-//    System.out.println(P.Book + " " + A.F.i(P.ChapterNumber,2) + ":" 
-//        + A.F.i(P.VerseNumber,2) 
-//        + "." + A.F.i(P.WordNumber,2) + "                " + W) ;
     }
-//----------------------------------------------------------------------------------
 
-// Translates and writes a word (simple, ketib, qere) with exception markers.
 
+// Translates and writes a word (simple, ketib, qere) with exception markers.
 // All returns leave P.MarkerWritten = false ;
-
 public void write(String W, String Type) {
 
-   
    String Word = P.T.translate(W) ;
    
 // Check for any KQ markers which should NOT be here!
@@ -59,7 +44,7 @@
 
     if (asteriskcount > 0){
         System.out.print("Words.write: Unexpected KQ character * ") ;
-        P.printPosition() ;
+//        P.printPosition() ;
         System.out.println("Word: " + W) ;
         }
 
@@ -114,17 +99,17 @@
        }
        
     if (Type.charAt(0) == 'w') {
-        A.w.appendText(A.MorphologicalSegmentStart + Out + A.MorphologicalSegmentEnd + " ") ;
+        A.wlc.appendText(A.MorphologicalSegmentStart + Out + A.MorphologicalSegmentEnd + " ") ;
     }
     else if (Type.charAt(0) == 'k') {
-        A.w.appendText("[" + A.MorphologicalSegmentStart + Out + A.MorphologicalSegmentEnd + " " + H.kaf + "] ") ;
+        A.wlc.appendText("[" + A.MorphologicalSegmentStart + Out + A.MorphologicalSegmentEnd + " " + H.kaf + "] ") ;
     }
     else if (Type.charAt(0) == 'q') {
-        A.w.appendText("("+A.MorphologicalSegmentStart + Out + A.MorphologicalSegmentEnd + " " + H.qof+ ") ") ;
+        A.wlc.appendText("("+A.MorphologicalSegmentStart + Out + A.MorphologicalSegmentEnd + " " + H.qof+ ") ") ;
     }
     else {
         System.out.println("Warning: unknown word type!");
-	P.printPosition();
+//		P.printPosition();
     }
     P.MarkerWritten = false ;
     }

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/BookName.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/BookName.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/BookName.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -2,7 +2,6 @@
 
 import WLC2OSIS.* ;
 import WLC2OSIS.Translate.* ;
-import Utilities.* ;
 
 import java.io.*;
 //==============================================================================

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/MC.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/MC.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/MC.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -1,7 +1,6 @@
 package WLC2OSIS.Translate ;
 
 import WLC2OSIS.Utilities.* ;
-import Utilities.* ;
 
 import java.io.*;
 //==============================================================================

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -4,7 +4,6 @@
 import WLC2OSIS.Parse.* ;
 import WLC2OSIS.Translate.Note ;
 import WLC2OSIS.Utilities.* ;
-import Utilities.* ;
 
 import java.io.* ;
 import java.util.Vector ;
@@ -193,50 +192,25 @@
             setFinal(LastConsonant) ;
             }
         }
-//    System.out.println("ObjectCount: " + MCOs.size() ) ;
-//    System.out.println("ConsonantCount: " + ConsonantCount) ;
-//    System.out.println("LastConsonant: " + LastConsonant) ;
-    
-//    for (int k = 0; k < ConsonantCount; k++){
-//        System.out.println("ConsonantPositions[" + k + "]: " + ConsonantPositions[k]) ;
-//         }
-//-----------------------------------------------------------------------------
         
     if (ConsonantCount > 0){
-       
-// Set the final consonant, if any.
-
         setFinal(LastConsonant) ;
-            
-//      print(MCOs) ;
-
-//-----------------------------------------------------------------------------
-
-// Order the MCOs
-
-    OrderedMCOs = new Vector() ;    
-    int Limit = 0 ;
-    for( int ConsonantNumber = 0; ConsonantNumber < ConsonantCount; ConsonantNumber++) {
-       if (ConsonantNumber+1 == ConsonantCount){
-           Limit = MCOs.size() ;
-           }
-       else{
-           Limit = ConsonantPositions[ConsonantNumber+1] ;
-           }
-       Order(MCOs, ConsonantPositions[ConsonantNumber], Limit, OrderedMCOs ) ;
-
+	    OrderedMCOs = new Vector() ;    
+    	int Limit = 0 ;
+	    for( int ConsonantNumber = 0; ConsonantNumber < ConsonantCount; ConsonantNumber++) {
+    	   if (ConsonantNumber+1 == ConsonantCount){
+        	   Limit = MCOs.size() ;
+	           }
+    	   else{
+        	   Limit = ConsonantPositions[ConsonantNumber+1] ;
+	           }
+    	   Order(MCOs, ConsonantPositions[ConsonantNumber], Limit, OrderedMCOs ) ;
+	   	   }
        }
-
-       }
     else{
        OrderedMCOs = MCOs ;
        }      
 
-
-//  print(OrderedMCOs) ;
-     
-//-----------------------------------------------------------------------------
-
 // Output the ordered Vector
 
     String S = "" ;
@@ -247,17 +221,16 @@
         if (Type == MCO.Note){
             S = S + "<note type=\"textual\" xml:lang=\"en\">"+ Note.Notes.get( M.Value)+ "</note>";
             }
-				//Mark morph segments when a maqef is present
-				else if ( (M.Name).compareTo("maqef") == 0 ){
-						S = S + A.MorphologicalSegmentEnd + M.Value + A.MorphologicalSegmentStart; 
-				}
+		//Mark morph segments when a maqef is present
+		else if ( (M.Name).compareTo("maqef") == 0 ){
+			S = S + A.MorphologicalSegmentEnd + M.Value + A.MorphologicalSegmentStart; 
+		}
 	    
         else if ((Type == MCO.MorphologicalDivision)){
             S = S + A.MorphologicalDivisionMarker ;
             }
         else{
             S = S + M.Value ;
-//            System.out.println(Integer.toString( (int) M.Value.charAt(0), 16)) ;
             } 
         }      
         
@@ -326,7 +299,7 @@
 
 public void message(String m){
     System.out.print(m) ;
-    P.printPosition() ;
+//    P.printPosition() ;
     }
 //-----------------------------------------------------------------------------
 

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -1,7 +1,5 @@
 package WLC2OSIS.Utilities ;
 
-import Utilities.* ;
-
 import java.lang.System ;
 import java.io.* ;
 //==============================================================================
@@ -17,8 +15,6 @@
 FileOutputStream FOS ;
 OutputStreamWriter OSW ;
 char[] CharBuffer ;
-Fmt F = new Fmt() ;
-// String XMLTag ;
 //-----------------------------------------------------------------------------
 /**
  *  Writes an XML file.

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSIS.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSIS.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSIS.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -2,13 +2,9 @@
 
 import WLC2OSIS.Parse.* ;
 import WLC2OSIS.Translate.* ;
-import WLC2OSIS.Utilities.* ;
-import Utilities.* ;
+import WLC2OSIS.Utilities.XMLWriter ;
 
-import java.awt.*;
 import java.io.*;
-import java.awt.event.*;
-import javax.swing.*;
 import java.util.*;
 //=================================================================================================
 /**
@@ -70,29 +66,23 @@
 
 //-----------------------------------------------------------------------------
 
-//public final int InputBufferSize = 40000000 ; // Length of input in bytes.
-public char[] InputChars ;  // Input char[] array set by FileRead.
 public Parser p ;
 public XMLWriter wlc;
 public XMLWriter morph;
 
-public Fmt F = new Fmt() ;
-// public boolean StandAlone = true ;  // If used by another app, 
- 
 public WLC2OSIS( String file, String directory ){
     
     InputFilename = file ;
     OutputDirectory = directory ;    
 
-    F.bar("=", 80) ;
     System.out.println("\nWLC2OSIS: " + Title + " " + ShortDescription ) ;
     System.out.println("\nInput file:       " + InputFilename ) ;
     System.out.println("\nOutput directory: " + OutputDirectory ) ;
         
 // Read, parse, and write the book files.
 
-    wlc = new XMLWriter(A.OutputDirectory, "wlc_osis") ;
-    morph = new XMLWriter(A.OutputDirectory, "morph_osis") ;
+    wlc = new XMLWriter(OutputDirectory, "wlc_osis") ;
+    morph = new XMLWriter(OutputDirectory, "morph_osis") ;
 
 
     wlc.openTag("osisText osisIDWork=\"WLC\" osisRefWork=\"bible\" xml:lang=\"he\"", 0) ;
@@ -112,14 +102,11 @@
     wlc.closeTag("work", 1);
     wlc.closeTag("header", 0);
 
-
-
-
-
     p = new Parser(this) ;
     p.parse() ;    
 
     wlc.closeTag("osisText", 0);
+	wlc.close();
 
     done() ;
     } 
@@ -130,7 +117,6 @@
   */
 public void done(){
     System.out.println("\nWLC2OSIS: Normal end.") ;
-    F.bar("=", 80) ;
     System.exit(0) ;
     }
 }

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSISMain.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSISMain.java	2006-07-07 16:50:30 UTC (rev 68)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSISMain.java	2006-07-07 20:27:39 UTC (rev 69)
@@ -1,17 +1,11 @@
 package WLC2OSIS ;
 
-import Utilities.* ;
-
-import java.awt.*;
-import javax.swing.*;
-
-
 public class WLC2OSISMain{
 
 static WLC2OSIS A ;
 
 /**
- *    Static main() method for use as an application or dialog.
+ *    Static main() method
  *
  * @param args String[] 
  */



More information about the sword-cvs mailing list