[jsword-devel] Versification Mapping - Verse 0 mapping
Martin Denham
mjdenham at gmail.com
Fri Jan 24 09:08:39 MST 2014
It also behaves differently depending on the default passage type, which
could mean there is a secondary error in one of the passage implementations.
Here is a unit test:
@Test
public void testVerse0Resolves() throws NoSuchKeyException {
PassageKeyFactory.setDefaultType(PassageType.MIX);
final VersificationsMapper mapper = VersificationsMapper.instance();
Key k = mapper.mapVerse(VerseFactory.fromString(KJV, "Exod.28.0"),
GERMAN);
assertEquals("Exod.28.0", k.getOsisRef());
assertVersification(GERMAN, k);
}
If, as in the above, the default passage type is set to MIX you get an
ArrayIndexOutOfBoundsException:
java.lang.ArrayIndexOutOfBoundsException: Index out of range (Given 0, Max
0).
at
org.crosswire.jsword.passage.AbstractPassage.getVerseAt(AbstractPassage.java:368)
at
org.crosswire.jsword.passage.RocketPassage.getVerseAt(RocketPassage.java:220)
at
org.crosswire.jsword.passage.AbstractPassage.addAll(AbstractPassage.java:515)
at
org.crosswire.jsword.versification.VersificationsMapper.mapVerse(VersificationsMapper.java:126)
at
net.bible.android.control.versification.VersificationConverter.convert(VersificationConverter.java:28)
But if the default passage type is left as SPEED then there is no immediate
exception but an empty passage is returned.
I am a bit lost!
Martin
On 24 January 2014 12:56, Chris Burrell <chris at burrell.me.uk> wrote:
> Zero verses indicate pre verse content. So in particular for psalms it is
> required.
>
> In terms of the flag I'll have to look. I think it's to do with wanting to
> leave proper verse 0 unmapped. Will have to look at code to remember
> exactly why. It was done ages ago.
> Chris
> On 24 Jan 2014 13:00, "Martin Denham" <mjdenham at gmail.com> wrote:
>
>> What is the thinking behind the "zerosUnmapped" flag in all the mapping
>> files?
>>
>> I would expect
>> [KJV:Gen 2:0] -> [German:Gen 2:0]
>> but with zerosUnmapped being set in all v11n mapping files what I get is
>> [KJV:Gen 2:0] -> [German:]
>> which later causes an IndexOutOfBoundsException in KeyUtil when I pass in
>> the empty Passage.
>>
>> If I delete zerosUnmapped then what I get is:
>> [KJV:Gen 2:0] -> [German:Gen 2:0]
>> which is what I initially expected.
>>
>> Martin
>>
>> _______________________________________________
>> jsword-devel mailing list
>> jsword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/jsword-devel
>>
>>
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20140124/1deb89b0/attachment.html>
More information about the jsword-devel
mailing list