codexparser 0.4.0 → 0.5.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
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
+
## 0.4.1 — 2026-04-28
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **Genesis 5:32 LXX missing entry.** ENG/MT Gen 5:32 ("Noah was 500 years old, and he fathered Shem, Ham, and Japheth") is folded into LXX Göttingen Gen 6:1, so LXX Genesis 5 has only 31 verses. The previous data left ENG Gen 5:32 unmapped, so `convertVersion("lxx")` returned 32 verses for Gen 5 and downstream lookups against an LXX corpus 404'd. Now correctly emits `missingPassages: [{ verse: 32 }]` and `verses: ["1-31"]`.
|
|
10
|
+
|
|
5
11
|
## 0.4.0 — 2026-04-28
|
|
6
12
|
|
|
7
13
|
LXX versification audit + structural fixes. Major data-correctness pass against authoritative sources (Hanhart's Göttingen Esther, Rahlfs-Hanhart 2006, Göttingen Theodotion Daniel/Susanna/Bel) verified via Logos library.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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
|
"files": [
|
|
@@ -82,7 +82,10 @@ class ScriptureScanner {
|
|
|
82
82
|
let refStartIndex = bookStartIndex
|
|
83
83
|
let originalRefStartIndex = bookStartIndex
|
|
84
84
|
|
|
85
|
-
while (
|
|
85
|
+
while (
|
|
86
|
+
i < normalizedText.length &&
|
|
87
|
+
this.#isValidChapterVerseChar(normalizedText[i], normalizedText[i - 1])
|
|
88
|
+
) {
|
|
86
89
|
if (this.#isNextBibleBook(i, lowerCaseText, lowercaseBibleFullNames, lowercaseBibleAbbreviations)) {
|
|
87
90
|
break
|
|
88
91
|
}
|
|
@@ -178,11 +181,15 @@ class ScriptureScanner {
|
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
/**
|
|
181
|
-
* Checks if character is valid for chapter/verse references
|
|
184
|
+
* Checks if character is valid for chapter/verse references.
|
|
185
|
+
* Letter suffixes (a-e) only count when they directly follow a digit, so
|
|
186
|
+
* "6:1a" continues the token but "6:1 Amos" still breaks at "A".
|
|
182
187
|
* @private
|
|
183
188
|
*/
|
|
184
|
-
#isValidChapterVerseChar(char) {
|
|
185
|
-
|
|
189
|
+
#isValidChapterVerseChar(char, prevChar) {
|
|
190
|
+
if (/[\d:,\-;\s]/.test(char)) return true
|
|
191
|
+
if (/[a-eA-E]/.test(char) && prevChar && /\d/.test(prevChar)) return true
|
|
192
|
+
return false
|
|
186
193
|
}
|
|
187
194
|
|
|
188
195
|
/**
|
|
@@ -92,10 +92,13 @@ class VersificationHandler {
|
|
|
92
92
|
const hasVersification = this.#versificationDifferences[passage.book]
|
|
93
93
|
|
|
94
94
|
passage.passages.forEach((subPassage) => {
|
|
95
|
+
const verseRef = subPassage.verseSuffix
|
|
96
|
+
? `${subPassage.chapter}:${subPassage.verse}${subPassage.verseSuffix}`
|
|
97
|
+
: `${subPassage.chapter}:${subPassage.verse}`
|
|
98
|
+
|
|
95
99
|
if (hasVersification) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
subPassage.versification = this.#versificationDifferences[passage.book][key]
|
|
100
|
+
if (this.#versificationDifferences[passage.book][verseRef]) {
|
|
101
|
+
subPassage.versification = this.#versificationDifferences[passage.book][verseRef]
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
104
|
|
|
@@ -105,11 +108,9 @@ class VersificationHandler {
|
|
|
105
108
|
versionAbbreviation === "lxx" ? "lxx" : versionAbbreviation === "mt" ? "mt" : null
|
|
106
109
|
|
|
107
110
|
if (versionType) {
|
|
108
|
-
const versionReference = `${subPassage.chapter}:${subPassage.verse}`
|
|
109
111
|
for (const versification in this.#versificationDifferences[passage.book]) {
|
|
110
112
|
if (
|
|
111
|
-
this.#versificationDifferences[passage.book][versification][versionType] ===
|
|
112
|
-
versionReference
|
|
113
|
+
this.#versificationDifferences[passage.book][versification][versionType] === verseRef
|
|
113
114
|
) {
|
|
114
115
|
subPassage.versification = this.#versificationDifferences[passage.book][versification]
|
|
115
116
|
break
|
|
@@ -169,6 +169,54 @@ module.exports = {
|
|
|
169
169
|
mt: "5:32",
|
|
170
170
|
eng: "5:18",
|
|
171
171
|
},
|
|
172
|
+
// Chapter 6: LXX 3 Reigns adds material between 6:1 and 6:14 (6:1a-d) and
|
|
173
|
+
// omits MT/Eng 6:11-14 (the divine promise speech) and 6:18 (cedar carving).
|
|
174
|
+
// Reference: Rahlfs, Septuaginta, ad loc.
|
|
175
|
+
"6:1a": {
|
|
176
|
+
lxx: "6:1a",
|
|
177
|
+
mt: "",
|
|
178
|
+
eng: "",
|
|
179
|
+
},
|
|
180
|
+
"6:1b": {
|
|
181
|
+
lxx: "6:1b",
|
|
182
|
+
mt: "",
|
|
183
|
+
eng: "",
|
|
184
|
+
},
|
|
185
|
+
"6:1c": {
|
|
186
|
+
lxx: "6:1c",
|
|
187
|
+
mt: "",
|
|
188
|
+
eng: "",
|
|
189
|
+
},
|
|
190
|
+
"6:1d": {
|
|
191
|
+
lxx: "6:1d",
|
|
192
|
+
mt: "",
|
|
193
|
+
eng: "",
|
|
194
|
+
},
|
|
195
|
+
"6:11": {
|
|
196
|
+
lxx: "",
|
|
197
|
+
mt: "6:11",
|
|
198
|
+
eng: "6:11",
|
|
199
|
+
},
|
|
200
|
+
"6:12": {
|
|
201
|
+
lxx: "",
|
|
202
|
+
mt: "6:12",
|
|
203
|
+
eng: "6:12",
|
|
204
|
+
},
|
|
205
|
+
"6:13": {
|
|
206
|
+
lxx: "",
|
|
207
|
+
mt: "6:13",
|
|
208
|
+
eng: "6:13",
|
|
209
|
+
},
|
|
210
|
+
"6:14": {
|
|
211
|
+
lxx: "",
|
|
212
|
+
mt: "6:14",
|
|
213
|
+
eng: "6:14",
|
|
214
|
+
},
|
|
215
|
+
"6:18": {
|
|
216
|
+
lxx: "",
|
|
217
|
+
mt: "6:18",
|
|
218
|
+
eng: "6:18",
|
|
219
|
+
},
|
|
172
220
|
"7:13": {
|
|
173
221
|
lxx: "7:1",
|
|
174
222
|
mt: "7:13",
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
// LXX/Göttingen Genesis 5 has only 31 verses. The content of ENG/MT 5:32
|
|
3
|
+
// ("Noah was 500 years old, and he fathered Shem, Ham, and Japheth")
|
|
4
|
+
// is folded into LXX 6:1, which then continues with the start of ENG/MT 6:1.
|
|
5
|
+
"5:32": {
|
|
6
|
+
lxx: "",
|
|
7
|
+
mt: "5:32",
|
|
8
|
+
eng: "5:32",
|
|
9
|
+
},
|
|
2
10
|
"31:55": {
|
|
3
11
|
lxx: "32:1",
|
|
4
12
|
mt: "32:1",
|
|
@@ -46,6 +46,16 @@ class PassageUtils {
|
|
|
46
46
|
for (let i = start; i <= end && i <= chapterVerses[chapterVerses.length - 1]; i++) {
|
|
47
47
|
passages.push({ book, chapter, verse: i })
|
|
48
48
|
}
|
|
49
|
+
} else if (typeof verse === "string") {
|
|
50
|
+
const match = verse.trim().match(/^(\d+)([a-eA-E])?$/)
|
|
51
|
+
if (match) {
|
|
52
|
+
const verseNum = Number(match[1])
|
|
53
|
+
if (verseNum > 0) {
|
|
54
|
+
const entry = { book, chapter, verse: verseNum }
|
|
55
|
+
if (match[2]) entry.verseSuffix = match[2].toLowerCase()
|
|
56
|
+
passages.push(entry)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
49
59
|
} else {
|
|
50
60
|
const verseNum = Number(verse)
|
|
51
61
|
if (!isNaN(verseNum) && verseNum > 0) {
|