codexparser 0.0.46 → 0.0.48

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.
@@ -2,12 +2,12 @@ const CodexParser = require("./src/CodexParser.js")
2
2
 
3
3
  const parser = new CodexParser()
4
4
  const text =
5
- "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"
6
- const single = "Ge 27.27-29,32-40 Heb 11.20 Heb. 12.17 Jonah 3"
5
+ "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"
6
+ const single = "Ge 27.27-29,89-40 Heb 11.20 Heb. 12.17 Jonah 3"
7
7
  const jd = "Jd. 5"
8
8
  const cor = "Song of Solomon 1:2, Song of Songs 2:2. Ezek 17:3. He 12:13-15 Hos 1:1-3, 8 "
9
9
  const passages = parser.parse(single + " " + text + " " + jd + " " + cor)
10
- passages.getPassages().forEach(passage => {
11
- console.log(passage)
10
+ passages.getPassages().forEach((passage) => {
11
+ console.log(passage)
12
12
  })
13
13
  //const passages = parser.parse('Romans 8:9,12,15,17,20,28')
@@ -0,0 +1,5 @@
1
+ const BibleParser = require("./src/CodexParser.js")
2
+ const string = "Psalms 113-118"
3
+ const parser = new BibleParser()
4
+ const passages = parser.parse(string)
5
+ console.log(passages.getPassages()[0])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexparser",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
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": {
@@ -80,7 +80,6 @@ class CodexParser {
80
80
  const found = this.found.filter((passage) => passage.start.b === book)
81
81
  booksWithResults.push(found)
82
82
  }
83
- //console.log(booksWithResults)
84
83
  for (let i = 0; i < booksWithResults.length; i++) {
85
84
  const initialPassage = booksWithResults[i].shift()
86
85
  const shouldBeRange = initialPassage.osis.match(/[-–—]/)
@@ -102,7 +101,7 @@ class CodexParser {
102
101
  firstPassage.to = {
103
102
  book: this.bookify(initialPassage.end.b),
104
103
  chapter: initialPassage.end.c,
105
- verses: [initialPassage.start.v],
104
+ verses: [initialPassage.end.v],
106
105
  }
107
106
  } else {
108
107
  firstPassage.verses = [initialPassage.start.v + "-" + initialPassage.end.v]
package/src/regex.js CHANGED
@@ -1,11 +1,12 @@
1
- const bookRegex = /((?:(I+|1st|2nd|3rd|First|Second|Third|[123])\s)?(Gen|Gn|Exo|Ex|Exod|Lev|Lv|Num|Nu|Nm|Nb|Deut|Dt|Josh|Jos|Jsh|Judg|Jdg|Jg|Jdgs|Rth|Ru|Sam|Samuel|Kings|Kgs|Chron|Chronicles|Ezra|Ezr|Ez|Neh|Ne|Esth|Job|Job|Jb|Pslm|Ps|Psalms|Psa|Psm|Pss|Prov|Pr|Prv|Eccles|Ec|Song|So|Canticles|Song of Songs|SOS|Isa|Is|Jer|Je|Jr|Lam|La|Ezek|Eze|Ezk|Dan|Da|Dn|Hos|Ho|Joel|Joe|Jl|Amos|Am|Obad|Ob|Jnh|Jon|Micah|Mic|Nah|Na|Hab|Zeph|Zep|Zp|Haggai|Hag|Hg|Zech|Zec|Zc|Mal|Mal|Ml|Matt|Mrk|Mk|Luk|Lk|John|Jn|Jhn|Acts|Ac|Rom|Ro|Rm|Co|Cor|Corinthians|Gal|Ga|Ephes|Eph|Phil|Php|Col|Col|Thes|Thess|Thessalonians|Ti|Tim|Timothy|Titus|Tit|Philem|Phm|Hebrews|Heb|He|James|Jas|Jm|Pe|Pet|Pt|Peter|Jn|Jo|Joh|Jhn|John|Jude|Jd|Jud|Jud|Rev|The Revelation|Genesis|Exodus|Leviticus|Numbers|Deuteronomy|Joshua|Judges|Ruth|Samuel|Kings|Chronicles|Ezra|Nehemiah|Esther|Job|Psalms|Psalm|Proverbs|Ecclesiastes|Song of Solomon|Isaiah|Jeremiah|Lamentations|Ezekiel|Daniel|Hosea|Joel|Amos|Obadiah|Jonah|Micah|Nahum|Habakkuk|Zephaniah|Haggai|Zechariah|Malachi|Matthew|Mark|Luke|John|Acts|Romans|Corinthians|Galatians|Ephesians|Philippians|Colossians|Thessalonians|Timothy|Titus|Philemon|Hebrews|James|Peter|John|Revelation|Re|Ap))/gmi
1
+ const bookRegex =
2
+ /((?:(I+|1st|2nd|3rd|First|Second|Third|[123])\s)?(Gen|Gn|Exo|Ex|Exod|Lev|Lv|Num|Nu|Nm|Nb|Deut|Dt|Josh|Jos|Jsh|Judg|Jdg|Jg|Jdgs|Rth|Ru|Sam|Samuel|Kings|Kgs|Chron|Chronicles|Ezra|Ezr|Ez|Neh|Ne|Esth|Job|Job|Jb|Pslm|Ps|Psalms|Psa|Psm|Pss|Prov|Pr|Prv|Eccles|Ec|Song|So|Canticles|Song of Songs|SOS|Isa|Is|Jer|Je|Jr|Lam|La|Ezek|Eze|Ezk|Dan|Da|Dn|Hos|Ho|Joel|Joe|Jl|Amos|Am|Obad|Ob|Jnh|Jon|Micah|Mic|Nah|Na|Hab|Zeph|Zep|Zp|Haggai|Hag|Hg|Zech|Zec|Zc|Mal|Mal|Ml|Matt|Mrk|Mk|Luk|Lk|John|Jn|Jhn|Acts|Ac|Rom|Ro|Rm|Co|Cor|Corinthians|Gal|Ga|Ephes|Eph|Phil|Php|Col|Col|Thes|Thess|Thessalonians|Ti|Tim|Timothy|Titus|Tit|Philem|Phm|Hebrews|Heb|He|James|Jas|Jm|Pe|Pet|Pt|Peter|Jn|Jo|Joh|Jhn|John|Jude|Jd|Jud|Jud|Rev|The Revelation|Genesis|Exodus|Leviticus|Numbers|Deuteronomy|Joshua|Judges|Ruth|Samuel|Kings|Chronicles|Ezra|Nehemiah|Esther|Job|Psalms|Psalm|Proverbs|Ecclesiastes|Song of Solomon|Isaiah|Jeremiah|Lamentations|Ezekiel|Daniel|Hosea|Joel|Amos|Obadiah|Jonah|Micah|Nahum|Habakkuk|Zephaniah|Haggai|Zechariah|Malachi|Matthew|Mark|Luke|John|Acts|Romans|Corinthians|Galatians|Ephesians|Philippians|Colossians|Thessalonians|Timothy|Titus|Philemon|Hebrews|James|Peter|John|Revelation|Re|Ap))/gim
2
3
  const chapterRegex = /\b(?:\.?\s?\d+[:|\.]?)\b/gm
3
- const verseRegex = /\b[:.].+\b/gm
4
+ const verseRegex = /\b[:.].+\b/gm
4
5
  const chapterRange = /.?\s?(?:[-—–])\s?/gm
5
6
  const chapterRangeVerseRegex = /(?:.\d+)?/gm
6
- const chapterVerseRange =
7
- /.?\s?(?:\d+[:.])?\d+[a-e]?(?:(?:\s?[-–—]|,)(?!\s[1-3]\s+[A-Z])\s?(?:\d+[:.])?\d+[a-e]?)*/gim
7
+ const chapterVerseRange = /.?\s?(?:\d+[:.])?\d+[a-e]?(?:(?:\s?[-–—]|,)(?!\s[1-3]\s+[A-Z])\s?(?:\d+[:.])?\d+[a-e]?)*/gim
8
8
  const scripturesRegex = new RegExp(`(${bookRegex.source})(${chapterVerseRange.source})`, "gmi")
9
+ console.log(scripturesRegex)
9
10
  module.exports.bookRegex = bookRegex
10
11
  module.exports.chapterRegex = chapterRegex
11
12
  module.exports.scripturesRegex = scripturesRegex
@@ -1,5 +1,5 @@
1
1
  const BibleParser = require("./src/CodexParser.js")
2
- const string = "Rev 12:18"
2
+ const string = "Romans 9:32 Romans 9:33"
3
3
  const parser = new BibleParser()
4
4
  const result = parser.parse(string)
5
5
  console.log(result.getPassages())