Search in sources :

Example 1 with Versification

use of org.crosswire.jsword.versification.Versification in project BibleMultiConverter by schierlm.

the class SWORDVersificationDetector method loadSchemes.

@Override
protected VersificationScheme[] loadSchemes() throws IOException {
    // parse header
    VersificationScheme[] result = new VersificationScheme[ALL_V11N_NAMES.length];
    for (int i = 0; i < result.length; i++) {
        EnumMap<BookID, BitSet[]> coveredBooks = new EnumMap<BookID, BitSet[]>(BookID.class);
        Versification v11n = Versifications.instance().getVersification(ALL_V11N_NAMES[i]);
        for (Iterator<BibleBook> it = v11n.getBookIterator(); it.hasNext(); ) {
            BibleBook bb = (BibleBook) it.next();
            BitSet[] chapters = new BitSet[v11n.getLastChapter(bb)];
            coveredBooks.put(BookMapping.MAPPING.get(bb), chapters);
            for (int j = 1; j <= v11n.getLastChapter(bb); j++) {
                chapters[j - 1] = new BitSet();
                chapters[j - 1].set(1, v11n.getLastVerse(bb, j) + 1);
            }
        }
        result[i] = new VersificationScheme(ALL_V11N_NAMES[i], coveredBooks);
    }
    return result;
}
Also used : BibleBook(org.crosswire.jsword.versification.BibleBook) BookID(biblemulticonverter.data.BookID) BitSet(java.util.BitSet) Versification(org.crosswire.jsword.versification.Versification) EnumMap(java.util.EnumMap)

Aggregations

BookID (biblemulticonverter.data.BookID)1 BitSet (java.util.BitSet)1 EnumMap (java.util.EnumMap)1 BibleBook (org.crosswire.jsword.versification.BibleBook)1 Versification (org.crosswire.jsword.versification.Versification)1