[sword-devel] Why Sword?

David White sword-devel@crosswire.org
11 Feb 2002 21:04:53 +1100


On Mon, 2002-02-11 at 02:26, Trevor Jenkins wrote:
> 
> 
> For those who don't know or have forgotten I proposed an inverted file
> search system. Every word to be indexed and its position recorded. The
> position pointers should be of two forms. For a Bible search program the
> obvious one is position as book, chapter, verse, word within verse.
> However, there are enough examples in the scriptures where the position
> should be book, chapter, sentence, word within sentence because sentences
> cross verse (even chapter boundaries). Actually it should include
> translation too.
> 

Although I use a system like this in my program, and it works well, I
don't necessarily think this is needed. A bible in plain text is a few
megabytes of data, it should take no time at all to iterate over. An
indexing system could give even better results, but isn't necessary to
give reasonable results.

I had a brief look over the Sword code, and it definitely isn't the
iteration itself that takes ages, it's a whole lot of calls to a jumble
of "strip" and "render" functions, that I'm afraid I must admit I really
didn't understand the purpose of. The bad thing about this, is I think
it would probably take a little bit of redesigning of how exactly
filters work to get the desired speed increase. If I have time, I might
have a little play around with it, and see what I can do...

David.