npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bibletags/bibletags-versification

v2.1.0

Published

## About

Downloads

48

Readme

Bible Tags

About

Original language Bible study for everyone, in every language.

Vision: That every Christian might have free access to the Bible tagged to the original Hebrew, Aramaic and Greek with parsing and lexical information—all in their own language.

For more information on this project, see the Bible Tags website.

Repos

Bugs

bibletags-versification

Concept and approach

To line up verses between versions correctly, we will need to have versification mapping. We use the concept of "versification models," since versification for most versions falls into one of a few traditions. See the src/data directory for these base mappings. Thus versionInfo (see below), which contains the versification model id and any exceptional versification details, is a required parameter for many of the exposed functions.

Versification is also complicated by the fact that some versions occasionally delineate by verse range instead of individual verses. For example, John 10:22-23 are presented together in the Living Bible (TLB). In such cases, such verse ranges should be treated as the initial verse alone (i.e. John 10:22 in our example), but be mapped to the entire verse range in the original language. This approach assumes verse ranges to be exceptional. Versions containing many verse ranges (e.g. The Message), on the other hand, are uncondussive to the Bible Tags project, being paraphrases more than translations.

Finally, this library allows for partial verse mapping as well.

Usage

npm i @bibletags/bibletags-versification
ES6
import { ... } from '@bibletags/bibletags-versification'
NodeJS
const { ... } = require('@bibletags/bibletags-versification/node_build')

Development

Installation

git clone https://github.com/educational-resources-and-services/bibletags-versification
cd bibletags-versification
npm install

Testing

npm run test

Functions exposed

isValidRefInOriginal({ bookId, chapter, verse }): Boolean
getPreviousOriginalLoc(loc): String
getNextOriginalLoc(loc): String
getPreviousTranslationRef({ ref, loc, info }): { bookId, chapter, verse }
getNextTranslationRef({ ref, loc, info }): { bookId, chapter, verse }
getOriginalLocsFromRange(fromLoc, toLoc): [ String ]
getCorrespondingRefs({ baseVersion, lookupVersionInfo }): [ { bookId: Int, chapter: Int, verse: Int} ]
getVerseMappingsByVersionInfo(versionInfo): { originalToTranslation: Array, translationToOriginal: Array }
hasCorrespondingVerseInOriginal(version): Boolean
getNumberOfChapters({ versionInfo, bookId }): Boolean or null
getStartAndEndVersesByChapter({ versionInfo, bookId }): [ Int, Int ] or null
getBookIdListWithCorrectOrdering({ versionInfo: { hebrewOrdering, partialScope } }): [ Int ]
getLocFromRef({ bookId, chapter, verse, wordRanges }): String
getRefFromLoc(loc): Object
padLocWithLeadingZero(loc): String

Parameter examples

versionInfo

{
  versificationModel: 'kjv',
  skipsUnlikelyOriginals: true,
  partialScope: 'ot',  // should be "ot", "nt" or undefined
  extraVerseMappings: {

    // 8+ character strings represent a passage location:
    //   BBCCCVVV
    //     BB is a zero-padded bookId with KJV ordering (1-66)
    //     CCC is a zero-padded chapter
    //     VVV is a zero-padded verse
    //   BBCCCVVV:W1-W2
    //     W1 is the starting word number in cases where a partial verse must be mapped
    //     W2 is the ending word number in cases where a partial verse must be mapped (MUST be left blank when it covers the rest of the verse)
    //   BBCCCVVV-VVV
    //     The key can also be a location range, with an integer as the value. Use this
    //     when all the verses in the key range are to be increased by the same amount.

    "02011030": "02012001",  // single original verse mapped to a single translation verse
    "02012001-021": -1,  // all original verses in this range need to be reduced by 1 to map properly to the translation
    "05022005:1-5": "05022005",  // verse 5 in the original maps to two in the translation; words 1-5 correspond to verse 5 in the translation...
    "05022005:6-": "05022006",  // ...while words 6 through the end correspond to verse 6 in the translation
    "08002009:5-10": "08002009:1-7",  // words 5-10 in the original correspond to words 1-7 in the translation
    "08002010:1-2": "08002009:8-9",  // words 1-2 of verse 10 in the original correspond to words 8-9 of verse 9 in the translation
    "40017014": "40017014:1-19",  // all of verse 14 in the original correspond to only words 1-19 of the translation
    "40017015:1-2": "40017014:20-",  // words 1-2 of verse 15 in the original correspond to word 20 of verse 14 to the end of that same verse in the translation
    "40017015:3-": "40017015",  // word 3 of verse 15 to the end of the same verse correspond to verse 15 in the translation
  },
}

loc and ref

01001001
{
  bookId: 1,
  chapter: 1,
  verse: 1,
}

01001001:1-3
{
  bookId: 1,
  chapter: 1,
  verse: 1,
  wordRanges: ["1-3"],
}

01001001:4-
{
  bookId: 1,
  chapter: 1,
  verse: 1,
  wordRanges: ["4-"],
}

01001001:1-3,7-9
{
  bookId: 1,
  chapter: 1,
  verse: 1,
  wordRanges: ["1-3","7-9"],
}

UnfoldingWord's Versification data used in part to develop versification mappings and tests. (See the imports directory.)