codexparser 0.0.36 → 0.0.38

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.
@@ -7,4 +7,5 @@ const single = "Ge 27.27-29,32-40 Heb 11.20 Heb. 12.17 Jonah 3"
7
7
  const jd = "Jd. 5"
8
8
  const cor = "Hos 1:1-3, 8 Song of Solomon 1:2, Song of Songs 2:2. Ezek 17:3. Ezekiel 17:3"
9
9
  const passages = parser.parse(single + " " + text + " " + jd + " " + cor)
10
+ console.log(passages.getPassages())
10
11
  //const passages = parser.parse('Romans 8:9,12,15,17,20,28')
package/bcv_test.js CHANGED
@@ -3,10 +3,10 @@ const text =
3
3
  "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"
4
4
  const single = "Ge 27.27-29,89-40 Heb 11.20 Heb. 12.17 Jonah 3"
5
5
  const jd = "Jd. 5"
6
- const cor = "Hos 1:1-3, 8 Song of Solomon 1:2, Song of Songs 2:2. Ezek 17:3. Ezekiel 17:3"
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"
7
7
 
8
8
  const parser = new bcv_parser()
9
- const textParser = parser.parse(text + single + jd + cor)
9
+ const textParser = parser.parse(text + single + jd + cor.replace(/He/, "Hebrews"))
10
10
  const passages = textParser.parsed_entities()
11
11
 
12
12
  passages.forEach((passage) => {
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "codexparser",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
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": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "build": "webpack --mode=production"
8
+ "webpack": "webpack --mode=production",
9
+ "build": "browserify src/CodexParser.js -t | uglifyjs > dist/CodexParser.js"
9
10
  },
10
11
  "author": "Jeremy Menicucci",
11
12
  "license": "ISC",
@@ -16,8 +17,12 @@
16
17
  "@babel/preset-react": "^7.23.3",
17
18
  "axios": "^1.7.2",
18
19
  "babel-loader": "^9.1.3",
20
+ "browserify": "^17.0.0",
21
+ "fs": "^0.0.1-security",
19
22
  "glob": "^10.4.1",
20
23
  "path": "^0.12.7",
24
+ "uglify-es": "^3.3.9",
25
+ "uglifyify": "^5.0.2",
21
26
  "webpack": "^5.90.3",
22
27
  "webpack-cli": "^5.1.4"
23
28
  },
@@ -49,8 +49,7 @@ class CodexParser {
49
49
  }
50
50
  const uniqueBooks = [...new Set(books)]
51
51
  const booksWithResults = []
52
- //TODO: Need to loop through and create an array of all the same passage
53
- // in order to be able to identify if comma separated verses goes with it or not.
52
+
54
53
  for (const book of uniqueBooks) {
55
54
  const found = this.found.filter((passage) => passage.start.b === book)
56
55
  booksWithResults.push(found)
@@ -129,12 +128,15 @@ class CodexParser {
129
128
  subPassage.verses =
130
129
  passage.start.v !== passage.end.v ? [passage.start.v, passage.end.v] : [passage.start.v]
131
130
  }
131
+ subPassage.testament = this.bible.old.includes(subPassage.book) ? "old" : "new"
132
132
  this.passages.push(subPassage)
133
133
  }
134
134
  }
135
+ firstPassage.testament = this.bible.old.includes(firstPassage.book) ? "old" : "new"
135
136
  this.passages.push(firstPassage)
136
137
  //console.log(this.passages)
137
138
  }
139
+ this.found = []
138
140
  return this
139
141
  //console.log(booksWithResults)
140
142
  /* for (let i = 0; i < this.found.length; i++) {
@@ -200,7 +202,7 @@ class CodexParser {
200
202
  * @return {string|undefined} The full name of the book if found, otherwise undefined.
201
203
  */
202
204
  bookify(book) {
203
- if(typeof book !== "string") {
205
+ if (typeof book !== "string") {
204
206
  book = book[0]
205
207
  }
206
208
  let bookified
@@ -1,6 +1,6 @@
1
1
  const CodexParser = require("./src/CodexParser.js")
2
2
 
3
3
  const parser = new CodexParser()
4
- const scripture = "Hos 1:1-3, 8"
4
+ const scripture = "He 1:1-3, 8"
5
5
  console.log(scripture)
6
6
  parser.parse(`${scripture}. Please turn in your Bibles.`)