[jsword-devel] Sword drivers - a new way of doing things.

Mark Goodwin jsword-devel@crosswire.org
17 Oct 2002 21:44:42 +0100

Hello people.

I wasn't supposed to have time for this, but I couldn't sleep last

Some changes will be neccesary in SwordBible and SwordBibleDriver if we
are to cope with the many different types of Sword Bible in a tidy and
efficient manner.

>From looking at the different types of modules, and different kinds of
markup, it occurred to me that it would be a good idea to split Sword
Bible handling into a set of backends (raw, zip, encrypted), and
frontend with access to a set of filters (ThML, OSIS, GBF, etc.) much
like 'original flavour' Sword, in fact (I've not spent very long looking
at the code, but that's the idea I got).

We could then have a single frontend, which loads filter classes
according to parameters in the module config file, and delegates to the
backend for the purposes of loading data.  The data returned from the
backend would be passed through the relevant filter(s) for removal /
translation of markup, and presented using a normal Bible interface.

Anyway, I spent a couple of hours hacking on some prototype code - I've
not addressed Filters yet (these would be loaded and used by SwordBible
itself), but the rest is there in concept.  There's a new way of loading
and representing Sword module configs in all (well, most of) their
complexity, Raw modules work fine, and I've put some stubs in to
demonstrate that the new SwordBibleDriver can 'see' compressed texts as

I've not committed to the trunk because a) it's messy prototype code,
and b) I'm not going to have time to do anything it for a few days. If
you're curious or feel like doing some work on the Sword module support
yourself then have a look at the contents of the following branch: 


Beware of the bit with comments that say TODO and URGENT :-)

Finally, if you want to work on this stuff and you're not sure on how
the Sword modules hang together, contact me telling me what you want to
do - I've got heaps on info I've gleaned on various things (I also made
a stab at deciphering the zverse stuff in sword).  

I've also got some code for LZSS compression stuff, and documentation
etc. on Sapphire II for the locked modules.

Have fun.