[jsword-devel] PersonalJava version of JSword

Erik Reitsma jsword-devel@crosswire.org
Wed, 7 Jan 2004 10:12:01 +0100 (CET)

> At 1/6/2004, you wrote:
>>Aleksander Rozman - Andy wrote:
>>>You would probably have to rewrite jsword.view.swing.desktop... Here is
>>>most of the GUI. You would probably have to use awt or special graphical
>>>classes, right? I think that quite a lot of code would have to be
>>>rewriten. You must keep in mind that bible is very big about 3mb
>>> compressed...
>>This tweaked a memory cell or 2.
>>There is a module driver called RAW (an alternative to Sword modules)
>> that
>>was designed to save space using dictionaries. I managed to get a Bible
>>text down to 1.5 Mb, however the code hasn't been touched for a long time
>>and certainly requires some work.
> We could use plain text file (maybe zipped) and ditch whole xml stuff.

I am not sure whether zipping would be useful, since I think it would be
good to be able to do random access in the file. And the memory limitation
is not as much "disk" space (i.e. memory stick, 128MB in my case), but
more the RAM. Reading a whole book at once does not seem like an option to

I have not yet studied the OSIS format, so I am not sure how hard that
would be to parse. I will also have to look into JAXP implementations that
run on PersonalJava.

> Then
> we would have to have OSIS 2 Text converter (not on portable device but on
> desktop computer from which we install). We would just need to create
> driver to read this. Text files could be formated in special way, for
> example we could use one file per book from bible, each line in text file
> would have a code in front of it, we would reperesent chapter and line
> (for
> ex. 01-01, for chapter 1, line 1), searching could be done very simple,
> with either index file (where it's shown how many lines has chapter) or
> some alternate way...

We can know on which byte in the file each verse starts, and we may use
that to make a sort of table of contents. Then we can jump to a verse
directly. This would actually already make it possible to jump to any part
of the bible quite quickly. I would think of it like a read-only database,
where each record contains a verse.
How is this done now? I can imagine it is already done like this...
The table of contents could even be integrated into the one bible file:
start with a table for the books, then start each book with a table for
the chapters, and then each chapter with a table for the verses. We could
then even compress the verses somewhat, or even add some of the info that
is available besides the plain text itself (i.e. Strong's numbers).