[jsword-devel] PersonalJava version of JSword

Aleksander Rozman - Andy jsword-devel@crosswire.org
Fri, 09 Jan 2004 18:19:55 +0100


At 1/7/2004, you wrote:
> > 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.
> >>
> >>Joe.
> >>
> >
> > 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
>me.

Hi Eric!

Java has a nifty class called Properties. We could create index with it, 
which would make loading very easy. Java can implement LineReader class 
whicg works with Streams, so we could easiliy read from files. For example 
Jn 1, 12-30 (John... I don't know official abvbrev,. since my langauge uses 
different Letters..), we would read property Jn, which would display file, 
then Jn1-12, which would point us to line 12 of chapter 1 of John 
Evangelium, next line has one line more, etc, etc... Ram usage would be 
minimal. Indexes could probably be made better, but we'll see how this works...


>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).

I can't tell you how it;s done now, but I think that on each query XML 
parser is called and text parsed, to get the results... I am also new to 
JSword and OSIS and I just haven't got this far...

Andy


>*Erik.
>_______________________________________________
>jsword-devel mailing list
>jsword-devel@crosswire.org
>http://www.crosswire.org/mailman/listinfo/jsword-devel

**************************************************************************
*  Aleksander Rozman - Andy  * Fandoms:  E2:EA, SAABer, Trekkie, Earthie *
*     andy@kksonline.com     * Sentinel, BH 90210, True's Trooper,       *
*    andy@atechnet.dhs.org   * Heller's Angel, Questie, Legacy, PO5,     *
* Maribor, Slovenia (Europe) * Profiler, Buffy (Slayerete), Pretender    *
*     ICQ-UIC: 4911125       *********************************************
*     PGP key available      *    http://www.atechnet.dhs.org/~andy/     *
**************************************************************************