codexparser 0.0.76 → 0.0.77
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.77",
|
|
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
|
@@ -43,7 +43,6 @@ class CodexParser {
|
|
|
43
43
|
*/
|
|
44
44
|
scan(text) {
|
|
45
45
|
text = text.replace(/Rev(?=\s|\.)/gim, "Revelation")
|
|
46
|
-
console.log(text)
|
|
47
46
|
const regex = /(?:He(?=\s?\d+))/g
|
|
48
47
|
let match
|
|
49
48
|
const matches = []
|
|
@@ -94,7 +93,6 @@ class CodexParser {
|
|
|
94
93
|
for (let i = 0; i < this.found.length; i++) {
|
|
95
94
|
const result = this.found[i]
|
|
96
95
|
if (result.type === "range" && result.start.b !== result.end.b) {
|
|
97
|
-
console.log("=================")
|
|
98
96
|
const newPassageFound = result.end.b + " " + result.end.c + ":" + result.end.v
|
|
99
97
|
const newPassageToAdd = this.crawler.parse(newPassageFound).parsed_entities()[0].entities
|
|
100
98
|
this.found.splice(i + 1, 0, ...newPassageToAdd)
|
|
@@ -293,7 +291,6 @@ class CodexParser {
|
|
|
293
291
|
|
|
294
292
|
regex(text) {
|
|
295
293
|
this.found = text.match(this.scripturesRegex)
|
|
296
|
-
console.log(this.found)
|
|
297
294
|
return this
|
|
298
295
|
}
|
|
299
296
|
|
|
@@ -302,7 +299,6 @@ class CodexParser {
|
|
|
302
299
|
for (let i = 0; i < this.found.length; i++) {
|
|
303
300
|
let verse, chapter
|
|
304
301
|
const hasChapterRange = this.found[i].match(/(?<=-\s?)\b\d+[.:].+\b/)
|
|
305
|
-
console.log(hasChapterRange)
|
|
306
302
|
const book = this.found[i].match(this.bookRegex)
|
|
307
303
|
if (book === null) continue
|
|
308
304
|
chapter = this.found[i].replace(book[0], "").match(this.chapterRegex)
|
|
@@ -11,5 +11,5 @@ parser.options({
|
|
|
11
11
|
invalid_sequence_strategy: "include",
|
|
12
12
|
single_chapter_1_strategy: "verse",
|
|
13
13
|
})
|
|
14
|
-
const result = parser.parse("
|
|
14
|
+
const result = parser.parse("Genesis 3:17-19 // Genesis 3:17 Genesis 3:18-19 Genesis 3:19")
|
|
15
15
|
dump(result.getPassages())
|