New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to normalise the versification of .osis() results #19
Comments
This is something I'd definitely like to offer--the main problem is that I'm not aware of a database that contains mappings like "NAB:Lev.5.20 = KJV:Lev.6.1", which I think is a prerequisite. Are you aware of such a database anywhere (outside of Logos Bible Software's proprietary one)? You're right that bcv.set_options({versification_system: "nab"}).parse("lev 6:1").osis(); // "Lev.6.1"
bcv.set_options({versification_system: "kjv"}).parse("lev 6:1").osis(); // "Lev.6.1" (but a different verse)
bcv.set_options({versification_system: "nab"}).parse("lev 5:20").osis(); // "Lev.5.20"
bcv.set_options({versification_system: "kjv"}).parse("lev 5:20").osis(); // "" It sounds like you'd like something like: bcv.set_options({versification_system: "nab"}).parse("lev 5:20").osis({target_versification_system: "kjv"}); // "Lev.6.1" Right? That mostly requires mapping data to make it happen. |
How many of the differences are split or joined verses, and how many are caused by chapter breaks coming in different places? I was assuming that it was mostly just different chapter breaks, which would be fairly easy to handle. |
I've found some data sets, like this one: https://github.com/crosswire/jsword/blob/master/src/main/resources/org/crosswire/jsword/versification/MT.properties My main concern is supporting the JPS Tanakh (which I think is the same as the MT, and maybe the same as the NAB?) This project's readme says that the KJV lacks one verse and the NLT has one extra, which sound like they would be easy to make our own mapping of. So maybe we can do it. :) My javascript is decent, but I don't know any perl, so I may or may not be able to help. |
That has some data, but it doesn't look as complete as I'd like. Here's what I was able to pull together for the versification systems that the parser claims to support (aside from Psalms, which is involved): https://gist.github.com/openbibleinfo/29fe7f73602e65a1ce16 I haven't double-checked it for errors or turned it into code, but it's a start. The more I think about it, the more I think this feature should be a separate module from the standard parser--you'd feed output from the parser to the new module, but the latter would handle all the normalization work. For your purposes, one question will be how similar the Tanakh versification actually is to the NAB. |
It looks like it covers the same OT verses as your gist there, so I'm not sure why you'd say it's too incomplete... I guess a separate module to start makes sense - if I wrote one that would be the easiest way for me to start using it. But I think this functionality would still be useful to have in the core package, but if you'd rather not that would be fine I guess. (I'll keep discussing it in this issue here though if you don't mind.) How easy would it be to add a function to the bcv option? Is a prototype exported? If this starts out as a module then the re-versification function should be a chained before .osis() rather than a option passed to it. So here are the types of re-versification such a function/module would have to handle: Chapter breaks in different places Verses split into two or combined Verses don't exist at all in the ESV Combined books |
Right, sorry, I mean that it doesn't have the New Testament (obviously, given its purpose). I do believe the prototype is exported, so you should be able just to extend the base object with a new function (or whatever you need). Chapter breaks: converting verse references to integers would indeed take care of this situation. Verse split or combined: right. Verses that don't exist in the ESV: Psalm headings do actually exist in the ESV, but they're always part of verse 1--they don't have a separate verse number. Another example of a truly missing verse might be Acts 8:37, which is a verse in the KJV, a footnote in the NIV, and a footnote attached to Acts 8:36 in the ESV. Combined books: As you indicate, Daniel 3 is a good example of a complicated reference: Daniel 3 (NAB) is Daniel 3 (ESV) with the Prayer of Azariah in the middle of it. |
I've published a beta version of the plugin: https://www.npmjs.com/package/reversify Its support for the translations already in the parser is mostly complete except for a couple of extra tricky Apocrypha cases. The transformation data is stored in transformations.data in what I hope is a very human-readable format, and one that could be used for other projects too. |
This looks good to me. It definitely gets trickier in the Apocrypha; I've been working a bit on creating a mapping for the Vulgate, and it's a lot of detailed work. |
The parser seems to recognise different versification schemes quite well, but it leaves it up to the user to handle them. It would really help if there was an option to normalise the results of
.osis()
according to theversification_system
setting.For example,
parse("lev 6:1 nab").osis()
would then return"Lev.5.20"
.Alternatively a translation could be passed to
.osis()
for it to follow that versification system (or there could be a separate function).[Edit] Actually the more I think about it, being able to specify a versification system when
.osis()
is called would be really useful. But in addition to normalising them based on an option.The text was updated successfully, but these errors were encountered: