[jsword-devel] Help with verse 0 problem

DM Smith dmsmith at crosswire.org
Sun Jul 7 10:56:07 MST 2013


Yeah, this is a weird one. A book name by itself has always meant: get the entire book. There was no special treatment of single chapter books.

So prior to JSword supporting module introductions, getting the entire single chapter book meant getting chapter 1.

Single chapter books now have two chapters 0 and 1.

JSword never required for any verse to be present. (E.g. a module might be a work in progress; only the NT; only the OT; only John; ...) But now with introductions being supported, it is highly likely that a "verse" is not present.

I agree with Chris that verse 0 (and chapter 0) should not be obvious to the user. It should be hidden as much as possible to the user. It is for the most part, but there is a bit more to do. Obviously this is an example.

Chris has added the ability to check the module to see if it contains a verse and by extension to see if has introductions. He has requested that a SWORD module's conf have a flag indicating whether it has introductions. That does not appear like it will happen.

To specify any chapter you can used the following:
Obad 1:1 - ff

ff is a special marker that is commonly used in theological writings that means "and following", but since we don't know how much beyond, we take it to mean "until the end".

Currently w/in JSword AccuracyType parses a reference and uses v11n.getLastChapter(pbook) == 1 to determine whether the book is a single chapter book. Maybe we should have v11n.isSingleChapterBook(book)? (or a better name)

When showing the first verse in a range, we probably want to skip intros?

Anyway, the solution to this should be put into JSword because it will be an issue to all frontends.

Ideas are welcome.

Hope these ideas are helpful.

In Him,
	DM

On Jul 5, 2013, at 5:20 PM, Martin Denham <mjdenham at gmail.com> wrote:

> To clarify the problem a little, the issue is that Obadiah is a single chapter book and so 'Obd 1' is interpreted as 'Obadiah verse 1' not chapter 1.  Before chapter 0 and verse 0 were introduced 'Obd' was interpreted as 'Obadiah chapter 1' but no longer.  So the problem is I don't know how to specify 'Obadiah chapter 1' as a string - or maybe the previous long string would work i.e. include the word chapter before 1.
> 
> The parsing is spread out around and Bible but the key parts are:
>    Key reading = PassageKeyFactory.getKey( 'Obd' ))
>    Verse verse = KeyUtil.getVerse(key);
>    // show chapter containing verse
> 
> Martin
> 
> 
> On 5 July 2013 22:01, Chris Burrell <chris at burrell.me.uk> wrote:
> Sounds like a bug for short books. I don't think JSword should be passing back verses that don't exist. How are you getting the verse?
> 
> Are you using 
> 
> passage.iterator().next() ?
> 
> Presumably, the iterator is basing itself from on the versification ordinal... Perhaps this highlights a bug with our versification tables? In that for short books, we should not have a chapter 0...
> Chris
> 
> 
> 
> On 5 July 2013 21:53, Martin Denham <mjdenham at gmail.com> wrote:
> Can I ask for some advice?
> 
> And Bible stores strings like 'Matt 1', 'Obd' to specify a daily reading.
> 
> For 'Matt 1' PassageKeyFactory returns Matt chapter 1 and AB can correctly navigate to the first verse Matt 1:1.
> However for 'Obd' PassageKeyFactory returns Obadiah 0:0-Obadiah 1:21 and AB attempts to navigate to the first verse which is Obd 0:0 which normally does not exist.
> 
> I am a bit stuck for an elegant solution without coding something horrible like:
>   if (verse.chapter==0) verse.setChapter(1)
> Any suggestions?
> 
> Thanks
> Martin
> 
> P.S. If anybody uses the Chronological Daily readings in And Bible you may have noticed that pressing Obadiah gave a blank page a couple of days ago due to the above issue.
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20130707/21bc4288/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20130707/21bc4288/attachment.p7s>


More information about the jsword-devel mailing list