codexparser 0.0.51 → 0.0.52
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.52",
|
|
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
|
@@ -91,6 +91,7 @@ class CodexParser {
|
|
|
91
91
|
const results = booksWithResults[i]
|
|
92
92
|
for (let j = 0; j < results.length; j++) {
|
|
93
93
|
const result = results[j]
|
|
94
|
+
dump(result)
|
|
94
95
|
const passage = {
|
|
95
96
|
book: this.bookify(result.start.b),
|
|
96
97
|
chapter: result.start.c,
|
|
@@ -100,6 +101,7 @@ class CodexParser {
|
|
|
100
101
|
let next = results[j + 1]
|
|
101
102
|
while (next && next.type === "integer" && next.end.c === result.start.c) {
|
|
102
103
|
passage.verses.push(next.start.v)
|
|
104
|
+
if (next.end.v !== next.start.v) passage.verses.push(next.end.v)
|
|
103
105
|
passage.subType = next.type
|
|
104
106
|
j++
|
|
105
107
|
next = results[j + 1]
|
|
@@ -126,9 +128,7 @@ class CodexParser {
|
|
|
126
128
|
return this
|
|
127
129
|
}
|
|
128
130
|
chapterify(chapter) {
|
|
129
|
-
|
|
130
|
-
return `${chapter.start.c} - ${chapter.end}`
|
|
131
|
-
}
|
|
131
|
+
return chapter.start.c
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
versify(passage) {
|
|
@@ -4,7 +4,7 @@ const util = require("util")
|
|
|
4
4
|
const dump = (item) => {
|
|
5
5
|
console.log(util.inspect(item, { depth: null, colors: true }))
|
|
6
6
|
}
|
|
7
|
-
const string = "
|
|
7
|
+
const string = "Revelation 14:15,18,19"
|
|
8
8
|
const parser = new BibleParser()
|
|
9
9
|
const result = parser.parse(string)
|
|
10
10
|
dump(result.getPassages())
|