codexparser 0.0.17 → 0.0.18
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/regex.js +3 -3
- package/test.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
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/regex.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const bookRegex =
|
|
2
|
-
/(?:(?:[gG]e(?:[a-zA-Z]+)?|[eE]x(?:[a-zA-Z]+)?|[lL]e(?:[a-zA-Z]+)?|[nN]u(?:[a-zA-Z]+)?|[dD]e(?:[a-zA-Z]+)?|[jJ]o(?:[a-zA-Z]+)?|[jJ]u(?:[a-zA-Z]+)?|[rR]u(?:[a-zA-Z]+)?|1\s?[sS](?:[a-zA-Z]+)?|2\s?[sS](?:[a-zA-Z]+)?|1\s?[kK](?:[a-zA-Z]+)?|2\s?[kK](?:[a-zA-Z]+)?|1\s?[cC]hr(?:[a-zA-Z]+)?|2\s?[cC]hr(?:[a-zA-Z]+)?|[eE]z(?:[a-zA-Z]+)?|[nN]e(?:[a-zA-Z]+)?|[eE]s(?:[a-zA-Z]+)?|[jJ](?:[a-zA-Z]+)?|[pP]s(?:[a-zA-Z]+)?|[pP]r(?:[a-zA-Z]+)?|[eE|Qoh](?:[a-zA-Z]+)?|[sS]o(?:[a-zA-Z]+)?|[iI]s(?:[a-zA-Z]+)?|[jJ]e(?:[a-zA-Z]+)?|[lL]a(?:[a-zA-Z]+)?|[eE]z(?:[a-zA-Z]+)?|[dD](?:[a-zA-Z]+)?|[hH]o(?:[a-zA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](?:[a-zA-Z]+)?|[pP]h(?:[a-zA-Z]+)?|[hH](?:[a-zA-Z]+)?|[jJ]a(?:[a-zA-Z]+)?|1\s?[pP](?:[a-zA-Z]+)?|2\s?[pP](?:[a-zA-Z]+)?|1\s?[jJ](?:[a-zA-Z]+)?|2\s?[jJ](?:[a-zA-Z]+)?|3\s?[jJ](?:[a-zA-Z]+)?|[jJ](:[a-zA-Z]+)?|[Rr|Aa](?:[a-zA-Z]+)?))?/gim
|
|
3
|
+
const chapterRegex = /\b(?:\.?\s?\d+[:|\.]?)\b/gm
|
|
4
|
+
const verseRegex = /\b[:.](\d+(?:,?\s*?\d+?|-|–|—\d+)*)?\d+\b/gm
|
|
5
5
|
const chapterRange = /\s?(?:[-|—|–])\s?/gm
|
|
6
6
|
const chapterRangeVerseRegex = /.\d+/gm
|
|
7
7
|
const scripturesRegex = new RegExp(
|
package/test.js
CHANGED
|
@@ -3,7 +3,7 @@ const CodexParser = require("./src/CodexParser.js")
|
|
|
3
3
|
const parser = new CodexParser()
|
|
4
4
|
const text =
|
|
5
5
|
"The passages that we are looking at tonight are found in 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."
|
|
6
|
-
const single = "Ge
|
|
6
|
+
const single = "Ge 27.27-29,89-40 Heb 11.20"
|
|
7
7
|
const passages = parser.parse(text)
|
|
8
8
|
console.log(passages)
|
|
9
9
|
|