[sword-cvs] swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse
Books.java, 1.2, 1.3 Chapters.java, 1.1, 1.2 Parser.java, 1.2,
1.3 Verses.java, 1.1, 1.2
sword at www.crosswire.org
sword at www.crosswire.org
Sat Jun 5 10:08:59 MST 2004
Committed by: mgruner
Update of /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse
In directory www:/tmp/cvs-serv28064/WLC2OSIS/Parse
Modified Files:
Books.java Chapters.java Parser.java Verses.java
Log Message:
mgruner: converter generates something that looks like OSIS now.
Index: Books.java
===================================================================
RCS file: /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Books.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Books.java 4 Jun 2004 12:49:16 -0000 1.2
+++ Books.java 5 Jun 2004 17:08:57 -0000 1.3
@@ -43,15 +43,18 @@
P.ChapterNumber = 0 ;
P.VerseNumber = 0 ;
P.WordNumber = 0 ;
- A.w.openTag("tanach", 0) ;
- A.w.openTag("book", 1) ;
- A.w.openTag("names", 2) ;
- A.w.writeString("name", 3, BookObject.name ) ;
- A.w.writeString("abbrev", 3, BookObject.abbrev) ;
- A.w.writeInt("number", 3, BookObject.number) ;
- A.w.writeString("filename", 3, BookObject.filename) ;
- A.w.writeString("hebrewname", 3, BookObject.hebrewname) ;
- A.w.closeTag("names", 2) ;
+// A.w.openTag("tanach", 0) ;
+ A.w.openTag("div type=\"book\"", 1) ;
+ A.w.writeAttributedString("title", 2, "type=\"main\" short=\"" +
+ BookObject.name +"\"", BookObject.name);
+
+// A.w.openTag("names", 2) ;
+// A.w.writeString("name", 3, BookObject.name ) ;
+// A.w.writeString("abbrev", 3, BookObject.abbrev) ;
+// A.w.writeInt("number", 3, BookObject.number) ;
+// A.w.writeString("filename", 3, BookObject.filename) ;
+// A.w.writeString("hebrewname", 3, BookObject.hebrewname) ;
+// A.w.closeTag("names", 2) ;
}
//------------------------------------------------------------------------------
@@ -63,13 +66,13 @@
P.BookChapterCount = P.ChapterNumber ;
P.TanachChapterCount = P.TanachChapterCount + P.ChapterNumber ;
- A.w.writeInt("vs", 2, P.BookVerseCount) ;
- A.w.writeInt("cs", 2, P.BookChapterCount) ;
- A.w.closeTag("book", 1) ;
- A.w.closeTag("tanach", 0) ;
+// A.w.writeInt("vs", 2, P.BookVerseCount) ;
+// A.w.writeInt("cs", 2, P.BookChapterCount) ;
+ A.w.closeTag("div", 1) ;
+// A.w.closeTag("tanach", 0) ;
// Add the transcription notes.
- Note.writeNotes(A.w) ;
+// Note.writeNotes(A.w) ;
// A.w.close() ;
System.out.println( BookObject.filename + " has been written." ) ;
Index: Chapters.java
===================================================================
RCS file: /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Chapters.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Chapters.java 4 Jun 2004 09:14:52 -0000 1.1
+++ Chapters.java 5 Jun 2004 17:08:57 -0000 1.2
@@ -25,7 +25,10 @@
P.ChapterNumber = P.ChapterNumber + 1 ;
P.VerseNumber = 0 ;
P.WordNumber = 0 ;
- A.w.openAttributedTag("c", 2, "n", new Integer(P.ChapterNumber).toString() ) ;
+ String num = new Integer(P.ChapterNumber).toString();
+ A.w.writeMarker("chapter sID=\""+P.Book+"."+num+
+ "\" osisID=\""+P.Book+"."+num+
+ "\" n=\""+num+"\"", 2) ;
// System.out.println("\nChapter " + A.F.i(P.ChapterNumber,2) + " start." ) ;
}
//------------------------------------------------------------------------------
@@ -37,8 +40,13 @@
P.ChapterVerseCount = P.VerseNumber ;
P.BookVerseCount = P.BookVerseCount + P.VerseNumber ;
P.TanachVerseCount = P.TanachVerseCount + P.VerseNumber ;
- A.w.writeInt("vs", 3, P.VerseNumber) ;
- A.w.closeTag("c", 2) ;
+
+ String num = new Integer(P.ChapterNumber).toString();
+ A.w.writeMarker("chapter eID=\""+P.Book+"."+num+"\"", 2) ;
+
+
+// A.w.writeInt("vs", 3, P.VerseNumber) ;
+// A.w.closeTag("c", 2) ;
// System.out.println("Chapter " + A.F.i(P.ChapterNumber,2) + " ends with "
// + A.F.i(P.VerseNumber,2) + " verses." ) ;
}
Index: Parser.java
===================================================================
RCS file: /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Parser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Parser.java 4 Jun 2004 12:49:16 -0000 1.2
+++ Parser.java 5 Jun 2004 17:08:57 -0000 1.3
@@ -18,7 +18,7 @@
// Working classes
-Tanach tanach ;
+// Tanach tanach ;
public Books b ;
Chapters c ;
Verses v ;
@@ -32,7 +32,7 @@
public boolean MarkerWritten ; // Indicates a marker has been written
// between two words.
-String BookName ;
+// String BookName ;
String Book ;
int Chapter ;
@@ -66,7 +66,7 @@
t = new Tokenizer(A) ;
// Set up the Tanach, Books, Chapters, Verses, Words, and Markers classes.
- tanach = new Tanach(A, this) ;
+// tanach = new Tanach(A, this) ;
b = new Books(A, this) ;
c = new Chapters(A, this) ;
v = new Verses(A, this) ;
@@ -86,12 +86,12 @@
boolean PreviousEOL = true ;
System.out.println("\n") ;
- A.w = new XMLWriter(A.OutputDirectory, "WLC_OSIS", "Tanach", "Tanach", "" ) ;
+ A.w = new XMLWriter(A.OutputDirectory, "WLC_OSIS") ;
// Write the header
Header.writeHeader(A, A.w) ;
- tanach.start() ;
+// tanach.start() ;
for (int k = 0; k < A.InputChars.length ; k++){
@@ -183,7 +183,13 @@
v.end() ;
c.end() ;
b.end() ;
- tanach.end() ;
+// tanach.end() ;
+
+ // Write the footer
+ Header.writeFooter(A, A.w) ;
+
+
+ A.w.close();
return ;
}
//----------------------------------------------------------------------------
Index: Verses.java
===================================================================
RCS file: /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/Parse/Verses.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Verses.java 4 Jun 2004 09:14:52 -0000 1.1
+++ Verses.java 5 Jun 2004 17:08:57 -0000 1.2
@@ -23,7 +23,13 @@
public void start(){
P.VerseNumber = P.VerseNumber + 1 ;
P.WordNumber = 0 ;
- A.w.openAttributedTag("v", 3, "n", new Integer(P.VerseNumber).toString() ) ;
+
+ String chapternum = new Integer(P.ChapterNumber).toString();
+ String versenum = new Integer(P.VerseNumber).toString();
+ A.w.writeMarker("verse sID=\""+P.Book+"."+chapternum+"."+versenum+
+ "\" osisID=\""+P.Book+"."+chapternum+"."+versenum+"\"", 3) ;
+
+// A.w.openAttributedTag("v", 3, "n", ) ;
// System.out.println("\nVerse " + A.F.i(P.VerseNumber,2) + " start." ) ;
}
//------------------------------------------------------------------------------
@@ -32,7 +38,12 @@
public void end(){
if( P.VerseNumber != 0){
- A.w.closeTag("v", 3) ;
+
+ String chapternum = new Integer(P.ChapterNumber).toString();
+ String versenum = new Integer(P.VerseNumber).toString();
+ A.w.writeMarker("verse eID=\""+P.Book+"."+chapternum+"."+versenum+"\"", 3) ;
+
+// A.w.closeTag("v", 3) ;
// System.out.println("Verse " + A.F.i(P.VerseNumber,2) + " ends with "
// + A.F.i(P.WordNumber,2) + " words." ) ;
}
More information about the sword-cvs
mailing list