[jsword-devel] Normalizing Bible names

DM Smith dmsmith at crosswire.org
Wed Feb 6 12:31:40 MST 2013


There are two problems here. The one you identified and that Romans resolves to Tobias.

The lookup needs to be tweaked a bit to look first at NT names, then OT names and finally at other names. It should also be able to answer regarding a v11n.

In a BibleNames file:
The long name  should never be blank.
The short name can be blank when the long name is supplied. (I think that is expected and should load the long name into the field. But not sure.)
The alt should be blank when there are not alternates for that language for that Bible book.

There is a fix in Jira for the code. It requires an argument for startsWith to have length. I think it is from Martin. I haven't gotten around to applying it. It is as you suggest.

In Him,
	DM

On Feb 6, 2013, at 2:21 PM, Chris Burrell <chris at burrell.me.uk> wrote:

> Hello
> 
> I have an issue with the normalizing which is supposed to fallback to English as I understand it. Unfortunately, when I give Romans from a Russian Locale, I'm getting an IllegalArgument exception, because it's resolving to Tobias, which isn't in the KJV system
> 
> Here are my values when entering BookName#match(String normalizedName).
> 
> longName	"" (id=302)	
> normalizedLongName	"" (id=302)	
> normalizedShortName	"" (id=302)	
> shortName	"" (id=302)	
> normalizedName	"romans" (id=298)	
> 
> 
> As you can see the issue is with the line:
> 
>         if (normalizedShortName.startsWith(normalizedName) || normalizedName.startsWith(normalizedShortName)) {
>             return true;
>         }
> which then matches the second part.
> 
> The reason for this is that Tobias is a blank field in the BibleNames. As a result, we fall in and match it.
> 
> My suggested fix to this, would be to start by removing all blank Bible names from the language files. Alternatively, which would be less work, we could check that the normalized names are not blank!
> 
> Chris
> 
> 
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel




More information about the jsword-devel mailing list