[jsword-devel] blurring (was: Updates)
joe at eireneh.com
Fri Jul 9 01:17:48 MST 2004
DM Smith wrote:
> I have applied your changes w/o a problem. And I like what I see. I have
> been giving some thought about passage and I was thinking that it was
> redundant with KeyList. And I noticed that there were places in the code
> that knew or assumed a book was a Bible and would have been more useful
> if it did not. I see that you are working on these changes. Kudos.
Question on blurring:
There are some things that a Passage can do that don't have the same
For example a passage can be 'blurred' to turn Gen 4:3 into Gen 4:2-4
You can choose the number of verses to blur by and that boundaries to
[Gen 4:3].blur(5, RESTRICT_CHAPTER) = Gen 4:1-8
[Gen 4:3].blur(5, RESTRICT_NONE) = Gen 3:22-Gen 4:8
And both forms are useful. The former is good in getting the whole
chapter that a verse is in, the latter is useful in doing fuzzy match
But a dictionary doesn't necessarily have the same concepts, so the API
for Key is just blur(n) rather than blur(n, type).
So the current way of doing things separates Passages (in the Bible)
from generic Keys into Books.
My preferred way of merging at the moment is to make the API on Key the
same as on Passage and then have the type being a number 1-10 and
defining several types:
RESTRICT_NONE = 10
RESTRICT_SECTION = 6 (a.k.a. RESTRICT_BOOK)
RESTRICT_SUBSECTION = 3 (a.k.a RESTRICT_CHAPTER)
RESTRICT_DETAIL = 1
And allow other Key providers to define the different levels as they see
Is 1-10 enough? Maybe we ought to use a byte and use 0-127 which might
be cleaner. Or a float and have 0.0 - 1.0?
More information about the jsword-devel