[sword-devel] Hyphens in book names

Ben Morgan benpmorgan at gmail.com
Thu Sep 30 18:10:31 MST 2010

On Thu, Sep 30, 2010 at 8:42 AM, Troy A. Griffitts <scribe at crosswire.org>wrote:

> :)
> In principle I agree with Chris, but I can't decide what people do with
> names.  One of my colleagues in this country (England) is named
> Instone-Brewer (sorry to use you as an example David).
> We've been wanting to internationalize the numerals and action symbols
> in our verse parser for a while now (and the display format, e.g., %BOOK
> %CH:%VS, %VS   or   %BOOK %CH,%VS.%VS ).  It's not a huge task but it's
> on the list with everything else.  It sounds like the BPBible guys
> already have a good start at this.  I'd love to see the patch or if one
> of you guys would like to head up this item, please speak up.
What we do in BPBible is:
1) for reading user input, we run a few regexes over it. One of them removes
dashes in between alphabetical characters. This will break the case of
Acts-Romans, but will not break say Acts - Romans (because of the spaces),
or Romans 3:1-2 (as it is numbers not letters).
(out of interest, the others regexes are:
1) replace a single 'v' in between numbers with a ':'
This allows references like Mat 5v6.
2) replace spaces between numbers with a :
This allows Mat 5 6, which would otherwise be interpreted as Matt 56
3) remove spaces between a ':' and a number
Otherwise Matt 5: 6 is interpreted as Matt 56)

We also go through and replace 0-9 in the input language with 0-9 in

When outputting text to the user, we glue it together using an algorithm
intended to give the best range text (so that we get Genesis 1:6-9 not
Genesis 1:6-Genesis 1:9, also handles outputting say Jude 2-8 instead of
Jude 1:2-Jude 1:8). The bookname in english is run through the translate
twice; once to localize it and the next time to turn the localized variety
into localized-with-dashes. A regexp turns 0-9 in english into 0-9 in the
target language.

In BPBible text displayed to user/inputted by user is carefully separated
from internal, english text. Internal text doesn't need all this special

What would be nice I think would be to be able to glue all our locales
together into one big locale (with an emphasis e.g. on English, when in
English, or on German when in German) so that if the user enters Nepali
references when in English they still work (it would usually work vice-versa
- entering English in Nepali should work)

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/20101001/128dbc35/attachment.html>

More information about the sword-devel mailing list