Skip to content
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

Closed
curiousdannii opened this issue Jan 15, 2016 · 8 comments
Closed

Comments

@curiousdannii
Copy link

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 the versification_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.

@openbibleinfo
Copy link
Owner

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 versification_system won't normalize versification across different systems.

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.

@curiousdannii
Copy link
Author

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.

@curiousdannii
Copy link
Author

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.

@openbibleinfo
Copy link
Owner

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.

@curiousdannii
Copy link
Author

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
Example: Leviticus 5:20-26
These can be handled simply by calculating the book-in-verse number of a reference (ie, Gen 2:1 is number 32 because Gen 1 has 31 verses) and then converting back to a reference using the other translation's versification. No extra data would need to be kept for these over the tables which the parser already has.

Verses split into two or combined
Example: Revelation 12:17-18 NLT
We'd need to store data for these. It may be enough to iterate through a list, adding an extra 1 to the book-in-verse number when we come across these. We'd need to account for different cases depending on whether these verses occur at the start, middle or end of a range: Rev 12:17-13:1 NLT - Rev 12:17-13:1 ESV but Rev 12:16-18 NLT = Rev 12:16-17 ESV.

Verses don't exist at all in the ESV
Example: The Psalm headings
These might be tricky to store the data for, or maybe the same kind of structures as for splitting/combining verses will work here. If a reference includes a Psalm heading, it should be converted to an ESV reference that just leaves it out. What about if the reference is only the Psalm heading? Probably should be converted to a blank reference/osis I think.

Combined books
Example: Tanakh 1/2 Samuel, NAB inclusion of extras to Daniel
Depending on whether the reference is purely in the inclusion or not these may be simple or harder to convert.

@openbibleinfo
Copy link
Owner

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.

@curiousdannii
Copy link
Author

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.

@openbibleinfo
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants