org.crosswire.jsword.examples
Class BibleToOsis

java.lang.Object
  extended by org.crosswire.jsword.examples.BibleToOsis

public class BibleToOsis
extends Object

Start of a mechanism to extract a Bible module to OSIS.

Author:
DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

Field Summary
private static Pattern a10Pattern
           
private static Pattern a11Pattern
           
private static Pattern a12Pattern
           
private static Pattern a13Pattern
           
private static Pattern a14Pattern
           
private static Pattern a15Pattern
           
private static Pattern a16Pattern
           
private static Pattern a17Pattern
           
private static Pattern a1Pattern
           
private static Pattern a2Pattern
           
private static Pattern a3Pattern
           
private static Pattern a4Pattern
           
private static Pattern a5Pattern
           
private static Pattern a6Pattern
           
private static Pattern a7Pattern
           
private static Pattern a8Pattern
           
private static Pattern a9Pattern
           
private static Map acrostics
           
private static String badNote
           
private static Pattern badNotePattern
           
private static String BIBLE_NAME
          The name of a Bible to find
private static String BIBLE_RANGE
           
private static Map bookTitles
           
private static boolean BY_BOOK
           
private static Map colophons
           
private static String divineNameElement
           
private static Pattern divineNamePattern
           
private static String divineNameReplace
           
private static Pattern dn10Pattern
           
private static String dn10Replace
           
private static Pattern dn1Pattern
           
private static String dn1Replace
           
private static Pattern dn2Pattern
           
private static String dn2Replace
           
private static Pattern dn3Pattern
           
private static String dn3Replace
           
private static Pattern dn4Pattern
           
private static String dn4Replace
           
private static Pattern dn5Pattern
           
private static String dn5Replace
           
private static Pattern dn6Pattern
           
private static String dn6Replace
           
private static Pattern dn7Pattern
           
private static String dn7Replace
           
private static Pattern dn8Pattern
           
private static String dn8Replace
           
private static Pattern dn9Pattern
           
private static String dn9Replace
           
private static Pattern dna1Pattern
           
private static String dna1Replace
           
private static Pattern dna2Pattern
           
private  String filename
           
private static Map hebLetters
           
private static Pattern morphNPattern
           
private static Pattern morphTPattern
           
private  boolean moveP
           
private static Pattern p1Pattern
           
private static Set paragraphs
           
private static FieldPosition pos
           
private static Pattern pPattern
           
private static String preVerseElement
           
private static Pattern preVersePattern
           
private static String preVerseStart
           
private static String psalmTitleElement
           
private static Pattern psalmTitlePattern
           
private static String psalmTitleStart
           
private static String respElement
           
private static Pattern respPattern
           
private static Pattern srcPattern
           
private static String transChangeSeg
           
private static Pattern transChangeSegPattern
           
private static Pattern w10Pattern
           
private static Pattern w11Pattern
           
private static Pattern w12Pattern
           
private static Pattern w1Pattern
           
private static Pattern w2Pattern
           
private static Pattern w3Pattern
           
private static Pattern w4Pattern
           
private static Pattern w5Pattern
           
private static Pattern w6Pattern
           
private static Pattern w7Pattern
           
private static Pattern w8Pattern
           
private static Pattern w9Pattern
           
private static String wElement
           
private static Pattern wnPattern
           
private static Pattern wPattern
           
private  Writer writer
           
 
Constructor Summary
BibleToOsis()
           
 
Method Summary
private  void buildBookClose(StringBuffer buf, String bookName)
           
private  void buildBookOpen(StringBuffer buf, String bookName)
           
private  void buildChapterClose(StringBuffer buf)
           
private  void buildChapterOpen(StringBuffer buf, String bookName, int chapter)
           
private  void buildDocumentClose(StringBuffer buf, boolean force)
           
private  void buildDocumentOpen(StringBuffer buf, BookMetaData bmd, String range, boolean force)
           
private  void buildPreVerseClose(StringBuffer buf)
           
private  void buildPreVerseOpen(StringBuffer buf, String preVerse)
           
private  void buildPsalmTitle(StringBuffer buf, String psalmTitle)
           
private  void buildVerseClose(StringBuffer buf, String osisID)
           
private  void buildVerseOpen(StringBuffer buf, String osisID)
           
private  String cleanup(String osisID, String input, boolean inVerse)
           
private  void closeOutputFile(boolean close)
           
 void dump(String name, String range)
           
private  String fixApostrophe(String osisID, String input)
           
private  String fixDivineName(String osisID, String input)
           
private  String fixHyphenatedNames(String osisID, String input)
           
private  String fixInscriptions(String osisID, String input)
           
private  String fixNotes(String osisID, String input)
           
private  String fixParagraphs(String osisID, String input, boolean inVerse)
           
private  String fixPunctuation(String osisID, String input)
           
private  String fixSpelling(String osisID, String input)
           
private  String fixTransChange(String osisID, String input)
           
static void main(String[] args)
           
private  void openOutputFile(String newFilename, boolean open)
           
private  void parse()
           
private  String replace(String input, String pattern, String replacement)
           
static String unescape(String s)
          Convert a string containing URL escape sequences to UTF-8.
private  void writeDocument(StringBuffer buf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BIBLE_NAME

private static final String BIBLE_NAME
The name of a Bible to find

See Also:
Constant Field Values

BIBLE_RANGE

private static final String BIBLE_RANGE
See Also:
Constant Field Values

BY_BOOK

private static final boolean BY_BOOK
See Also:
Constant Field Values

pos

private static FieldPosition pos

preVerseStart

private static String preVerseStart

preVerseElement

private static String preVerseElement

preVersePattern

private static Pattern preVersePattern

psalmTitleStart

private static String psalmTitleStart

psalmTitleElement

private static String psalmTitleElement

psalmTitlePattern

private static Pattern psalmTitlePattern

divineNameElement

private static String divineNameElement

divineNameReplace

private static String divineNameReplace

divineNamePattern

private static Pattern divineNamePattern

dna1Pattern

private static Pattern dna1Pattern

dna2Pattern

private static Pattern dna2Pattern

dna1Replace

private static String dna1Replace

dn1Pattern

private static Pattern dn1Pattern

dn1Replace

private static String dn1Replace

dn2Pattern

private static Pattern dn2Pattern

dn2Replace

private static String dn2Replace

dn3Pattern

private static Pattern dn3Pattern

dn3Replace

private static String dn3Replace

dn4Pattern

private static Pattern dn4Pattern

dn4Replace

private static String dn4Replace

dn5Pattern

private static Pattern dn5Pattern

dn5Replace

private static String dn5Replace

dn6Pattern

private static Pattern dn6Pattern

dn6Replace

private static String dn6Replace

dn7Pattern

private static Pattern dn7Pattern

dn7Replace

private static String dn7Replace

dn8Pattern

private static Pattern dn8Pattern

dn8Replace

private static String dn8Replace

dn9Pattern

private static Pattern dn9Pattern

dn9Replace

private static String dn9Replace

dn10Pattern

private static Pattern dn10Pattern

dn10Replace

private static String dn10Replace

transChangeSeg

private static String transChangeSeg

transChangeSegPattern

private static Pattern transChangeSegPattern

badNote

private static String badNote

badNotePattern

private static Pattern badNotePattern

respElement

private static String respElement

respPattern

private static Pattern respPattern

pPattern

private static Pattern pPattern

wElement

private static String wElement

wPattern

private static Pattern wPattern

srcPattern

private static Pattern srcPattern

morphNPattern

private static Pattern morphNPattern

morphTPattern

private static Pattern morphTPattern

a1Pattern

private static Pattern a1Pattern

a2Pattern

private static Pattern a2Pattern

a3Pattern

private static Pattern a3Pattern

a4Pattern

private static Pattern a4Pattern

a5Pattern

private static Pattern a5Pattern

a6Pattern

private static Pattern a6Pattern

a7Pattern

private static Pattern a7Pattern

a8Pattern

private static Pattern a8Pattern

a9Pattern

private static Pattern a9Pattern

a10Pattern

private static Pattern a10Pattern

a11Pattern

private static Pattern a11Pattern

a12Pattern

private static Pattern a12Pattern

a13Pattern

private static Pattern a13Pattern

a14Pattern

private static Pattern a14Pattern

a15Pattern

private static Pattern a15Pattern

a16Pattern

private static Pattern a16Pattern

a17Pattern

private static Pattern a17Pattern

w1Pattern

private static Pattern w1Pattern

w4Pattern

private static Pattern w4Pattern

w5Pattern

private static Pattern w5Pattern

w6Pattern

private static Pattern w6Pattern

w7Pattern

private static Pattern w7Pattern

w2Pattern

private static Pattern w2Pattern

w3Pattern

private static Pattern w3Pattern

w8Pattern

private static Pattern w8Pattern

w9Pattern

private static Pattern w9Pattern

w10Pattern

private static Pattern w10Pattern

w11Pattern

private static Pattern w11Pattern

w12Pattern

private static Pattern w12Pattern

wnPattern

private static Pattern wnPattern

p1Pattern

private static Pattern p1Pattern

bookTitles

private static Map bookTitles

colophons

private static Map colophons

acrostics

private static Map acrostics

hebLetters

private static Map hebLetters

moveP

private boolean moveP

paragraphs

private static Set paragraphs

writer

private Writer writer

filename

private String filename
Constructor Detail

BibleToOsis

public BibleToOsis()
Method Detail

main

public static void main(String[] args)
Parameters:
args -

dump

public void dump(String name,
                 String range)

unescape

public static String unescape(String s)
Convert a string containing URL escape sequences to UTF-8. This is needed because the KJV strongsMarkup notes contain URL escapes. This routine is borrowed from http://www.w3.org/International/unescape.java


buildDocumentOpen

private void buildDocumentOpen(StringBuffer buf,
                               BookMetaData bmd,
                               String range,
                               boolean force)

buildDocumentClose

private void buildDocumentClose(StringBuffer buf,
                                boolean force)

buildBookOpen

private void buildBookOpen(StringBuffer buf,
                           String bookName)

buildBookClose

private void buildBookClose(StringBuffer buf,
                            String bookName)

buildChapterClose

private void buildChapterClose(StringBuffer buf)

buildChapterOpen

private void buildChapterOpen(StringBuffer buf,
                              String bookName,
                              int chapter)

buildPsalmTitle

private void buildPsalmTitle(StringBuffer buf,
                             String psalmTitle)

buildPreVerseOpen

private void buildPreVerseOpen(StringBuffer buf,
                               String preVerse)

buildPreVerseClose

private void buildPreVerseClose(StringBuffer buf)

buildVerseOpen

private void buildVerseOpen(StringBuffer buf,
                            String osisID)

buildVerseClose

private void buildVerseClose(StringBuffer buf,
                             String osisID)

openOutputFile

private void openOutputFile(String newFilename,
                            boolean open)
                     throws IOException
Throws:
IOException

writeDocument

private void writeDocument(StringBuffer buf)
                    throws IOException
Throws:
IOException

closeOutputFile

private void closeOutputFile(boolean close)
                      throws IOException
Throws:
IOException

parse

private void parse()

cleanup

private String cleanup(String osisID,
                       String input,
                       boolean inVerse)

fixApostrophe

private String fixApostrophe(String osisID,
                             String input)

fixPunctuation

private String fixPunctuation(String osisID,
                              String input)

fixSpelling

private String fixSpelling(String osisID,
                           String input)

fixTransChange

private String fixTransChange(String osisID,
                              String input)

fixHyphenatedNames

private String fixHyphenatedNames(String osisID,
                                  String input)

fixDivineName

private String fixDivineName(String osisID,
                             String input)

fixInscriptions

private String fixInscriptions(String osisID,
                               String input)

fixParagraphs

private String fixParagraphs(String osisID,
                             String input,
                             boolean inVerse)

fixNotes

private String fixNotes(String osisID,
                        String input)

replace

private String replace(String input,
                       String pattern,
                       String replacement)

Copyright ยจ 2003-2006