[sword-devel] v11n patch - some non-KJV versified passages can not be read
John Austin
gpl.programs.info at gmail.com
Mon Oct 29 01:24:54 MST 2012
A patch for JSword is attached. The Verse class was not maintaining
its own versification value and so it was impossible for Verse to
operate properly in some circumstances. This ultimately led to
unhandled exceptions when reading certain passages from non-default
versified Bibles such as IBT's UZV module, Ps 117:1-29 with Bible
Desktop.
The crux of the problem is seen in:
org.crosswire.jsword.passage.Passage.getPassage(Key),
where Passage maintains its own versification value, but (Verse) Key
did not. So it was impossible to insure correct construction of a
Passage from an arbitrary Verse Key (all Passages returned were being
KJV versified even if the Verse was not KJV). This led to incorrect
Passage assignments and unhandled exceptions (such as when viewing
IBT's UZV module Ps 117:1-29).
The solution is pretty easy- require a Versification when
instantiating any Verse class, and then retain that value within the
Verse key. A method was added called Verse.getVersification(). Also,
to fix the above mentioned bug, Passage.getPassage(Key) now casts the
Key as Verse, and if successful, it reads the Verse's Versification to
pass it along to PassageKeyFactory.getKey(), thus enabling the
resulting Passage to have the correct Versification and value.
This fix is also logically necessary since Verse points to an actual
Bible verse, and the versification is a necessary part of any actual
Bible address location.
I tested this patch with common-junit-alltests and everything passed
expect 4 failures related to Lucene stemming and stop-words. These
seem to be related to the Lucene version and appear totally unrelated
related to Verse Key. I also tested a bit with Bible-Desktop.
John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsword-patch-vkey.diff
Type: application/octet-stream
Size: 38320 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20121029/7b043245/attachment-0001.obj>
More information about the sword-devel
mailing list