[sword-svn] r78 - trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse

mgruner at www.crosswire.org mgruner at www.crosswire.org
Thu Sep 14 12:58:07 MST 2006


Author: mgruner
Date: 2006-09-14 12:58:01 -0700 (Thu, 14 Sep 2006)
New Revision: 78

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


Modified: trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java
===================================================================
--- trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java	2006-08-12 13:20:06 UTC (rev 77)
+++ trunk/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java	2006-09-14 19:58:01 UTC (rev 78)
@@ -1,8 +1,8 @@
 package WLC2OSIS.Parse ;
 
 import java.io.*;
-import WLC2OSIS.* ;
-import WLC2OSIS.Translate.* ;
+import WLC2OSIS.*;
+import WLC2OSIS.Translate.*;
 
 public class Parser{
 
@@ -48,16 +48,16 @@
 	int newVerse = 0;
 	int oldWordNumber = 0;
 	int newWordNumber = 0;
-	int oldSubWordNumber = 0;
-	int newSubWordNumber = 0;
 
-
-    java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("(\\w\\w)(\\d+):(\\d+),(\\d+)\\.(\\d+)(\\]\\S)?\\s(\\S+)\\s([^_]+)(_\\d+)?(@|%)(\\S+)");
+//																		book	chap	vs	  word#	subword#  note		ketivquere			word homonym lang  lemma
+    java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("(\\w\\w)(\\d+):(\\d+),(\\d+)\\.(\\d+)(\\]\\S)?\\s([*]+)?([^* ]+)\\s([^_]+)(_\\d+)?(@|%)(\\S+)");
      
     while ( true ){
     	s="";
     	try{
 	    	s= file.readLine();
+	    	system.out.println(s);
+	    	continue;
 	    }
 	  	catch (IOException e) {
 			System.out.println("Read error: " + e) ;
@@ -88,24 +88,26 @@
 	    oldChapter = newChapter;
 	    oldVerse = newVerse;
 	    oldWordNumber = newWordNumber;
-	    oldSubWordNumber = newSubWordNumber;
 		
 		// Parse the identifier
 		newBookCode = match.group(1);
 		newChapter = Integer.parseInt( match.group(2) );
 		newVerse   = Integer.parseInt( match.group(3) );
 		newWordNumber	= Integer.parseInt( match.group(4) );
-		newSubWordNumber = Integer.parseInt( match.group(5) );
+		//newSubWordNumber = Integer.parseInt( match.group(5) ); not used
 		String note = match.group(6);
-		String word = match.group(7);
-		String lemma	= match.group(8);
-		String homonym = match.group(9);
+		String ketivqere = match.group(7);
+		String word = match.group(8);
+		String lemma	= match.group(9);
+		String homonym = match.group(10);
 		if (homonym != null){
 			homonym = homonym.substring(1); //"_1" to "1"
 		}
-		String separator = match.group(10);
-		String morph  = match.group(11);
+		String separator = match.group(11);
+		String morph  = match.group(12);
 		
+		System.out.println(s);
+		
 		// Verse changed, close old and open new
 		if ((!newBookCode.equals(oldBookCode)) || (newChapter != oldChapter) || (newVerse != oldVerse))
 		{
@@ -155,19 +157,19 @@
 		// Paragraph marker found
 		if (morph.compareTo("x") == 0){
 			if (word.compareTo("P") == 0){ //
-				A.writer.appendText("  "+constructWord(word, lemma, homonym, morph)+"<p/>");
+				//A.writer.appendText("  "+constructWord(word, lemma, homonym, morph)+"<p/>");
 			}
 			else if (word.compareTo("S") == 0){ //
-				A.writer.appendText("  "+constructWord(word, lemma, homonym, morph)+"  ");
+				//A.writer.appendText("  "+constructWord(word, lemma, homonym, morph)+"  ");
 			}
 			else if (word.compareTo("N") == 0){ //inverted nun
-				A.writer.appendText(" "+constructWord(word, lemma, homonym, morph)+" ");
+				//A.writer.appendText(" "+constructWord(word, lemma, homonym, morph)+" ");
 			}
 			else {System.out.println("Unknown paragraph marker: " + s); System.exit(1);}
 		}
 		
 		//now the text itself
-		A.writer.appendText( constructWord(word, lemma, homonym, morph) );
+		//A.writer.appendText( constructWord(word, lemma, homonym, morph) );
 		
 		//Note found
 		if (note != null && note.length() > 0){




More information about the sword-cvs mailing list