codexparser 0.0.31 → 0.0.33
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/all-scripture-test.js +6 -4
- package/package.json +2 -1
- package/src/CodexParser.js +2 -1
- package/src/bible.js +1 -0
- package/src/bookRegex.regex +1 -0
- package/src/regex.js +3 -3
- package/src/toc.js +0 -2
- package/sub-verse-scripture-test.js +2 -3
- package/webpack.config.js +2 -6
package/all-scripture-test.js
CHANGED
|
@@ -5,14 +5,16 @@ const text =
|
|
|
5
5
|
"Joel 10:13 The passages Luke 2:32 and Lk 1:23 that we are looking at tonight 1 Cor 12:34 2 Cor 3:4 are found Jude 6, in Jude 5, Genesis 2:1 - 3:19, 1 John 3:16-17, 1 Peter 1:1, and Romans 10:13, 15, 17. Please turn in your Bibles. Ps 109:4,5,6,8. Isaiah 61.2-3 Mt 5.4"
|
|
6
6
|
const single = "Ge 27.27-29,89-40 Heb 11.20 Heb. 12.17 Jonah 3"
|
|
7
7
|
const jd = "Jd. 5"
|
|
8
|
-
const cor = "1
|
|
8
|
+
const cor = "Hos 1:1-3, 8 Song of Solomon 1:2, Song of Songs 2:2. Ezek 17:3. Ezekiel 17:3"
|
|
9
9
|
const passages = parser.parse(single)
|
|
10
10
|
console.log(passages)
|
|
11
11
|
|
|
12
12
|
const jude = parser.parse(jd)
|
|
13
13
|
console.log(jude)
|
|
14
|
-
|
|
15
|
-
console.log(textParser)
|
|
14
|
+
|
|
16
15
|
|
|
17
16
|
const fullText = parser.parse(text)
|
|
18
|
-
console.log(fullText)
|
|
17
|
+
console.log(fullText)
|
|
18
|
+
|
|
19
|
+
const textParser = parser.parse(cor)
|
|
20
|
+
console.log(textParser)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
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": {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"@babel/preset-react": "^7.23.3",
|
|
17
17
|
"axios": "^1.7.2",
|
|
18
18
|
"babel-loader": "^9.1.3",
|
|
19
|
+
"glob": "^10.4.1",
|
|
19
20
|
"path": "^0.12.7",
|
|
20
21
|
"webpack": "^5.90.3",
|
|
21
22
|
"webpack-cli": "^5.1.4"
|
package/src/CodexParser.js
CHANGED
|
@@ -63,6 +63,7 @@ class CodexParser {
|
|
|
63
63
|
verse = []
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
console.log(verse)
|
|
66
67
|
const passage = {
|
|
67
68
|
original: this.found[i].replace(/([.,])\1*$/, "").trim(),
|
|
68
69
|
book: this.bookify(book),
|
|
@@ -105,7 +106,7 @@ class CodexParser {
|
|
|
105
106
|
let bookified
|
|
106
107
|
book = book[0].charAt(0).toUpperCase() + book[0].slice(1)
|
|
107
108
|
bookified = this.abbrevations[book]
|
|
108
|
-
|
|
109
|
+
|
|
109
110
|
if (!bookified) {
|
|
110
111
|
bookified = this.bible.new.find(
|
|
111
112
|
(b) =>
|
package/src/bible.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Genesis|Gen|Ge|Gn|Ex|Exo|Exod|Exodus|Exodus|Leviticus|Lev|Le|Lv|Numbers|Num|Nu|Deuteronomy|Dt|Dt|Joshua|Josh|Jsh|Judges|Jdg|Jdg|Ruth|Rth|Ru|1 Samuel|1 Sam|1 Sa|1 S|I Sam|I Sa|1Sam|1Sa|1S|1st Samuel|1st Sam|First Samuel|First Sam|2 Samuel|2 Sam|2 Sa|2 S|II Sam|II Sa|2Sam|2Sa|2S|2nd Samuel|2nd Sam|Second Samuel|Second Sam|1 Kings|1 Kgs|1 Ki|1Kgs|1Kin|1Ki|1K|I Kgs|I Ki|1st Kings|1st Kgs|2 Kings|2 Kgs|2 Ki|2Kgs|2Kin|2Ki|2K|II Kgs|II Ki|2nd Kings|2nd Kgs|1 Chronicles|1 Chron|1 Chr|1 Ch|1Chron|1Chr|1Ch|I Chron|I Chr|I Ch|1st Chronicles|1st Chron|First Chronicles|First Chron|2 Chronicles|2 Chron|2 Chr|2 Ch|2Chron|2Chr|2Ch|II Chron|II Chr|II Ch|2nd Chronicles|2nd Chron|Second Chronicles|Second Chron|Ezra|Ezr|Ezr|Ez|Nehemiah|Neh|Ne|Esther|Esth|Es|Job|Jb|Job|Jb|Psalms|Ps|Psalm|Pslm|Psa|Psm|Pss|Proverbs|Prov|Pro|Prv|Pr|Ecclesiastes|Eccles|Eccle|Ecc|Ec|Qoh|Song of Solomon|Song|SOS|So|Canticle of Canticles|Canticles|Cant|Isaiah|Isa|Is|Jeremiah|Jer|Je|Jr|Lamentations|Lam|La|Ezekiel|Ezek|Eze|Ezk|Daniel|Dan|Da|Dn|Hosea|Hos|Ho|Joel|Joel|Jl|Amos|Amos|Am|Obadiah|Obad|Ob|Jonah|Jonah|Jnh|Jon|Micah|Mic|Mc|Nahum|Nah|Na|Habakkuk|Hab|Hb|Zephaniah|Zeph|Zep|Zp|Haggai|Hag|Hg|Zechariah|Zechar|Zech|Zec|Zc|Malachi|Mal|Ml|Matthew|Matt|Mt|Mark|Mrk|Mar|Mk|Mr|Luke|Luk|Lk|John|Joh|Jhn|Jn|Acts|Act|Ac|Romans|Rom|Ro|Rm1Corinthians|1Cor|1Co|ICor|ICo|1Cor|1Co|ICorinthians|1Corinthians|1stCorinthians|FirstCorinthians|2Corinthians|2 Cor|2 Co|II Cor|II Co|2Cor|2Co|II Corinthians|2Corinthians|2nd Corinthians|Second Corinthians|Galatians|Gal|Ga|Ephesians|Eph|Ephes|Philippians|Phil|Php|Pp|Colossians|Col|Co|1 Thessalonians|1 Thess|1 Thes|1 Th|I Thessalonians|I Thess|I Thes|I Th|1Thessalonians|1Thess|1Thes|1Th|1st Thessalonians|1st Thess|First Thessalonians|First Thess|2 Thessalonians|2 Thess|2 Thes|2 Th|II Thessalonians|II Thess|II Thes|II Th|2Thessalonians|2Thess|2Thes|2Th|2nd Thessalonians|2nd Thess|Second Thessalonians|Second Thess|1 Timothy|1 Tim|1 Ti|I Timothy|I Tim|I Ti|1Timothy|1Tim|1Ti|1st Timothy|1st Tim|First Timothy|First Tim|2 Timothy|2 Tim|2 Ti|II Timothy|II Tim|II Ti|2Timothy|2Tim|2Ti|2nd Timothy|2nd Tim|Second Timothy|Second Tim|Titus|titus|tit|ti|Philemon|Philem|Phm|Pm|He|Hebrews|Heb|James|James|Jas|Jm|1 Peter|1 Pet|1 Pe|1 Pt|1 P|I Pet|I Pt|I Pe|1Peter|1Pet|1Pe|1Pt|1P|I Peter|1st Peter|First Peter|2 Peter|2 Pet|2 Pe|2 Pt|2 P|II Peter|II Pet|II Pt|II Pe|2Peter|2Pet|2Pe|2Pt|2P|II Peter|2nd Peter|Second Peter|1 John|1 Jhn|1 Jn|1 J|1John|1Jhn|1Joh|1Jn|1Jo|1J|I John|I Jhn|I Joh|I Jn|I Jo|1st John|First John|2 John|2 Jhn|2 Jn|2 J|2John|2Jhn|2Joh|2Jn|2Jo|2J|II John|II Jhn|II Joh|II Jn|II Jo|2nd John|Second John|3 John|3 Jhn|3 Jn|3 J|3John|3Jhn|3Joh|3Jn|3Jo|3J|III John|III Jhn|III Joh|III Jn|III Jo|3rd John|Third John|Jude|Jud|Jd|Revelation|Rev|Rev|The Revelation|Apoc
|
package/src/regex.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const bookRegex = /(?:(I+|1st|2nd|3rd|First|Second|Third|[123])\s)?(Gen|Ge|Gn|Exo|Ex|Exod|Lev|Le|Lv|Num|Nu|Nm|Nb|Deut|Dt|Josh|Jos|Jsh|Judg|Jdg|Jg|Jdgs|Rth|Ru|Sam|Samuel|Kings|Kgs|Kin|Chron|Chronicles|Ezra|Ezr|
|
|
1
|
+
const bookRegex = /(?:(I+|1st|2nd|3rd|First|Second|Third|[123])\s)?(Gen|Ge|Gn|Exo|Ex|Exod|Lev|Le|Lv|Num|Nu|Nm|Nb|Deut|Dt|Josh|Jos|Jsh|Judg|Jdg|Jg|Jdgs|Rth|Ru|Sam|Samuel|Kings|Kgs|Kin|Chron|Chronicles|Ezra|Ezr|Neh|Ne|Esth|Es|Job|Job|Jb|Pslm|Ps|Psalms|Psa|Psm|Pss|Prov|Pr|Prv|Eccles|Ec|Song|So|Canticles|Song of Songs|SOS|Song of Solomon|Isa|Is|Jer|Je|Jr|Lam|La|Ezek|Eze|Ezk|Dan|Da|Dn|Hos|Ho|Joel|Joe|Jl|Amos|Am|Obad|Ob|Jnh|Jon|Micah|Mic|Nah|Na|Hab|Zeph|Zep|Zp|Haggai|Hag|Hg|Zech|Zec|Zc|Mal|Mal|Ml|Matt|Mt|Mrk|Mk|Mr|Luk|Lk|John|Jn|Jhn|Acts|Ac|Rom|Ro|Rm|Co|Cor|Corinthians|Gal|Ga|Ephes|Eph|Phil|Php|Col|Col|Th|Thes|Thess|Thessalonians|Ti|Tim|Timothy|Titus|Tit|Philem|Phm|Hebrews|Heb|He|James|Jas|Jm|Pe|Pet|Pt|Peter|Jn|Jo|Joh|Jhn|John|Jude|Jd|Jud|Jud|Rev|The Revelation|Genesis|Exodus|Leviticus|Numbers|Deuteronomy|Joshua|Judges|Ruth|Samuel|Kings|Chronicles|Ezra|Nehemiah|Esther|Job|Psalms|Psalm|Proverbs|Ecclesiastes|Song of Solomon|Isaiah|Jeremiah|Lamentations|Ezekiel|Daniel|Hosea|Joel|Amos|Obadiah|Jonah|Micah|Nahum|Habakkuk|Zephaniah|Haggai|Zechariah|Malachi|Matthew|Mark|Luke|John|Acts|Romans|Corinthians|Galatians|Ephesians|Philippians|Colossians|Thessalonians|Timothy|Titus|Philemon|Hebrews|James|Peter|John|Revelation|Re|Ap)/gmi
|
|
2
2
|
const chapterRegex = /\b(?:\.?\s?\d+[:|\.]?)\b/gm
|
|
3
|
-
const verseRegex = /\b[:.](\d+(?:,?\s*?\d+?|-|–|—\d+)*)?\d+(?:[abcde])?(?:,\d+)
|
|
3
|
+
const verseRegex = /\b[:.](\d+(?:,?\s*?\d+?|-|–|—\d+)*)?\d+(?:[abcde])?(?:,\d+)*(?:,\s?\d+)?\b/gm
|
|
4
4
|
const chapterRange = /.?\s?(?:[-—–])\s?/gm
|
|
5
5
|
const chapterRangeVerseRegex = /(?:.\d+)?/gm
|
|
6
6
|
const chapterVerseRange =
|
|
7
|
-
|
|
7
|
+
/(.?\s?\d+((?:[:.]\d+)?(\s?[-–—]\s?)?(?:\d+)(?:(,\s?\d+)*)?([:.]?\d+)?(,?\s?\d+[–—-]\s?\d+,?\d+)?)?(?:[:.]\d+)?(?:[abcde])?(?:,\d+)*(?:[-–—]\d?\s?)?)(?:[:.]\d+[–-—]\s?\d+,?\s?\d+)?(?:(\d+)?,\s?\d+)?/gim
|
|
8
8
|
const scripturesRegex = new RegExp(`(${bookRegex.source})(${chapterVerseRange.source})`, "gmi")
|
|
9
9
|
module.exports.bookRegex = bookRegex
|
|
10
10
|
module.exports.chapterRegex = chapterRegex
|
package/src/toc.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const CodexParser = require("./src/CodexParser.js")
|
|
2
2
|
|
|
3
3
|
const parser = new CodexParser()
|
|
4
|
-
const text = parser.parse("
|
|
5
|
-
|
|
6
|
-
console.log(multiNoSpace)
|
|
4
|
+
const text = parser.parse("Joel 2:10, 11")
|
|
5
|
+
console.log(text)
|
package/webpack.config.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { fileURLToPath } from "url"
|
|
1
|
+
const path = require("path")
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
const __dirname = path.dirname(__filename)
|
|
6
|
-
|
|
7
|
-
export default {
|
|
3
|
+
module.exports = {
|
|
8
4
|
entry: {
|
|
9
5
|
main: "./src/CodexParser.js",
|
|
10
6
|
},
|