[sword-devel] Is there "bare-bones" interface to raw Bible text? Documentation for nt.vss and ot.vss?

Troy A. Griffitts sword-devel@crosswire.org
Tue, 21 Oct 2003 13:51:13 -0700


Lynn Allan,

	You're pretty right on, with only a few small nuances.

There used to be other files that held the book and chapter counts in 
addition to the .vss files.  These went away a long time ago in favour 
of storing the KJV versification scheme in the software itself for speed 
improvements (at the time the only Bibles we supported were KJV 
versified Bibles).  We're leaning toward allowing the .bks and .cps 
files to return, and if present, to be used instead of the KJV 
versification.  There are a few more details that just this, but that's 
the general idea.


 > Is there a bare-bones interface?

This question is a little misleading.  It implies that you are looking 
for a 'programming interface' maybe, to the nt, ot, nt.vss, ot.vss files?

Maybe a little more information about SWORD would clarify things a bit:

The SWORD API is a C++ interface for Biblical text research.  You 
probably already knew this, but if you are looking for an 'interface' 
then that is exactly what SWORD provides.

There are many other formats that SWORD reads in addition to the 
ot,nt,ot.vss,nt.vss files.  These files are used by the RawText driver 
in the engine.  There are also drivers to read books other than Bibles, 
and read them from data stored in not only plain text, but compressed, 
enciphered, and also in a number of different markups, including OSIS, 
GBF, etc.

So, if you are looking for a way to read raw data in a module stored in 
the RawText format, then you can:

SWModule *bible = new RawText("/path/to/kjv",...);
bible->SetKey("jn 3:16");
cout << *bible;


What's preferred, and hopefully more useful, is for you to leave the 
details up to the engine, and ask it, for example, for the text of jn 
3:16 from the KJV module and to produce it in HTML markup:

SWMgr swordLibrary(new MarkupFilterMgr(FMT_HTMLHREF));
SWModule *bible = swordLibrary["KJV"];
bible->SetKey("jn 3:16");
myGUIHTMLControl.setHTMLSource(*bible);

Hope this helps a little.

	-Troy.



Lynn Allan wrote:
> I was interested in finding out whether there is a "bare-bones" 
> interface to the raw text of the Bible texts. As I look at what a 
> Windows end-user installs, I see a subdirectory:
> x:\BaseDir\Sword\modules\texts\rawtext\kjv\
> with files nt, nt.vss, ot, and ot.vss
>  
> The files "nt" and "ot" contain ascii text from the actual Bible, with 
> some tags that seem to specify chapters and verses. I speculate that the 
> .vss files have offsets and lengths so that software logic can fetch a 
> specific verse. I further speculate that the .vss file, or another file, 
> knows how many verses there are in each chapter, and how many chapters 
> there are in each book. (Genesis has 50 book, Gen 1 has 31 verses, Gen 2 
> has 25 verses, Gen 3 has 24 verses, etc.)
>  
> Other sword logic presumably would translate a "key" like "Matthew 1:1" 
> or "John 3:16" into a specific offset into the file, and a specific 
> number of bytes. It can decipher Gen 3:4 to being the 60th verse of the 
> OT, and can do a "lookup" to what offset/length this actually works out 
> to be.
>  
> Is this in the ballpark and more-or-less correct? Is there documentation 
> for the format of the .vss files and lookup logic?  Is there a 
> bare-bones interface? (something much smaller than 400kb diatheke)
>  
> Inquiring minds want to know :-)
> Lynn Allan aka paraclete@bibleinverse.org 
> <mailto:paraclete@bibleinverse.org>