openbibleinfo / Bible-Passage-Reference-Parser

Coffeescript to identify and understand Bible references like "John 3:16."
223 stars 65 forks source link

German verse with comma #10

Closed ayalon closed 9 years ago

ayalon commented 9 years ago

Hi

In Switzerland (German Part) we have the following notation for verses: "1. Mo 1,16" "Psalm 89,37"

If I use the german parser I get the following results: "1. Mo 1,16" => "Gen.1,Gen.16" "Psalm 89,37" => "Ps.89,Ps.37"

The expected result is: "1. Mo 1,16" => "Gen.1.16" "Psalm 89,37" => "Ps.89.37"

I try to change this in the src/de folder but I have no idea where to start searching to achieve the correct result. Could you give me a hint?

openbibleinfo commented 9 years ago

Yes! You want the following file: /js/eu/de_bcv_parser.js . This file (and all the files in this folder) swaps the use of commas and periods and should give you the results you expect.

ayalon commented 9 years ago

thanks, that worked!

openbibleinfo commented 9 years ago

For future reference, as of November 2015, this functionality is now available as a runtime option; the "eu" folder no longer contains any Javascript files:

bcv.set_options({"punctuation_strategy": "eu"});
bcv.parse("Matt 1, 2. 4").osis(); // "Matt.1.2,Matt.1.4"
renehamburger commented 6 years ago

@openbibleinfo, : is really not a valid chapter-verse separator for Bible references in German. , is the only one that is permitted. See, e.g., Wikipedia's guidlines on quoting the Bible or 2.3 in these guidlines for theological writings.

Setting punctuation_strategy is a possible workaround, but it would be good to use this by default for German and adjust the specs accordingly. Would you be prepared to accept a PR from me replacing : by , for German?

There are two other peculiarities for German Bible references which are not yet implemented:

  1. A chapter/verse reference can be followed by an 'f' to include the following chapter/verse or an 'ff' to include an unspecified number of following chapters/verses, e.g. 'Genesis 3,23 f.' = 'Gen.3.23-Gen.3.24'.
  2. A passage from one of the synoptic gospels can be suffixed with a 'par.'/'parr.' to refer not only to the given passage but also the parallel passage/passages from the other synoptic gospels.

Would you be happy for me to implement (1) at some stage? Implementing (2) would be significantly more work and IMHO out of scope for this module.