[sword-svn] r32 - in trunk/modules/hebrew-wlc: WLC2OSIS WLC2OSIS/WLC2OSIS WLC2OSIS/WLC2OSIS/Translate source source/wlc

mgruner at crosswire.org mgruner at crosswire.org
Fri Apr 1 14:02:09 MST 2005


Author: mgruner
Date: 2005-04-01 14:02:08 -0700 (Fri, 01 Apr 2005)
New Revision: 32

Added:
   trunk/modules/hebrew-wlc/source/wlc/wlc43-20050319.zip
Removed:
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/package.html
   trunk/modules/hebrew-wlc/source/WLC2XML/
Modified:
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java
   trunk/modules/hebrew-wlc/WLC2OSIS/wlc.conf
Log:
WLC 0.2 ready.


Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java	2004-07-14 18:09:28 UTC (rev 31)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java	2005-04-01 21:02:08 UTC (rev 32)
@@ -1,47 +1,47 @@
-package WLC2OSIS.Translate ;
-
-import WLC2OSIS.Utilities.* ;
-
-import java.util.Hashtable ;
-
-//==============================================================================
-/**
- *  <b>MC notes.</b><p>
- */
-//==============================================================================
-public class Note{
-
-static Hashtable Notes = new Hashtable();
-
-public static void setNotes(){
-
-    // Do this only once!
-    if(Notes.size() > 1) return ;
-    
-    Notes.put("1", "BHS has been faithful to the Leningrad Codex where " 
-                          + "there might be a question of the validity of the form "
-                          + "and we keep the same form as BHS.") ;
-    Notes.put("2", "We have puted a sop pasuq where L and BHC omit it. "
-                          + "(The puted sof pasuq often is missing from the text.)" ) ;
-    Notes.put("3", "We read or understand L differently than BHC (1983 Edition). "
-                          + "Often this notation indicates a typographical error in BHS.") ;
-    Notes.put("4", "Puncta Extraordaria -- "
-                          + "a \\u05c4 is used to mark such marks in the text"
-                          + "when they are above the line and"
-                          + "a \\u0323 when they are below the line.");
-    Notes.put("5", "Large letter(s).") ;
-    Notes.put("6", "Small letter(s).") ;
-    Notes.put("7", "Suspended letter(s).") ;
-    Notes.put("8", "Inverted nun in the text.") ;
-    Notes.put("9", "BHS has abandoned L and we concur. " 
-                          + "All of these occurrences are ketib/qere problems.") ;
-    Notes.put("a", "Adaptations to a Qere which L and BHS, by their design, "
-                           + "do not indicate.") ;
-    Notes.put("m", "Miscellaneous notes to the text and occasions "
-                           + "where more than one bracket category applies.") ;
-    Notes.put("q", "We have abandoned or puted a ketib/qere relative to BHS. "
-                           + "In doing this we agree with L against BHS.") ;
-    Notes.put("y", "Yathir readings in L which we have designated as Qeres "
-                           + "when both Dothan and BHS list a Qere.") ;
-    }
+package WLC2OSIS.Translate ;
+
+import WLC2OSIS.Utilities.* ;
+
+import java.util.Hashtable ;
+
+//==============================================================================
+/**
+ *  <b>MC notes.</b><p>
+ */
+//==============================================================================
+public class Note{
+
+static Hashtable Notes = new Hashtable();
+
+public static void setNotes(){
+
+    // Do this only once!
+    if(Notes.size() > 1) return ;
+    
+    Notes.put("1", "BHS has been faithful to the Leningrad Codex where " 
+                          + "there might be a question of the validity of the form "
+                          + "and we keep the same form as BHS.") ;
+    Notes.put("2", "We have puted a sop pasuq where L and BHC omit it. "
+                          + "(The puted sof pasuq often is missing from the text.)" ) ;
+    Notes.put("3", "We read or understand L differently than BHS (1983 Edition). "
+                          + "Often this notation indicates a typographical error in BHS.") ;
+    Notes.put("4", "Puncta Extraordaria -- "
+                          + "a \\u05c4 is used to mark such marks in the text"
+                          + "when they are above the line and"
+                          + "a \\u0323 when they are below the line.");
+    Notes.put("5", "Large letter(s).") ;
+    Notes.put("6", "Small letter(s).") ;
+    Notes.put("7", "Suspended letter(s).") ;
+    Notes.put("8", "Inverted nun in the text.") ;
+    Notes.put("9", "BHS has abandoned L and we concur. " 
+                          + "All of these occurrences are ketib/qere problems.") ;
+    Notes.put("a", "Adaptations to a Qere which L and BHS, by their design, "
+                           + "do not indicate.") ;
+    Notes.put("m", "Miscellaneous notes to the text and occasions "
+                           + "where more than one bracket category applies.") ;
+    Notes.put("q", "We have abandoned or puted a ketib/qere relative to BHS. "
+                           + "In doing this we agree with L against BHS.") ;
+    Notes.put("y", "Yathir readings in L which we have designated as Qeres "
+                           + "when both Dothan and BHS list a Qere.") ;
+    }
 }
\ No newline at end of file

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java	2004-07-14 18:09:28 UTC (rev 31)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java	2005-04-01 21:02:08 UTC (rev 32)
@@ -1,360 +1,363 @@
-package WLC2OSIS.Translate ;
-
-import WLC2OSIS.* ;
-import WLC2OSIS.Parse.* ;
-import WLC2OSIS.Translate.Note ;
-import WLC2OSIS.Utilities.* ;
-import Utilities.* ;
-
-import java.io.* ;
-import java.util.Vector ;
-//==============================================================================
-/**
- *  <b>Critical translation of KQ-free MC words into Unicode characters.</b><p>
- */
-//==============================================================================
-public class Translate{
-
-Parser P ;
-WLC2OSIS A ;
-
-MCO M ;
-MCO Mark ;
-Vector MCOs, OrderedMCOs ;
-int Type, I, k1, len ;
-int[] ConsonantPositions = new int[100] ;
-char c, c1 ;
-//-----------------------------------------------------------------------------
-
-public Translate(WLC2OSIS A, Parser P) {
-    this.A = A ;
-    this.P = P ;
-    }    
-//------------------------------------------------------------------------------
-
-// Translates an MC word (not qere or ketib) to a Unicode String.
-// Notes are included as <note type="textual">text of note</x>.
-
-public String translate(String W){
-    len = W.length() ;
-        
-// Convert characters in String to MCO objects, expanding
-// ConsonantMarks, Numbers, and Notes as necessary.
-// Move PrepositiveMarks to after their consonants.
-
-    MCOs = new Vector() ;
-    for (int k = 0; k < len; k++) {
-        c = W.charAt(k) ;
-        
-        
-        M = (MCO) (MC.getMCO(c)).clone() ;
-        Type = M.Type ;
-
-// Unknown 
-        if(Type == MCO.Unknown){
-            message("MC: MC Object is of type Unknown."
-                + "\nWord: " + W 
-                + "\nCharacter: " + c
-                + "\n                                     " ) ;
-             }
-        else if(Type <= 5){  // These types need no expansion.
-            MCOs.add(M) ;
-            }
-        else if(Type == MCO.Sheva ){
-// Might be a Hatef Vowel
-            k1 = k + 1 ;
-            if(k1 < len){
-                c1 = W.charAt(k1) ;
-                Mark = (MCO) (MC.getMCO(c1)).clone() ;
-                if (Mark.Type == MCO.Vowel){
-// It is a Hatef vowel
-                    MCO Hatef = new MCO("hataf"+Mark.Name, MCO.Vowel,
-                           Mark.FinalValue, Mark.FinalValue, Mark.Group) ;
-                    MCOs.add(Hatef) ;
-                    k++ ;
-                    }
-// Not a Hatef Vowel
-                else{
-                    MCOs.add(M) ;
-                    }
-                }
-// Could only be a Sheva
-            else{
-                MCOs.add(M) ;
-                }        
-            }
-      else if(Type == MCO.ConsonantMark){
-            Mark = (MCO) (M.Object).clone() ;
-            M.Type = MCO.Consonant ;
-            MCOs.add(M) ;
-            MCOs.add(Mark) ;
-            }
-//-----------------------------------------------------------------------------
-      else if(Type == MCO.Number){
-            k++ ;
-            String StringInt = "" ;
-            StringInt = StringInt + c ;
-            StringInt = StringInt + W.charAt(k) ;
-            
-            I = new Integer(StringInt).intValue() ;
-            if ((I > 99) | (I < 0) ){
-                 message("MC: Reconstructed int is out of range."
-                    + "\nWord: " + W 
-                    + "\nCharacters: " + c + W.charAt(k)
-                    + "\nint: " + I ) ;
-                 }
-            else{
-// Found a Mark of some sort
-                MCO Found = MC.getMCO(I) ;
-                
-                if(Found.Type == MCO.PrepositiveMark){
-//                  System.out.println("*****  Found a prepositive mark. " + I) ;
-                    k++ ;
-                    c1 = W.charAt(k) ;
-                    M = (MCO) (MC.getMCO(c1)).clone() ;
-                    if( M.Type == MCO.Consonant){
-//                      System.out.println("Swapping prepositive mark and consonant.") ;
-                        MCOs.add(M) ;
-                        MCOs.add(Found) ;
-                        } 
-// *** Special section for MCO.ConsonantMark added 17 June 2004 ***
-                    else if( M.Type == MCO.ConsonantMark ){
-//                      System.out.println("Swapping prepositive mark and consonant-mark.") ;
-                        MCOs.add(M) ;
-                        MCOs.add(M.Object) ;
-                        MCOs.add(Found) ;
-                        } 
-                    else{
-                        System.out.println("MC: PrepositiveMark not followed by a Consonant."
-                            + "\nWord: " + W + "\nType: " + M.Type ) ;
-                        MCOs.add(M) ;
-                        System.exit(0) ;
-                        }
-                    }
-                else{
-                    MCOs.add(MC.getMCO(I)) ;
-                    }
-                }
-            }
-//-----------------------------------------------------------------------------
-            
-        else if(Type == MCO.Note){
-            k++ ;
-            c1 = W.charAt(k) ;
-// Check for an inverted nun.   Assumes the note immediately follows a nun.
-            if (c1=='8'){
-                MCO Mtemp = (MCO) MCOs.lastElement() ;
-                if( (Mtemp.Name).compareTo("nun") == 0) {
-                    String in = H.Invertednun ;
-                    Mtemp.Name = "invertednun" ;   
-                    Mtemp.Value = in ;   
-                    Mtemp.FinalValue = in ;  
-// The masoranumberdot fails to work in IE. Ezra SIL already provides a dot.
-// Providing no accent.
-//                  MCO ud = (MCO) (MC.getMCO(81)).clone() ; // revia 81, masora 96
-//                  MCOs.add(ud) ;
-                    }
-                else{
-                    System.out.println("Prior MCO isn't a nun!") ;
-                    }
-                }
-// Leave a note
-            M.Value = Character.toString(c1) ;
-            MCOs.add(M) ;
-            }
-        else{
-            System.out.println("MC: Unknown type for an MCO Object.") ;
-            }
-        }
-//-----------------------------------------------------------------------------
-               
-// At this point the Consonants are where they should be.
-// Locating the consonants and FinalConsonants.
-
-// An incoming word a final consonant before a maqaf 
-// as well as at the end .
- 
-    int LastConsonant = -1 ;
-    int ConsonantIndex = 0 ;
-    int ConsonantCount = 0 ;
-    for (int k = 0; k < MCOs.size(); k++){
-        M = (MCO) MCOs.elementAt(k) ;
-        if( M.Type == MCO.Consonant ){
-            ConsonantPositions[ConsonantIndex] = k ;
-            LastConsonant = k ;
-            ConsonantIndex++ ;
-            ConsonantCount++ ;
-            }
-// Look for a Maqef, if found, set the LastConsonant final.
-        if( (M.Name).compareTo("maqef") == 0){
-            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 ) ;
-
-       }
-
-       }
-    else{
-       OrderedMCOs = MCOs ;
-       }      
-
-
-//  print(OrderedMCOs) ;
-     
-//-----------------------------------------------------------------------------
-
-// Output the ordered Vector
-
-    String S = "" ;
-    for (int k = 0; k < OrderedMCOs.size(); k++){
-        M = (MCO) OrderedMCOs.elementAt(k) ;
-        Type = M.Type ;
-//  Only Notes require special treatment
-        if (Type == MCO.Note){
-            S = S + "<note type=\"textual\">"+ Note.Notes.get( M.Value)+ "</note>";
-            }
-	    
-    // MG              DISABLE MORPH DIVISION!!!!!!!!!!!!!!!!
-	    
-        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)) ;
-            } 
-        }      
-        
-    return S ;
-    }
-//-----------------------------------------------------------------------------
-
-// Order the Marks following a Consonant.
-
-void Order( Vector MCOs, int StartIndex, int Limit, Vector OrderedMCOs) {
-     MCO m ;
-     
-//  Check for no Marks
-     if(StartIndex+1==Limit){
-         m = (MCO) MCOs.elementAt(StartIndex) ;
-         OrderedMCOs.add(m) ;
-         return ;
-         }
-//  Check for one Mark
-     if(StartIndex+2==Limit){
-         m = (MCO) MCOs.elementAt(StartIndex) ;
-         OrderedMCOs.add(m) ;
-         m = (MCO) MCOs.elementAt(StartIndex+1) ;
-         OrderedMCOs.add(m) ;
-         return ;
-         }
-         
-// Two or more Marks
-         
-// Save the Consonant
-     m = (MCO) MCOs.elementAt(StartIndex) ;
-     OrderedMCOs.add(m) ;
-
-// Order the marks
-     int MarkCount = (Limit-StartIndex)-1 ; 
-     boolean[] Written = new boolean[MarkCount] ;
-     for (int k =0; k < MarkCount; k++){
-         Written[k] = false ;
-         }
-         
-     int WrittenCount = 0 ;
-     do{        
-// Find the MCO with the smallest possible Group value and write it.
-         int GroupTest = 1000 ;
-         int MCOMin = -1 ;
-         for( int k = StartIndex+1; k < Limit; k++){
-             if(!Written[ k -(StartIndex+1) ]){
-                 m = (MCO) MCOs.elementAt(k)  ;
-                 int g = m.Group ;
-                 if ( g < GroupTest ){
-                     GroupTest = g ;
-                     MCOMin = k ;
-                     }
-                 }
-             }
-         m = (MCO) MCOs.elementAt(MCOMin) ;
-         OrderedMCOs.add(m) ;
-         Written[MCOMin -(StartIndex+1) ] = true ;
-         WrittenCount++ ;
-         }while(WrittenCount < MarkCount) ;
-            
-     }
-//-----------------------------------------------------------------------------
-
-// Output a message plus position.
-
-public void message(String m){
-    System.out.print(m) ;
-    P.printPosition() ;
-    }
-//-----------------------------------------------------------------------------
-
-// Output a message plus position.
-
-public void print(Vector v){
-    System.out.println("\n") ;
-    for (int k = 0; k < v.size(); k++){
-        MCO m = (MCO) v.elementAt(k) ;
-        m.print() ;
-        }
-    System.out.println("\n") ;
-    }
-//-----------------------------------------------------------------------------
-
-// Set a consonant as final.
-
-public void setFinal(int Position){
-// Do nothing if there's no Position to set
-        if (Position < 0) return ;
-        
-        M = (MCO) MCOs.elementAt(Position) ;
-        if (M.Type == MCO.Consonant){
-            MCO Final = new MCO("final" + M.Name, MCO.Consonant, M.FinalValue, M.FinalValue,
-                 M.Group) ;
-            MCOs.setElementAt(Final, Position) ;
-            }
-        else{
-            message("LastConsonant is not a consonant!") ;
-            }
-        return ;
-        }
-//-----------------------------------------------------------------------------
-}
-//==============================================================================
-//==============================================================================
+package WLC2OSIS.Translate ;
+
+import WLC2OSIS.* ;
+import WLC2OSIS.Parse.* ;
+import WLC2OSIS.Translate.Note ;
+import WLC2OSIS.Utilities.* ;
+import Utilities.* ;
+
+import java.io.* ;
+import java.util.Vector ;
+//==============================================================================
+/**
+ *  <b>Critical translation of KQ-free MC words into Unicode characters.</b><p>
+ */
+//==============================================================================
+public class Translate{
+
+Parser P ;
+WLC2OSIS A ;
+
+MCO M ;
+MCO Mark ;
+Vector MCOs, OrderedMCOs ;
+int Type, I, k1, len ;
+int[] ConsonantPositions = new int[100] ;
+char c, c1 ;
+//-----------------------------------------------------------------------------
+
+public Translate(WLC2OSIS A, Parser P) {
+    this.A = A ;
+    this.P = P ;
+    }    
+//------------------------------------------------------------------------------
+
+// Translates an MC word (not qere or ketib) to a Unicode String.
+// Notes are included as <note type="textual">text of note</x>.
+
+public String translate(String W){
+    len = W.length() ;
+        
+// Convert characters in String to MCO objects, expanding
+// ConsonantMarks, Numbers, and Notes as necessary.
+// Move PrepositiveMarks to after their consonants.
+
+    MCOs = new Vector() ;
+    for (int k = 0; k < len; k++) {
+        c = W.charAt(k) ;
+        
+        
+        M = (MCO) (MC.getMCO(c)).clone() ;
+        Type = M.Type ;
+
+// Unknown 
+        if(Type == MCO.Unknown){
+            message("MC: MC Object is of type Unknown."
+                + "\nWord: " + W 
+                + "\nCharacter: " + c
+                + "\n                                     " ) ;
+             }
+        else if(Type <= 5){  // These types need no expansion.
+            MCOs.add(M) ;
+            }
+        else if(Type == MCO.Sheva ){
+// Might be a Hatef Vowel
+            k1 = k + 1 ;
+            if(k1 < len){
+                c1 = W.charAt(k1) ;
+                Mark = (MCO) (MC.getMCO(c1)).clone() ;
+                if (Mark.Type == MCO.Vowel){
+// It is a Hatef vowel
+                    MCO Hatef = new MCO("hataf"+Mark.Name, MCO.Vowel,
+                           Mark.FinalValue, Mark.FinalValue, Mark.Group) ;
+                    MCOs.add(Hatef) ;
+                    k++ ;
+                    }
+// Not a Hatef Vowel
+                else{
+                    MCOs.add(M) ;
+                    }
+                }
+// Could only be a Sheva
+            else{
+                MCOs.add(M) ;
+                }        
+            }
+      else if(Type == MCO.ConsonantMark){
+            Mark = (MCO) (M.Object).clone() ;
+            M.Type = MCO.Consonant ;
+            MCOs.add(M) ;
+            MCOs.add(Mark) ;
+            }
+//-----------------------------------------------------------------------------
+      else if(Type == MCO.Number){
+            k++ ;
+            String StringInt = "" ;
+            StringInt = StringInt + c ;
+            StringInt = StringInt + W.charAt(k) ;
+            
+            I = new Integer(StringInt).intValue() ;
+            if ((I > 99) | (I < 0) ){
+                 message("MC: Reconstructed int is out of range."
+                    + "\nWord: " + W 
+                    + "\nCharacters: " + c + W.charAt(k)
+                    + "\nint: " + I ) ;
+                 }
+            else{
+// Found a Mark of some sort
+                MCO Found = MC.getMCO(I) ;
+                
+                if(Found.Type == MCO.PrepositiveMark){
+//                  System.out.println("*****  Found a prepositive mark. " + I) ;
+                    k++ ;
+                    c1 = W.charAt(k) ;
+                    M = (MCO) (MC.getMCO(c1)).clone() ;
+                    if( M.Type == MCO.Consonant){
+//                      System.out.println("Swapping prepositive mark and consonant.") ;
+                        MCOs.add(M) ;
+                        MCOs.add(Found) ;
+                        } 
+// *** Special section for MCO.ConsonantMark added 17 June 2004 ***
+                    else if( M.Type == MCO.ConsonantMark ){
+//                      System.out.println("Swapping prepositive mark and consonant-mark.") ;
+                        MCOs.add(M) ;
+                        MCOs.add(M.Object) ;
+                        MCOs.add(Found) ;
+                        } 
+                    else{
+                        System.out.println("MC: PrepositiveMark not followed by a Consonant."
+                            + "\nWord: " + W + "\nType: " + M.Type ) ;
+                        MCOs.add(M) ;
+                        System.exit(0) ;
+                        }
+                    }
+                else{
+                    MCOs.add(MC.getMCO(I)) ;
+                    }
+                }
+            }
+//-----------------------------------------------------------------------------
+            
+        else if(Type == MCO.Note){
+            k++ ;
+            c1 = W.charAt(k) ;
+// Check for an inverted nun.   Assumes the note immediately follows a nun.
+            if (c1=='8'){
+                MCO Mtemp = (MCO) MCOs.lastElement() ;
+                if( (Mtemp.Name).compareTo("nun") == 0) {
+                    String in = H.Invertednun ;
+                    Mtemp.Name = "invertednun" ;   
+                    Mtemp.Value = in ;   
+                    Mtemp.FinalValue = in ;  
+// The masoranumberdot fails to work in IE. Ezra SIL already provides a dot.
+// Providing no accent.
+//                  MCO ud = (MCO) (MC.getMCO(81)).clone() ; // revia 81, masora 96
+//                  MCOs.add(ud) ;
+                    }
+                else{
+                    System.out.println("Prior MCO isn't a nun!") ;
+                    }
+                }
+// Leave a note
+            M.Value = Character.toString(c1) ;
+            MCOs.add(M) ;
+            }
+        else{
+            System.out.println("MC: Unknown type for an MCO Object.") ;
+            }
+        }
+//-----------------------------------------------------------------------------
+               
+// At this point the Consonants are where they should be.
+// Locating the consonants and FinalConsonants.
+
+// An incoming word a final consonant before a maqaf 
+// as well as at the end .
+ 
+    int LastConsonant = -1 ;
+    int ConsonantIndex = 0 ;
+    int ConsonantCount = 0 ;
+    for (int k = 0; k < MCOs.size(); k++){
+        M = (MCO) MCOs.elementAt(k) ;
+
+// *** Test for MCO.ConsonantMark added 17 June 2004 ***
+        if( M.Type == MCO.Consonant | M.Type == MCO.ConsonantMark ){
+
+            ConsonantPositions[ConsonantIndex] = k ;
+            LastConsonant = k ;
+            ConsonantIndex++ ;
+            ConsonantCount++ ;
+            }
+// Look for a Maqef, if found, set the LastConsonant final.
+        if( (M.Name).compareTo("maqef") == 0){
+            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 ) ;
+
+       }
+
+       }
+    else{
+       OrderedMCOs = MCOs ;
+       }      
+
+
+//  print(OrderedMCOs) ;
+     
+//-----------------------------------------------------------------------------
+
+// Output the ordered Vector
+
+    String S = "" ;
+    for (int k = 0; k < OrderedMCOs.size(); k++){
+        M = (MCO) OrderedMCOs.elementAt(k) ;
+        Type = M.Type ;
+//  Only Notes require special treatment
+        if (Type == MCO.Note){
+            S = S + "<note type=\"textual\">"+ Note.Notes.get( M.Value)+ "</note>";
+            }
+	    
+    // MG              DISABLE MORPH DIVISION!!!!!!!!!!!!!!!!
+	    
+        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)) ;
+            } 
+        }      
+        
+    return S ;
+    }
+//-----------------------------------------------------------------------------
+
+// Order the Marks following a Consonant.
+
+void Order( Vector MCOs, int StartIndex, int Limit, Vector OrderedMCOs) {
+     MCO m ;
+     
+//  Check for no Marks
+     if(StartIndex+1==Limit){
+         m = (MCO) MCOs.elementAt(StartIndex) ;
+         OrderedMCOs.add(m) ;
+         return ;
+         }
+//  Check for one Mark
+     if(StartIndex+2==Limit){
+         m = (MCO) MCOs.elementAt(StartIndex) ;
+         OrderedMCOs.add(m) ;
+         m = (MCO) MCOs.elementAt(StartIndex+1) ;
+         OrderedMCOs.add(m) ;
+         return ;
+         }
+         
+// Two or more Marks
+         
+// Save the Consonant
+     m = (MCO) MCOs.elementAt(StartIndex) ;
+     OrderedMCOs.add(m) ;
+
+// Order the marks
+     int MarkCount = (Limit-StartIndex)-1 ; 
+     boolean[] Written = new boolean[MarkCount] ;
+     for (int k =0; k < MarkCount; k++){
+         Written[k] = false ;
+         }
+         
+     int WrittenCount = 0 ;
+     do{        
+// Find the MCO with the smallest possible Group value and write it.
+         int GroupTest = 1000 ;
+         int MCOMin = -1 ;
+         for( int k = StartIndex+1; k < Limit; k++){
+             if(!Written[ k -(StartIndex+1) ]){
+                 m = (MCO) MCOs.elementAt(k)  ;
+                 int g = m.Group ;
+                 if ( g < GroupTest ){
+                     GroupTest = g ;
+                     MCOMin = k ;
+                     }
+                 }
+             }
+         m = (MCO) MCOs.elementAt(MCOMin) ;
+         OrderedMCOs.add(m) ;
+         Written[MCOMin -(StartIndex+1) ] = true ;
+         WrittenCount++ ;
+         }while(WrittenCount < MarkCount) ;
+            
+     }
+//-----------------------------------------------------------------------------
+
+// Output a message plus position.
+
+public void message(String m){
+    System.out.print(m) ;
+    P.printPosition() ;
+    }
+//-----------------------------------------------------------------------------
+
+// Output a message plus position.
+
+public void print(Vector v){
+    System.out.println("\n") ;
+    for (int k = 0; k < v.size(); k++){
+        MCO m = (MCO) v.elementAt(k) ;
+        m.print() ;
+        }
+    System.out.println("\n") ;
+    }
+//-----------------------------------------------------------------------------
+
+// Set a consonant as final.
+
+public void setFinal(int Position){
+// Do nothing if there's no Position to set
+        if (Position < 0) return ;
+        
+        M = (MCO) MCOs.elementAt(Position) ;
+        if (M.Type == MCO.Consonant){
+            MCO Final = new MCO("final" + M.Name, MCO.Consonant, M.FinalValue, M.FinalValue,
+                 M.Group) ;
+            MCOs.setElementAt(Final, Position) ;
+            }
+        else{
+            message("LastConsonant is not a consonant!") ;
+            }
+        return ;
+        }
+//-----------------------------------------------------------------------------
+}
+//==============================================================================
+//==============================================================================

Deleted: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/package.html
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/package.html	2004-07-14 18:09:28 UTC (rev 31)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/package.html	2005-04-01 21:02:08 UTC (rev 32)
@@ -1,57 +0,0 @@
-<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>

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/wlc.conf
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/wlc.conf	2004-07-14 18:09:28 UTC (rev 31)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/wlc.conf	2005-04-01 21:02:08 UTC (rev 32)
@@ -1,5 +1,5 @@
 [WLC]
-DataPath=./modules/texts/ztext/wlc
+DataPath=./modules/texts/ztext/wlc/
 ModDrv=zText
 
 BlockType=BOOK
@@ -7,28 +7,28 @@
 
 SourceType=OSIS
 
-
 GlobalOptionFilter=OSISFootnotes
-#GlobalOptionFilter=OSISHeadings
 GlobalOptionFilter=UTF8Cantillation
 GlobalOptionFilter=UTF8HebrewPoints
 
+#GlobalOptionFilter=OSISHeadings
 #GlobalOptionFilter=OSISStrongs
 #GlobalOptionFilter=OSISMorph
 #GlobalOptionFilter=OSISRedLetterWords
 
-
 Encoding=UTF-8
 Lang=he
 Direction=RtoL
 Font=Ezra SIL
 MinimumVersion=1.5.6
 SwordVersionDate=
-Version=0.1
+Version=0.2
 History_0.1=First public version.
+History_0.2=Update to newer version (wlc43-20050319) of the WLC from WHI; Bugfixes in the conversion program that caused textual errors (thanks to Chris Kimball); Fixed one footnote text template.
+
 Description=Westminster Leningrad Codex
 
-About=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, and ketib-qere variants. Morphological divisions may be added later.\par \par 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. \par \par The transcription was based on the "Supplement to the code manual for the Michigan Old Testament" by Alan Groves. \par \par The WLC is maintained by the Westminster Hebrew Institute, Philadelphia, PA (http://whi.wts.edu/WHI) \par \par Sword module maintained by Martin Gruner (mg dot pub at gmx dot net).
+About=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, and ketib-qere variants. Morphological divisions may be added later.<br> <br> 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. <br><br> The transcription was based on the "Supplement to the code manual for the Michigan Old Testament" by Alan Groves. <br><br> The WLC source is maintained by the Westminster Hebrew Institute, Philadelphia, PA (http://whi.wts.edu/WHI). <br><br> The Sword module is maintained by Martin Gruner (mg dot pub at gmx dot net). Please identify this as the source of derived works.
 
 LCSH=Bible. O.T. Hebrew.
 DistributionLicense=Public Domain

Added: trunk/modules/hebrew-wlc/source/wlc/wlc43-20050319.zip
===================================================================
(Binary files differ)


Property changes on: trunk/modules/hebrew-wlc/source/wlc/wlc43-20050319.zip
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream



More information about the sword-cvs mailing list