codexparser 0.1.57 → 0.1.59
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/package.json +1 -1
- package/src/CodexParser.js +5 -4
- package/src/abbr/sbl.js +66 -66
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.59",
|
|
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": {
|
package/src/CodexParser.js
CHANGED
|
@@ -195,12 +195,13 @@ class CodexParser {
|
|
|
195
195
|
parsedPassage.scripture = this.scripturize(parsedPassage)
|
|
196
196
|
parsedPassage.valid = this._isValid(parsedPassage, passage.reference)
|
|
197
197
|
|
|
198
|
-
// Add SBL abbreviation as full reference with
|
|
199
|
-
const
|
|
200
|
-
|
|
198
|
+
// Add SBL abbreviation as full reference with en dashes and space after commas for comma-separated verses
|
|
199
|
+
const sblEntry = this.sblAbbreviations[book] || { value: book, abbr: false }
|
|
200
|
+
const sblBook = sblEntry.value + (sblEntry.abbr ? "." : "")
|
|
201
|
+
let abbr = parsedPassage.scripture.passage.replace(book, sblBook).replace(/-/g, "–")
|
|
201
202
|
if (parsedPassage.type === "comma_separated_verses") {
|
|
202
203
|
const versePart = parsedPassage.verses.map((v) => `${v}`).join(", ")
|
|
203
|
-
abbr = `${sblBook}
|
|
204
|
+
abbr = `${sblBook} ${parsedPassage.chapter}:${versePart}`
|
|
204
205
|
}
|
|
205
206
|
parsedPassage.abbr = abbr
|
|
206
207
|
|
package/src/abbr/sbl.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
const sblAbbreviations = {
|
|
2
|
-
Genesis: "Gen",
|
|
3
|
-
Exodus: "Exod",
|
|
4
|
-
Leviticus: "Lev",
|
|
5
|
-
Numbers: "Num",
|
|
6
|
-
Deuteronomy: "Deut",
|
|
7
|
-
Joshua: "Josh",
|
|
8
|
-
Judges: "Judg",
|
|
9
|
-
Ruth: "Ruth",
|
|
10
|
-
"1 Samuel": "1 Sam",
|
|
11
|
-
"2 Samuel": "2 Sam",
|
|
12
|
-
"1 Kings": "1 Kgs",
|
|
13
|
-
"2 Kings": "2 Kgs",
|
|
14
|
-
"1 Chronicles": "1 Chr",
|
|
15
|
-
"2 Chronicles": "2 Chr",
|
|
16
|
-
Ezra: "Ezra",
|
|
17
|
-
Nehemiah: "Neh",
|
|
18
|
-
Esther: "Esth",
|
|
19
|
-
Job: "Job",
|
|
20
|
-
Psalms: "Ps",
|
|
21
|
-
Proverbs: "Prov",
|
|
22
|
-
Ecclesiastes: "Eccl",
|
|
23
|
-
"Song of Solomon": "Song",
|
|
24
|
-
Isaiah: "Isa",
|
|
25
|
-
Jeremiah: "Jer",
|
|
26
|
-
Lamentations: "Lam",
|
|
27
|
-
Ezekiel: "Ezek",
|
|
28
|
-
Daniel: "Dan",
|
|
29
|
-
Hosea: "Hos",
|
|
30
|
-
Joel: "Joel",
|
|
31
|
-
Amos: "Amos",
|
|
32
|
-
Obadiah: "Obad",
|
|
33
|
-
Jonah: "Jonah",
|
|
34
|
-
Micah: "Mic",
|
|
35
|
-
Nahum: "Nah",
|
|
36
|
-
Habakkuk: "Hab",
|
|
37
|
-
Zephaniah: "Zeph",
|
|
38
|
-
Haggai: "Hag",
|
|
39
|
-
Zechariah: "Zech",
|
|
40
|
-
Malachi: "Mal",
|
|
41
|
-
Matthew: "Matt",
|
|
42
|
-
Mark: "Mark",
|
|
43
|
-
Luke: "Luke",
|
|
44
|
-
John: "John",
|
|
45
|
-
Acts: "Acts",
|
|
46
|
-
Romans: "Rom",
|
|
47
|
-
"1 Corinthians": "1 Cor",
|
|
48
|
-
"2 Corinthians": "2 Cor",
|
|
49
|
-
Galatians: "Gal",
|
|
50
|
-
Ephesians: "Eph",
|
|
51
|
-
Philippians: "Phil",
|
|
52
|
-
Colossians: "Col",
|
|
53
|
-
"1 Thessalonians": "1 Thess",
|
|
54
|
-
"2 Thessalonians": "2 Thess",
|
|
55
|
-
"1 Timothy": "1 Tim",
|
|
56
|
-
"2 Timothy": "2 Tim",
|
|
57
|
-
Titus: "Titus",
|
|
58
|
-
Philemon: "Phlm",
|
|
59
|
-
Hebrews: "Heb",
|
|
60
|
-
James: "Jas",
|
|
61
|
-
"1 Peter": "1 Pet",
|
|
62
|
-
"2 Peter": "2 Pet",
|
|
63
|
-
"1 John": "1 John",
|
|
64
|
-
"2 John": "2 John",
|
|
65
|
-
"3 John": "3 John",
|
|
66
|
-
Jude: "Jude",
|
|
67
|
-
Revelation: "Rev",
|
|
2
|
+
Genesis: { value: "Gen", abbr: true },
|
|
3
|
+
Exodus: { value: "Exod", abbr: true },
|
|
4
|
+
Leviticus: { value: "Lev", abbr: true },
|
|
5
|
+
Numbers: { value: "Num", abbr: true },
|
|
6
|
+
Deuteronomy: { value: "Deut", abbr: true },
|
|
7
|
+
Joshua: { value: "Josh", abbr: true },
|
|
8
|
+
Judges: { value: "Judg", abbr: true },
|
|
9
|
+
Ruth: { value: "Ruth", abbr: false },
|
|
10
|
+
"1 Samuel": { value: "1 Sam", abbr: true },
|
|
11
|
+
"2 Samuel": { value: "2 Sam", abbr: true },
|
|
12
|
+
"1 Kings": { value: "1 Kgs", abbr: true },
|
|
13
|
+
"2 Kings": { value: "2 Kgs", abbr: true },
|
|
14
|
+
"1 Chronicles": { value: "1 Chr", abbr: true },
|
|
15
|
+
"2 Chronicles": { value: "2 Chr", abbr: true },
|
|
16
|
+
Ezra: { value: "Ezra", abbr: false },
|
|
17
|
+
Nehemiah: { value: "Neh", abbr: true },
|
|
18
|
+
Esther: { value: "Esth", abbr: true },
|
|
19
|
+
Job: { value: "Job", abbr: false },
|
|
20
|
+
Psalms: { value: "Ps", abbr: true },
|
|
21
|
+
Proverbs: { value: "Prov", abbr: true },
|
|
22
|
+
Ecclesiastes: { value: "Eccl", abbr: true },
|
|
23
|
+
"Song of Solomon": { value: "Song", abbr: true },
|
|
24
|
+
Isaiah: { value: "Isa", abbr: true },
|
|
25
|
+
Jeremiah: { value: "Jer", abbr: true },
|
|
26
|
+
Lamentations: { value: "Lam", abbr: true },
|
|
27
|
+
Ezekiel: { value: "Ezek", abbr: true },
|
|
28
|
+
Daniel: { value: "Dan", abbr: true },
|
|
29
|
+
Hosea: { value: "Hos", abbr: true },
|
|
30
|
+
Joel: { value: "Joel", abbr: false },
|
|
31
|
+
Amos: { value: "Amos", abbr: false },
|
|
32
|
+
Obadiah: { value: "Obad", abbr: true },
|
|
33
|
+
Jonah: { value: "Jonah", abbr: false },
|
|
34
|
+
Micah: { value: "Mic", abbr: true },
|
|
35
|
+
Nahum: { value: "Nah", abbr: true },
|
|
36
|
+
Habakkuk: { value: "Hab", abbr: true },
|
|
37
|
+
Zephaniah: { value: "Zeph", abbr: true },
|
|
38
|
+
Haggai: { value: "Hag", abbr: true },
|
|
39
|
+
Zechariah: { value: "Zech", abbr: true },
|
|
40
|
+
Malachi: { value: "Mal", abbr: true },
|
|
41
|
+
Matthew: { value: "Matt", abbr: true },
|
|
42
|
+
Mark: { value: "Mark", abbr: false },
|
|
43
|
+
Luke: { value: "Luke", abbr: false },
|
|
44
|
+
John: { value: "John", abbr: false },
|
|
45
|
+
Acts: { value: "Acts", abbr: false },
|
|
46
|
+
Romans: { value: "Rom", abbr: true },
|
|
47
|
+
"1 Corinthians": { value: "1 Cor", abbr: true },
|
|
48
|
+
"2 Corinthians": { value: "2 Cor", abbr: true },
|
|
49
|
+
Galatians: { value: "Gal", abbr: true },
|
|
50
|
+
Ephesians: { value: "Eph", abbr: true },
|
|
51
|
+
Philippians: { value: "Phil", abbr: true },
|
|
52
|
+
Colossians: { value: "Col", abbr: true },
|
|
53
|
+
"1 Thessalonians": { value: "1 Thess", abbr: true },
|
|
54
|
+
"2 Thessalonians": { value: "2 Thess", abbr: true },
|
|
55
|
+
"1 Timothy": { value: "1 Tim", abbr: true },
|
|
56
|
+
"2 Timothy": { value: "2 Tim", abbr: true },
|
|
57
|
+
Titus: { value: "Titus", abbr: false },
|
|
58
|
+
Philemon: { value: "Phlm", abbr: true },
|
|
59
|
+
Hebrews: { value: "Heb", abbr: true },
|
|
60
|
+
James: { value: "Jas", abbr: true },
|
|
61
|
+
"1 Peter": { value: "1 Pet", abbr: true },
|
|
62
|
+
"2 Peter": { value: "2 Pet", abbr: true },
|
|
63
|
+
"1 John": { value: "1 John", abbr: false },
|
|
64
|
+
"2 John": { value: "2 John", abbr: false },
|
|
65
|
+
"3 John": { value: "3 John", abbr: false },
|
|
66
|
+
Jude: { value: "Jude", abbr: false },
|
|
67
|
+
Revelation: { value: "Rev", abbr: true },
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
module.exports = sblAbbreviations
|