codexparser 0.0.75 → 0.0.76
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/bcv-single-test.js +1 -1
- package/bcv_test.js +1 -1
- package/package.json +1 -1
- package/src/CodexParser.js +3 -5
- package/sub-verse-scripture-test.js +1 -1
package/bcv-single-test.js
CHANGED
package/bcv_test.js
CHANGED
|
@@ -6,7 +6,7 @@ const jd = "Jd. 5"
|
|
|
6
6
|
const cor = "Hos 1:1-3, 8 Song of Solomon 1:2, Song of Songs 2:2. Ezek 17:3. Ezekiel 17:3 He 10:13 Rev 12:13"
|
|
7
7
|
|
|
8
8
|
const parser = new bcv_parser()
|
|
9
|
-
const textParser = parser.parse("Gen 13:14-16 Clement of Letter to the Romanse, Letter to the Corinthians [51; 77; 111] 10:4-5; Jubilees [14; 43; 46; 118; 175; 179] 13:19-20; Genesis Apocryphon 21:8-10, 13 // Gen 13:15 Gal 3:16; Pseudo-Philo 8:3 Allusions - Jub 19:21-22; QapGn 21:8-10 // Gen 13:15 - Ac 7:5")
|
|
9
|
+
const textParser = parser.parse("Gen 13:14-16 Clement of Letter to the Romanse, Letter to the Corinthians [51; 77; 111] 10:4-5; Jubilees [14; 43; 46; 118; 175; 179] 13:19-20; Genesis Apocryphon 21:8-10, 13 // Gen 13:15 Gal 3:16; Pseudo-Philo 8:3 Allusions - Jub 19:21-22; QapGn 21:8-10 // Gen 13:15 - Ac 7:5 Rev 8:27")
|
|
10
10
|
const passages = textParser.parsed_entities()
|
|
11
11
|
|
|
12
12
|
passages.forEach((passage) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.76",
|
|
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
|
@@ -42,6 +42,8 @@ class CodexParser {
|
|
|
42
42
|
* @return {array} The found passages from the text.
|
|
43
43
|
*/
|
|
44
44
|
scan(text) {
|
|
45
|
+
text = text.replace(/Rev(?=\s|\.)/gim, "Revelation")
|
|
46
|
+
console.log(text)
|
|
45
47
|
const regex = /(?:He(?=\s?\d+))/g
|
|
46
48
|
let match
|
|
47
49
|
const matches = []
|
|
@@ -65,7 +67,7 @@ class CodexParser {
|
|
|
65
67
|
text = text.replace(this.EzraAbbrv, "Ezra")
|
|
66
68
|
}
|
|
67
69
|
const passages = this.crawler.parse(text).parsed_entities()
|
|
68
|
-
|
|
70
|
+
|
|
69
71
|
for (let j = 0; j < passages.length; j++) {
|
|
70
72
|
const passage = passages[j]
|
|
71
73
|
for (let i = 0; i < passage.entities.length; i++) {
|
|
@@ -91,10 +93,6 @@ class CodexParser {
|
|
|
91
93
|
this.scan(reference)
|
|
92
94
|
for (let i = 0; i < this.found.length; i++) {
|
|
93
95
|
const result = this.found[i]
|
|
94
|
-
if (!result.entities[0].valid.valid) {
|
|
95
|
-
continue
|
|
96
|
-
}
|
|
97
|
-
|
|
98
96
|
if (result.type === "range" && result.start.b !== result.end.b) {
|
|
99
97
|
console.log("=================")
|
|
100
98
|
const newPassageFound = result.end.b + " " + result.end.c + ":" + result.end.v
|
|
@@ -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("Ps 139:1 Allusions Rev 8:27")
|
|
15
15
|
dump(result.getPassages())
|