summaryrefslogtreecommitdiffstats
path: root/modules/hebrew-wlc/WLC2OSIS
diff options
context:
space:
mode:
authorMartin Gruner <mg.pub@gmx.net>2004-06-10 12:00:20 +0000
committerMartin Gruner <mg.pub@gmx.net>2004-06-10 12:00:20 +0000
commitf4010ce2dd14dff4e0858f57bc50f5c9a24ff80d (patch)
tree083505469a0161136c7f7a907b19939cbe69f4f2 /modules/hebrew-wlc/WLC2OSIS
parentb4dd71cb790ee6fb8f5fff0b22dd4f3c93c5b662 (diff)
downloadsword-tools-f4010ce2dd14dff4e0858f57bc50f5c9a24ff80d.tar.gz
mgruner: further updates to the WLC converter
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@26 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'modules/hebrew-wlc/WLC2OSIS')
-rw-r--r--modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java1
-rw-r--r--modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Words.java20
-rw-r--r--modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/MC.java4
-rw-r--r--modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java93
-rw-r--r--modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java10
-rw-r--r--modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/UnicodeChar.java2
-rw-r--r--modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java7
-rw-r--r--modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSIS.java2
8 files changed, 67 insertions, 72 deletions
diff --git a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java
index 1525e37..d1725e8 100644
--- a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java
+++ b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java
@@ -75,6 +75,7 @@ public Parser(WLC2OSIS A) {
m = new Markers(A, this) ;
wkq = new WKQ(this) ;
new MC() ;
+ Note.setNotes();
}
//------------------------------------------------------------------------------
diff --git a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Words.java b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Words.java
index 5acafdb..26c7deb 100644
--- a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Words.java
+++ b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Words.java
@@ -96,7 +96,7 @@ public void write(String W, String Type) {
//----------------------------------------------------------------------------------
public void writeWord(String Word, String Type) {
-
+
// Check for any exception markers ]x
String Out = "" ;
@@ -106,15 +106,29 @@ public void writeWord(String Word, String Type) {
k++ ;
char ExceptionValue = Word.charAt(k) ;
Out = Out + "<x>" + ExceptionValue +"</x>" ;
+ System.out.println("Exception occured");
}
else{
Out = Out + c ;
}
}
-// MG: HACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + " "
- A.w.writeString(Type, 4, Out + " ") ;
+
+ if (Type.charAt(0) == 'w') {
+ A.w.appendText(Out + " ") ;
+ }
+ else if (Type.charAt(0) == 'k') {
+ A.w.appendText("["+ Out + " " + H.kaf + "] ") ;
+ }
+ else if (Type.charAt(0) == 'q') {
+ A.w.appendText("(" + Out + " " + H.qof+ ") ") ;
+ }
+ else {
+ System.out.println("Warning: unknown word type!");
+ P.printPosition();
+ }
P.MarkerWritten = false ;
}
}
+
//==============================================================================
//==============================================================================
diff --git a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/MC.java b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/MC.java
index 851b76c..f72f400 100644
--- a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/MC.java
+++ b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/MC.java
@@ -162,8 +162,8 @@ static {
if(k == (int) ']') Characters[k] =
new MCO("Note", MCO.Note, ' ', ' ', 14 ) ;
-
- }
+
+ }
//-----------------------------------------------------------------------------
diff --git a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java
index c42998d..f44b7b5 100644
--- a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java
+++ b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Note.java
@@ -2,7 +2,7 @@ package WLC2OSIS.Translate ;
import WLC2OSIS.Utilities.* ;
-import java.util.Vector ;
+import java.util.Hashtable ;
//==============================================================================
/**
@@ -11,68 +11,37 @@ import java.util.Vector ;
//==============================================================================
public class Note{
-String Code ;
-String Note ;
+static Hashtable Notes = new Hashtable();
-static Vector Notes = new Vector() ;
-
-Note(String Code, String Note){
- this.Code = Code ;
- this.Note = Note ;
- }
-//-----------------------------------------------------------------------------
-
-// Writes the Notes to the XML file.
-
-public static void writeNotes(XMLWriter w) {
- setNotes() ;
- w.openTag("notes", 0) ;
- for (int k=0; k < Notes.size() ; k++){
- Note n = (Note) Notes.elementAt(k) ;
- w.openTag("note", 1) ;
- w.writeString("code", 2, n.Code ) ;
- w.writeString("note", 2, n.Note ) ;
- w.closeTag("note", 1) ;
- }
- w.closeTag("notes", 0) ;
- }
-//-----------------------------------------------------------------------------
-
-// Writes the Notes to the XML file.
-
-static void setNotes() {
-
-// Do this only once!
+public static void setNotes(){
+ // Do this only once!
if(Notes.size() > 1) return ;
- Notes.add(new Note("1", "BHS has been faithful to the Leningrad Codex where "
- + "\nthere might be a question of the validity of the form "
- + "\nand we keep the same form as BHS.")) ;
- Notes.add(new Note("2", "We have added a sop pasuq where L and BHC omit it."
- + "\n(The added sof pasuq often is missing from the text.)" )) ;
- Notes.add(new Note("3", "We read or understand L differently than BHC (1983 Edition). "
- + "\nOften this notation indicates a typographical error in BHS.")) ;
- Notes.add(new Note("4", "Puncta Extraordaria -- "
- + "\na \\u05c4 is used to mark such marks in the text"
- + "\nwhen they are above the line and"
- + "\na \\u0323 when they are below the line."));
- Notes.add(new Note("5", "Large letter(s).")) ;
- Notes.add(new Note("6", "Small letter(s).")) ;
- Notes.add(new Note("7", "Suspended letter(s).")) ;
- Notes.add(new Note("8", "Inverted nun in the text.")) ;
- Notes.add(new Note("9", "BHS has abandoned L and we concur. "
- + "\nAll of these occurrences are ketib/qere problems.")) ;
- Notes.add(new Note("a", "Adaptations to a Qere which L and BHS, by their design, "
- + "do not indicate.")) ;
- Notes.add(new Note("m", "Miscellaneous notes to the text and occasions "
- + "\nwhere more than one bracket category applies.")) ;
- Notes.add(new Note("q", "We have abandoned or added a ketib/qere relative to BHS. "
- + "\nIn doing this we agree with L against BHS.")) ;
- Notes.add(new Note("y", "Yathir readings in L which we have designated as Qeres "
- + "\nwhen both Dothan and BHS list a Qere.")) ;
+
+ 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.") ;
}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-}
-//==============================================================================
-//==============================================================================
+} \ No newline at end of file
diff --git a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java
index c0400a4..1c1e44a 100644
--- a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java
+++ b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/Translate.java
@@ -2,6 +2,7 @@ package WLC2OSIS.Translate ;
import WLC2OSIS.* ;
import WLC2OSIS.Parse.* ;
+import WLC2OSIS.Translate.Note ;
import WLC2OSIS.Utilities.* ;
import Utilities.* ;
@@ -32,7 +33,7 @@ public Translate(WLC2OSIS A, Parser P) {
//------------------------------------------------------------------------------
// Translates an MC word (not qere or ketib) to a Unicode String.
-// Notes are included as <x>n</x>.
+// Notes are included as <note type="textual">text of note</x>.
public String translate(String W){
len = W.length() ;
@@ -234,10 +235,13 @@ public String translate(String W){
Type = M.Type ;
// Only Notes require special treatment
if (Type == MCO.Note){
- S = S + "<x>" + M.Value + "</x>" ;
+ S = S + "<note type=\"textual\">"+ Note.Notes.get( M.Value)+ "</note>";
}
+
+ // MG DISABLE MORPH DIVISION!!!!!!!!!!!!!!!!
+
else if ((Type == MCO.MorphologicalDivision)){
- S = S + A.MorphologicalDivisionMarker ;
+// S = S + A.MorphologicalDivisionMarker ;
}
else{
S = S + M.Value ;
diff --git a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/UnicodeChar.java b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/UnicodeChar.java
index aac1eb1..950b239 100644
--- a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/UnicodeChar.java
+++ b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Translate/UnicodeChar.java
@@ -33,7 +33,7 @@ public char Value= ' ' ; // Unicode character value.
/** List of equivalent characters represented by this Unicode character.*/
public String Equivalents = "" ; // List of equivalents
/** Notes provided by the Unicode group.*/
-public String Notes = "" ; // Additional notes.
+ public String Notes = "" ; // Additional notes.
/** MCW characters corresponding to this Unicode character.*/
public String MCCode = "" ;
/** Combining group value. */
diff --git a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java
index a83a656..ed640ec 100644
--- a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java
+++ b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Utilities/XMLWriter.java
@@ -68,6 +68,13 @@ public void writeAttributedString(String Tag, int Level, String AttributeString,
s = s + "</" + Tag + ">" ;
writeString(s) ;
}
+
+// MG: Hack
+//-----------------------------------------------------------------------------
+public void appendText(String text){
+ writeString(text) ;
+ }
+
//-----------------------------------------------------------------------------
public void writeBoolean(String Tag, int Level, boolean B){
diff --git a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSIS.java b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSIS.java
index 7b6c099..4918885 100644
--- a/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSIS.java
+++ b/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/WLC2OSIS.java
@@ -69,7 +69,7 @@ public String[] Description = {
"The book names in English and Hebrew of the Jewish Publication Society "
+ "(JPS) Tanach have been added."} ;
-public char MorphologicalDivisionMarker = '/' ;
+//public char MorphologicalDivisionMarker = '/' ;
//-----------------------------------------------------------------------------
public final int InputBufferSize = 4000000 ; // Length of input in bytes.