openbibleinfo / Bible-Passage-Reference-Parser

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

Ambiguous abbreviation incorrectly understood to be the single-chapter book #21

Closed davidfedor closed 7 years ago

davidfedor commented 8 years ago

Parsing the following input incorrectly returns references in Jude instead of Judges: "Jud 1:19, 3:1" returns Jude.1.19 (and ignores the 3:1) ...whereas Judges is correctly returned when chapter 2 is seen in the input: "Jud 2:19, 3:1" returns Judg.2.19,Judg.3.1

If the chapter is present after an ambiguous abbreviation which might or might not be a single-chapter book, I'd say the code should assume it is not the single-chapter book.

Reproduced today with the code running on https://www.openbible.info/labs/reference-parser/

openbibleinfo commented 8 years ago

There are several abbreviations like this (https://github.com/openbibleinfo/Bible-Passage-Reference-Parser/blob/master/src/en/data.txt#L105). The parser generally prefers more-popular and longer books to less-popular and shorter ones; in this case, it prefers "Jud" for compatibility with USX, which uses "Jdg" for Judges.

At a minimum, the parser should expose the available alternate books for the complete string rather than foreclosing the possibility of "3:1" being part of the sequence, but you're right that it would be better for it to reconsider its parsing approach based on the new information it has available to it. I'll have to consider how best to do that. Thanks for raising the issue.

openbibleinfo commented 7 years ago

This turns out to be pretty difficult to implement, but it's definitely something I'd like to revisit in the future. I'm closing this issue for now. :)