[sword-devel] Single chapter book representation

Ben Morgan benpmorgan at gmail.com
Wed Apr 8 16:21:09 MST 2009

On Thu, Apr 9, 2009 at 1:02 AM, DM Smith <dmsmith at crosswire.org> wrote:

> On Apr 7, 2009, at 9:59 PM, Ben Morgan wrote:
> Hi all,
> Troy committed recently one of my patches which fixed a long-standing bug
> where e.g. typing Obadiah 20 didn't work as expected. This fixes problems
> noted around here:
>  <http://www.crosswire.org/pipermail/sword-devel/2000-August/010491.html>
> http://www.crosswire.org/pipermail/sword-devel/2000-August/010491.html
> My original patch had a flag which would enabling parsing Obadiah 20 as
> Obadiah 1:20, but it was turned off by default. However, when Troy committed
> it, it was on by default. Personally, I prefer having it off - at the
> moment, BPBible seems to require it to be off by default.
> Previously, code would have been able to get the range for a whole chapter
> by vk.ParseVerseList("Obadiah 1", "", true). Now this will just go to the
> verse. This might be a problem in chapter views, etc. Does anyone have any
> views on which they would prefer?
> I saw a patch that changed the behavior. Now it knows single chapter books
> and processes the number as a verse. IMHO this is right. So it will have the
> impact you note.
This change is quite dangerous, I suspect, to expose as the default, as this
will change the behaviour quite substantially. If applications are going to
expect to be able to parse Book Chapter as a whole chapter, they won't be
able to with this change

BPBible keeps track of whether a verse range to be parsed is user input or
not. If it is, it would enable the flag, otherwise it won't.

> Question: does the book and chapter intros still work? Obad 0:0 and 1:0?
> Or is it now only book intro, as Obad 0?
I think they would still work (though they may not make all that much
sense). What this really does is just to parse Obadiah 20 as Obadiah 1:20.
The internal representation hasn't changed.

God Bless,
Multitudes, multitudes,
   in the valley of decision!
For the day of the LORD is near
   in the valley of decision.

Giôên 3:14 (ESV)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20090409/3b127393/attachment.html>

More information about the sword-devel mailing list