[jsword-devel] Beginning with JSword

DM Smith dmsmith at crosswire.org
Fri Oct 2 12:44:11 MST 2009


On 10/02/2009 02:20 PM, Chris Burrell wrote:
> Hi
>
> I'm trying to get a list of all the books in the bible for a 
> particular Book, say the ESV. I'm really new to this... Any ideas if 
> there are examples on the net? I've fonud the Global Key list but that 
> seems to have most verses as well... Can anyone point me to the 
> helpful apis? I seem to find it really difficult to find it on the 
> crosswire website...
Really there is no good way. It is permissible for a particular Book 
(aka module) to only have some of the Bible. For example, imagine a Book 
that contains the text of a manuscript fragment. It might only have a 
few verses of John. Or imagine the on-going work of a translator. The 
Bible might start with just the Gospels and add others incrementally.

So the only way is to check all the keys in the module. We have a sample 
program that you can modify to suit your purposes. See BibleScope:
http://www.crosswire.org/jsword/java2html/org/crosswire/jsword/bridge/BibleScope.java.html

(Note: http://www.crosswire.org/jsword/java2html is a great way to 
browse the code.)

To get the number of books in the KJV versification:

int booksInBible = BibleInfo.booksInBible();

To get the names of each of the books:
BookName bn;
BookNames all = new BookNames(Locale.defaultLocale());
for (int i = 1; i <= booksInBible; i++)
{
     bn = all.getName(i);
}

To create verse references to the first verse in each of the books of 
the Bible.
for (int = 1; i <= booksInBible; i++)
{
     Verse v = new Verse(i, 1, 1);
}

>
> What is a chapter?

It is a division of a Bible or a Commentary. (Internally, commentaries 
are represented in the same way as a Bible.)

> a book category? ...
A book category is the type of Book. It could be Bible, Dictionary, 
Commentary, ....
See: 
http://www.crosswire.org/jsword/java2html/org/crosswire/jsword/book/BookCategory.java.html

Hope this helps,
     DM



More information about the jsword-devel mailing list