codexparser 0.0.76 → 0.0.78

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.76",
3
+ "version": "0.0.78",
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": {
@@ -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)
@@ -159,7 +157,7 @@ class CodexParser {
159
157
 
160
158
  versify(passage) {
161
159
  if (passage.start.v !== passage.end.v) {
162
- if (passage.type === "range") {
160
+ if (passage.type === "range" || passage.type === "ff") {
163
161
  if (passage.start.b === passage.end.b) {
164
162
  return [`${passage.start.v}-${passage.end.v}`]
165
163
  } else {
@@ -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("Ps 139:1 Allusions Rev 8:27")
14
+ const result = parser.parse("Psalm 34:12f")
15
15
  dump(result.getPassages())