codexparser 0.0.79 → 0.0.80

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.
@@ -4,11 +4,12 @@ const util = require("util")
4
4
  const dump = (item) => {
5
5
  console.log(util.inspect(item, { depth: null, colors: true }))
6
6
  }
7
- const text = "Psalm 34:12f"
7
+ const text = "Psalm 95:6 MT"
8
8
 
9
9
  const parser = new bcv_parser({
10
10
  invalid_sequence_strategy: "include",
11
11
  invalid_passage_strategy: "include",
12
+ sequence_combination_strategy: "combine"
12
13
  })
13
14
  const textParser = parser.parse(text)
14
15
  console.log(textParser)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexparser",
3
- "version": "0.0.79",
3
+ "version": "0.0.80",
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/scan-test.js CHANGED
@@ -4,20 +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
- let text = `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
8
-
9
- Ge 27.27-29,89-40 Heb 11.20 Heb. 12.17 Jonah 3
10
-
11
- Jd. 5
12
- Jd 6
13
-
14
- 1 Cor 12:34 2 Cor 3:4. He 4.12 Re 1.16
15
-
16
- Leviticus 16:6 He 5.3 He 7.27
17
-
18
- Hos 10:1-3, 8 and 1 John 2:23
19
-
20
- exod15.18. 2 Cor 12:23 Malachi 3:32`
7
+ let text = `Psalm 94:4-100:6 MT`
21
8
  const parser = new BibleParser()
22
- const result = parser.find(text)
9
+ const result = parser.find(text).enhance()
23
10
  dump(result)
@@ -90,6 +90,7 @@ class CodexParser {
90
90
  }
91
91
  this.passages = []
92
92
  this.scan(reference)
93
+ const books = []
93
94
  for (let i = 0; i < this.found.length; i++) {
94
95
  const result = this.found[i]
95
96
  if (result.type === "range" && result.start.b !== result.end.b) {
@@ -229,6 +230,7 @@ class CodexParser {
229
230
  return parts
230
231
  .join(" ")
231
232
  .replace(/\s+:\s+/g, ":")
233
+ .replace(/\s[-–—]\s/, "-")
232
234
  .trim()
233
235
  }
234
236
  find(text) {
@@ -541,6 +543,7 @@ class CodexParser {
541
543
  this.found.push(passage.trim())
542
544
  newText += "</span>&nbsp;"
543
545
  }
546
+ console.log(newText)
544
547
  return this
545
548
  }
546
549
 
@@ -551,7 +554,7 @@ class CodexParser {
551
554
  original: this.found[i],
552
555
  book: this.bookify(this.found[i].match(this.bookRegex)[0]),
553
556
  chapter: this.found[i].match(this.chapterRegex),
554
- verse: this.found[i].match(/(?<=[.:])(\d+.+)/),
557
+ verse: this.found[i].match(this.verseRegex)[0],
555
558
  }
556
559
  this.passages.push(passage)
557
560
  }
package/src/abbr.js CHANGED
@@ -91,7 +91,6 @@ const abbrevations = {
91
91
  "II Ch": "2 Chronicles",
92
92
  Ezra: "Ezra",
93
93
  Ezr: "Ezra",
94
- Ez: "Ezra",
95
94
  Neh: "Nehemiah",
96
95
  Ne: "Nehemiah",
97
96
  Esth: "Esther",
@@ -10,6 +10,7 @@ parser.options({
10
10
  invalid_passage_strategy: "include",
11
11
  invalid_sequence_strategy: "include",
12
12
  single_chapter_1_strategy: "verse",
13
+ sequence_combination_strategy: "combine",
13
14
  })
14
- const result = parser.parse("Isaiah 8:21-9:6")
15
+ const result = parser.parse("John 3:1-3")
15
16
  dump(result.getPassages())
package/tests/find.js ADDED
@@ -0,0 +1,7 @@
1
+ const CodexParser = require("../src/CodexParser.js")
2
+
3
+ const parser = new CodexParser()
4
+
5
+ parser.find('1 John 2-3').enhance()
6
+
7
+ console.log(parser.getPassages())