codexparser 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. For full details, see the Release Notes in README and the GitHub Releases page.
4
+
5
+ ## 0.2.0 — 2026-01-10
6
+
7
+ - Refactored internal architecture into clear folders:
8
+ - `src/core` (parser, scanner, validator, collection, version/versification handlers)
9
+ - `src/utils` (helpers, regex, chapter-verse data loader)
10
+ - `src/format` (OSIS formatter, abbreviations)
11
+ - `src/data` (bible lists, chapter_verses, versifications, sbl abbreviations)
12
+ - Adopted OSIS textual hashes (e.g., `John.3.16`, `Rev.1.8-Rev.2.17`).
13
+ - Added numeric OSIS using pythonbible-style integer verse IDs (`book*1_000_000 + chapter*1_000 + verse`).
14
+ - Attached per-passage version helpers: `getVersion()`, `getLXX()`, `getMT()`, `getBHS()`, `getEnglish()`.
15
+ - Cleaned dependencies and removed vulnerable toolchain; `npm audit` is clean.
16
+ - Published to npm as `codexparser@0.2.0`.
17
+
18
+ See the release: https://github.com/jeremyam/CodexParser/releases/tag/v0.2.0
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # CodexParser: The Ultimate Bible Reference Parser 📖✨
2
2
 
3
+ [![GitHub Release](https://img.shields.io/github/v/release/jeremyam/CodexParser?sort=semver)](https://github.com/jeremyam/CodexParser/releases)
4
+
3
5
  Welcome to **CodexParser**, a powerful and flexible Node.js library crafted to parse, validate, and structure Bible references with ease. Whether you're extracting verses from a sermon, building a scripture app, or analyzing biblical texts, CodexParser transforms raw references like "John 3:16" or "Psalm 115:5,7,10" into rich, actionable data—complete with start and end points, SBL-style abbreviations, versification support, and validation. Dive into the Word like never before!
4
6
 
5
7
  Built with precision and passion, CodexParser handles single verses, ranges, multi-chapter spans, and single-chapter books (looking at you, Jude!). It’s your trusty companion for navigating the sacred texts, supporting English, Septuagint (LXX), and Masoretic Text (MT) versions. Let’s unleash its power!
@@ -38,6 +40,8 @@ npm install
38
40
 
39
41
  ## Quick Start ⚡
40
42
 
43
+ For version detection and switching examples, see [Versions & Versification](#versions--versification).
44
+
41
45
  Here’s how to wield CodexParser’s might:
42
46
 
43
47
  ```javascript
@@ -100,6 +104,61 @@ console.log(parser.parse("Genesis 1:1-5, 10; 2:1-3").getPassages().combine())
100
104
 
101
105
  ---
102
106
 
107
+ ## Versions & Versification 🔁
108
+
109
+ CodexParser supports English (`ENG`), Septuagint (`LXX`), and Masoretic (`MT`/`BHS`) versifications. You can set a default via `.bibleVersion()` or use per-passage helpers to convert.
110
+
111
+ - Set default version for parsing:
112
+
113
+ ```javascript
114
+ const CodexParser = require("codexparser")
115
+ const parser = new CodexParser()
116
+
117
+ // Default LXX if no suffix in the input
118
+ parser.bibleVersion("lxx")
119
+ const [p] = parser.parse("Psalms 4:5").getPassages()
120
+ console.log(p.version.abbreviation) // "lxx"
121
+ console.log(p.scripture.hash) // "Ps.4.5"
122
+
123
+ // Convert to English versification
124
+ const eng = p.getEnglish()
125
+ console.log(eng.scripture.cv) // "4:4" (example of LXX→ENG shift)
126
+ ```
127
+
128
+ - Detect version from suffix and convert across versions:
129
+
130
+ ```javascript
131
+ const CodexParser = require("codexparser")
132
+ const parser = new CodexParser()
133
+
134
+ // Suffix sets version automatically
135
+ const passages = parser.parse("Psalms 94:4-100:6 MT").getPassages()
136
+ const base = passages[0]
137
+ console.log(base.version.abbreviation) // "mt"
138
+ console.log(base.scripture.hash) // e.g., "Ps.94.4-Ps.100.6"
139
+
140
+ // Convert to LXX and ENG with helpers
141
+ const lxx = base.getLXX()
142
+ const eng = base.getEnglish()
143
+ console.log(lxx.scripture.cv) // "93:4-23; 94:1-11; ..." (mapped LXX ranges)
144
+ console.log(eng.scripture.cv) // "94:4-23; 95:1-11; ..." (ENG/MT alignment)
145
+ ```
146
+
147
+ - Zechariah example (chapter offsets):
148
+
149
+ ```javascript
150
+ const parser = new CodexParser()
151
+ const [z] = parser.parse("Zechariah 2:8").getPassages()
152
+ console.log(z.getEnglish().scripture.hash) // "Zech.2.8"
153
+ console.log(z.getLXX().scripture.hash) // "Zech.2.12" (LXX mapping)
154
+ ```
155
+
156
+ Notes:
157
+ - `getVersion("eng"|"lxx"|"mt"|"bhs")` is available; `getBHS()` aliases `MT`.
158
+ - `.scripture.hash` is OSIS textual (e.g., `John.3.16`), `.osisNumeric` uses pythonbible-style integer IDs.
159
+
160
+ ---
161
+
103
162
  ## API: Your Codex Arsenal 🛠️
104
163
 
105
164
  Here’s the breakdown of CodexParser’s key methods—your tools for mastering scripture:
@@ -240,3 +299,20 @@ Built with love by [jeremyam], powered by coffee and scripture.
240
299
  ---
241
300
 
242
301
  Let’s parse the scriptures together—happy coding! ✝️📚
302
+
303
+ ---
304
+
305
+ ## Release Notes
306
+
307
+ ### 0.2.0 (2026-01-10)
308
+
309
+ - Refactored internal architecture into clear folders:
310
+ - `src/core` (parser, scanner, validator, collection, version/versification handlers)
311
+ - `src/utils` (helpers, regex, chapter-verse data loader)
312
+ - `src/format` (OSIS formatter, abbreviations)
313
+ - `src/data` (bible lists, chapter_verses, versifications, sbl abbreviations)
314
+ - Adopted OSIS textual hashes (e.g., `John.3.16`, `Rev.1.8-Rev.2.17`).
315
+ - Added numeric OSIS using pythonbible-style integer verse IDs (`book*1_000_000 + chapter*1_000 + verse`).
316
+ - Attached per-passage version helpers: `getVersion()`, `getLXX()`, `getMT()`, `getBHS()`, `getEnglish()`.
317
+ - Cleaned dependencies and removed vulnerable toolchain; `npm audit` is clean.
318
+ - Published to npm as `codexparser@0.2.0`.
@@ -0,0 +1,5 @@
1
+ # CodexParser 0.2.0
2
+
3
+ Refactor into core/utils/format/data; OSIS textual hashes (e.g., John.3.16); pythonbible-style integer verse IDs for `osisNumeric`; per-passage version helpers (`getVersion/getLXX/getMT/getBHS/getEnglish`); dependency cleanup and audit fix; published to npm as `codexparser@0.2.0`.
4
+
5
+ See detailed notes in README under "Release Notes" → 0.2.0.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexparser",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "This is a Javascript Bible parser and text scanner. It will search through texts and collate all scripture references into an array and parse them into objects, and it will parse passages into objects by book, chapter, verse, and testament. ",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -267,6 +267,22 @@ class ReferenceParser {
267
267
  passage.getEnglish = function () {
268
268
  return this.getVersion("eng")
269
269
  }
270
+ passage.convertVersion = function (targetVersion) {
271
+ const targetAbbr = targetVersion.toLowerCase() === "bhs" ? "mt" : targetVersion.toLowerCase()
272
+
273
+ // Check if any passages have versification data
274
+ const hasVersification = this.passages.some((p) => p.versification)
275
+
276
+ if (!hasVersification) {
277
+ // No versification exists, return a clone with updated version info only
278
+ const cloned = JSON.parse(JSON.stringify(this))
279
+ cloned.version = VersionHandler.getVersionObject(targetAbbr)
280
+ return cloned
281
+ }
282
+
283
+ // Has versification, use the full conversion
284
+ return computeConverted(this, targetAbbr)
285
+ }
270
286
  }
271
287
 
272
288
  /**