[sword-svn] r75 - in trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS: Parse Translate

mgruner at crosswire.org mgruner at crosswire.org
Mon Jul 31 13:20:35 MST 2006


Author: mgruner
Date: 2006-07-31 13:20:27 -0700 (Mon, 31 Jul 2006)
New Revision: 75

Modified:
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java
   trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java
Log:


Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java	2006-07-27 19:53:15 UTC (rev 74)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java	2006-07-31 20:20:27 UTC (rev 75)
@@ -114,17 +114,25 @@
 		//System.out.println("Expression: " + word);
 		
 		// Paragraph marker found
-		if (morph == "x"){
-			System.out.println("paragraph marker found!");
-			if (word == "P"){
+		if (morph.compareTo("x") == 0){
+			if (word.compareTo("P") == 0){ //
 				A.writer.appendText("  "+constructWord(word, lemma, morph)+"<p/>");
 			}
-			else if (word == "S"){
+			else if (word.compareTo("S") == 0){ //
 				A.writer.appendText("  "+constructWord(word, lemma, morph)+"  ");
 			}
-			else {System.out.println("Unknown marker."); System.exit(1);}
+			else if (word.compareTo("N") == 0){ //inverted nun
+				A.writer.appendText(" "+constructWord(word, lemma, morph)+" ");
+			}
+			else {System.out.println("Unknown paragraph marker: " + s); System.exit(1);}
 		}
 		
+		//Note found
+		if (note != null && note.length() > 0){
+			System.out.println("Note: "+s);
+			A.writer.appendText("<note type=\"textual\" xml:lang=\"en\">"+Note.Notes.get(note)+"</note>" );
+		}
+		
 		//remember
 		oldBookCode = newBookCode;
 	    oldChapter = newChapter;
@@ -140,7 +148,7 @@
 //----------------------------------------------------------------------------
 
 public String constructWord(String word, String lemma, String morph){
-	return "<seg type=\"x-morph\" lemma=\""+lemma+"\" morph=\""+morph+"\">"+word+"</seg>";
+	return "<seg type=\"x-morph\" lemma=\""+T.translate(lemma)+"\" morph=\""+morph+"\">"+T.translate(word)+"</seg>";
 }
 
 }

Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java	2006-07-27 19:53:15 UTC (rev 74)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java	2006-07-31 20:20:27 UTC (rev 75)
@@ -9,36 +9,36 @@
 //==============================================================================
 public class Note{
 
-static Hashtable Notes = new Hashtable();
+public 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 " 
+    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 added a sop pasuq where L and BHC omit it." ) ;
-    Notes.put("3", "We read or understand L differently than BHS (1983 Edition). "
+    Notes.put("]2", "We have added a sop pasuq where L and BHC omit it." ) ;
+    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"
+    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.") ;
-    Notes.put("9", "BHS has abandoned L and we concur. " 
+    Notes.put("]5", "Large letter(s).") ;
+    Notes.put("]6", "Small letter(s).") ;
+    Notes.put("]7", "Suspended letter(s).") ;
+    Notes.put("]8", "Inverted nun.") ;
+    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, "
+    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 "
+    Notes.put("]m", "Miscellaneous notes to the text and occasions "
                            + "where more than one bracket category applies.") ;
-    Notes.put("q", "We have abandoned or added a ketib/qere relative to BHS. "
+    Notes.put("]q", "We have abandoned or added 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 "
+    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	2006-07-27 19:53:15 UTC (rev 74)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java	2006-07-31 20:20:27 UTC (rev 75)
@@ -219,10 +219,10 @@
         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 + P.MorphologicalSegmentEnd + M.Value + P.MorphologicalSegmentStart; 
-		}
+//		//Mark morph segments when a maqef is present
+//		else if ( (M.Name).compareTo("maqef") == 0 ){
+//			S = S + P.MorphologicalSegmentEnd + M.Value + P.MorphologicalSegmentStart; 
+//		}
 	    
         else if ((Type == MCO.MorphologicalDivision)){
             S = S + P.MorphologicalDivisionMarker ;



More information about the sword-cvs mailing list