codexparser 0.0.80 → 0.0.82

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.80",
3
+ "version": "0.0.82",
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": {
@@ -31,4 +31,4 @@
31
31
  "bible-passage-reference-parser": "^2.0.1",
32
32
  "unidecode": "^1.1.0"
33
33
  }
34
- }
34
+ }
@@ -1,13 +1,11 @@
1
+ const versified = require("./versified")
1
2
  const bible = require("./bible")
2
3
  const { bookRegex, chapterRegex, verseRegex, scripturesRegex, EzraAbbrv } = require("./regex")
3
4
  const abbrevations = require("./abbr")
4
- //const toc = require("./toc")
5
5
  const crawler = require("bible-passage-reference-parser/js/en_bcv_parser").bcv_parser
6
6
  const util = require("util")
7
-
8
- const dump = (item) => {
9
- console.log(util.inspect(item, { depth: null, colors: true }))
10
- }
7
+ const dump = require("./functions").dump
8
+ const dd = require("./functions").dd
11
9
 
12
10
  class CodexParser {
13
11
  constructor() {
@@ -22,6 +20,7 @@ class CodexParser {
22
20
  this.EzraAbbrv = EzraAbbrv
23
21
  //this.toc = toc
24
22
  this.crawler = new crawler()
23
+ this.versificationDifferences = versified
25
24
  }
26
25
 
27
26
  /**
@@ -83,7 +82,6 @@ class CodexParser {
83
82
  * @return {array} An array of parsed passages.
84
83
  */
85
84
  parse(reference) {
86
- //TODO: Need to fix chapter ranges when another verse is tacted onto the end of it.
87
85
  if (!reference) {
88
86
  this.passages = []
89
87
  return this
@@ -107,6 +105,7 @@ class CodexParser {
107
105
  chapter: result.start.c,
108
106
  verses: this.versify(result),
109
107
  type: result.type,
108
+ ...result["entities"][0],
110
109
  }
111
110
  passage.testament = this.bible.old.includes(passage.book) ? "old" : "new"
112
111
  let next = this.found[i + 1]
@@ -139,24 +138,96 @@ class CodexParser {
139
138
  }
140
139
  passage.original = result.osis
141
140
  passage.scripture = this.scripturize(passage)
141
+ passage.passages = this.populate(result.entities[0], passage.verses)
142
142
  passage.indices = result.indices
143
- passage.entities = result.entities
144
- if (passage.entities[0].translations) {
145
- passage.version = {
146
- name: passage.entities[0].translations[0].translation,
147
- alias: passage.entities[0].translations[0].alias,
148
- abbreviation: passage.entities[0].translations[0].osis,
149
- }
150
- }
151
143
  this.passages.push(passage)
152
144
  }
153
145
  this.found = []
146
+ this.versification()
154
147
  return this
155
148
  }
149
+
150
+ versification() {
151
+ for (let i = 0; i < this.passages.length; i++) {
152
+ const passage = this.passages[i]
153
+ const hasVersification = this.versificationDifferences[passage.book]
154
+ for (let j = 0; j < passage.passages.length; j++) {
155
+ const subPassage = passage.passages[j]
156
+ if (hasVersification) {
157
+ if (this.versificationDifferences[passage.book][subPassage.chapter + ":" + subPassage.verse])
158
+ subPassage.versification =
159
+ this.versificationDifferences[passage.book][subPassage.chapter + ":" + subPassage.verse]
160
+ }
161
+ }
162
+ }
163
+ }
164
+
165
+ /**
166
+ * Populate a Set of passages from entities.start.v to entities.end.v,
167
+ * and then add any additional verses from the verses array.
168
+ *
169
+ * @param {Object} entities - Entities object from the bible-passage-reference-parser
170
+ * @param {Array} verses - Array of verse numbers to add to the set of passages
171
+ * @return {Array} Array of passage objects
172
+ */
173
+ populate(entities, verses) {
174
+ let passages = []
175
+ for (let i = entities.start.v; i <= entities.end.v; i++) {
176
+ passages.push({
177
+ book: this.bookify(entities.start.b),
178
+ chapter: entities.start.c,
179
+ verse: i,
180
+ })
181
+ }
182
+
183
+ if (verses.length > 1) {
184
+ const hasDashes = verses.find((verse) => verse.includes("-"))
185
+ if (hasDashes) {
186
+ const newVerses = []
187
+ for (let i = 0; i < verses.length; i++) {
188
+ const verse = verses[i]
189
+ if (/[-–—]/gim.verse) {
190
+ const [start, end] = verse.split("-").map((v) => parseInt(v))
191
+ for (let j = start; j <= end; j++) {
192
+ newVerses.push(j)
193
+ }
194
+ } else {
195
+ newVerses.push(parseInt(verse))
196
+ }
197
+ }
198
+ verses = newVerses.sort((a, b) => a - b)
199
+ }
200
+ for (let i = 0; i < verses.length; i++) {
201
+ const passage = {
202
+ book: this.bookify(entities.start.b),
203
+ chapter: entities.start.c,
204
+ verse: verses[i],
205
+ }
206
+ if (
207
+ !passages.find(
208
+ (p) => p.book === passage.book && p.chapter === passage.chapter && p.verse === passage.verse
209
+ )
210
+ ) {
211
+ passages.push(passage)
212
+ }
213
+ }
214
+ }
215
+
216
+ return [...new Set(passages)]
217
+ }
218
+
156
219
  chapterify(chapter) {
157
220
  return chapter.start.c
158
221
  }
159
222
 
223
+ /**
224
+ * Given a passage, return an array of verses. If the passage is a range, the
225
+ * array will contain a single string in the format "start-end". If the passage
226
+ * is not a range, the array will contain each verse number as a separate element.
227
+ *
228
+ * @param {Object} passage - A passage object from the bible-passage-reference-parser
229
+ * @return {Array} Array of verse numbers
230
+ */
160
231
  versify(passage) {
161
232
  if (passage.start.v !== passage.end.v) {
162
233
  if (passage.type === "range" || passage.type === "ff") {
@@ -218,7 +289,10 @@ class CodexParser {
218
289
  }
219
290
 
220
291
  /**
221
- * @param {object} passage - A passage object
292
+ * Converts a passage object into a scripturize object with human-readable name, chapter and verses and a hash.
293
+ *
294
+ * @param {object} passage - The passage object to scripturize.
295
+ * @return {object} The object with the human-readable name, chapter and verses and a hash.
222
296
  */
223
297
  scripturize(passage) {
224
298
  const { book, chapter, verses, to } = passage
@@ -227,406 +301,17 @@ class CodexParser {
227
301
  if (to) {
228
302
  parts.push("-", to.chapter, ":", to.verses)
229
303
  }
230
- return parts
304
+ const full = parts
231
305
  .join(" ")
232
306
  .replace(/\s+:\s+/g, ":")
233
307
  .replace(/\s[-–—]\s/, "-")
234
308
  .trim()
235
- }
236
- find(text) {
237
- const books = [
238
- "Gen",
239
- "Ge",
240
- "Gn",
241
- "Exo",
242
- "Ex",
243
- "Exod",
244
- "Lev",
245
- "Le",
246
- "Lv",
247
- "Num",
248
- "Nu",
249
- "Nm",
250
- "Nb",
251
- "Deut",
252
- "Dt",
253
- "Josh",
254
- "Jos",
255
- "Jsh",
256
- "Judg",
257
- "Jdg",
258
- "Jg",
259
- "Jdgs",
260
- "Rth",
261
- "Ru",
262
- "Sam",
263
- "Samuel",
264
- "Kings",
265
- "Kgs",
266
- "Kin",
267
- "Chron",
268
- "Chronicles",
269
- "Ezra",
270
- "Ezr",
271
- "Ez",
272
- "Neh",
273
- "Ne",
274
- "Esth",
275
- "Es",
276
- "Job",
277
- "Job",
278
- "Jb",
279
- "Pslm",
280
- "Ps",
281
- "Psalms",
282
- "Psa",
283
- "Psm",
284
- "Pss",
285
- "Prov",
286
- "Pr",
287
- "Prv",
288
- "Eccles",
289
- "Ec",
290
- "Song",
291
- "So",
292
- "Canticles",
293
- "Song of Songs",
294
- "SOS",
295
- "Isa",
296
- "Is",
297
- "Jer",
298
- "Je",
299
- "Jr",
300
- "Lam",
301
- "La",
302
- "Ezek",
303
- "Eze",
304
- "Ezk",
305
- "Dan",
306
- "Da",
307
- "Dn",
308
- "Hos",
309
- "Ho",
310
- "Joel",
311
- "Joe",
312
- "Jl",
313
- "Amos",
314
- "Am",
315
- "Obad",
316
- "Ob",
317
- "Jnh",
318
- "Jon",
319
- "Micah",
320
- "Mic",
321
- "Nah",
322
- "Na",
323
- "Hab",
324
- "Zeph",
325
- "Zep",
326
- "Zp",
327
- "Haggai",
328
- "Hag",
329
- "Hg",
330
- "Zech",
331
- "Zec",
332
- "Zc",
333
- "Mal",
334
- "Mal",
335
- "Ml",
336
- "Matt",
337
- "Mt",
338
- "Mrk",
339
- "Mk",
340
- "Mr",
341
- "Luk",
342
- "Lk",
343
- "John",
344
- "Jn",
345
- "Jhn",
346
- "Acts",
347
- "Ac",
348
- "Rom",
349
- "Ro",
350
- "Rm",
351
- "Co",
352
- "Cor",
353
- "Corinthians",
354
- "Gal",
355
- "Ga",
356
- "Ephes",
357
- "Eph",
358
- "Phil",
359
- "Php",
360
- "Col",
361
- "Col",
362
- "Th",
363
- "Thes",
364
- "Thess",
365
- "Thessalonians",
366
- "Ti",
367
- "Tim",
368
- "Timothy",
369
- "Titus",
370
- "Tit",
371
- "Philem",
372
- "Phm",
373
- "Hebrews",
374
- "Heb",
375
- "He",
376
- "James",
377
- "Jas",
378
- "Jm",
379
- "Pe",
380
- "Pet",
381
- "Pt",
382
- "Peter",
383
- "Jn",
384
- "Jo",
385
- "Joh",
386
- "Jhn",
387
- "John",
388
- "Jude",
389
- "Jd",
390
- "Jud",
391
- "Jud",
392
- "Rev",
393
- "The Revelation",
394
- "Genesis",
395
- "Exodus",
396
- "Leviticus",
397
- "Numbers",
398
- "Deuteronomy",
399
- "Joshua",
400
- "Judges",
401
- "Ruth",
402
- "Samuel",
403
- "Kings",
404
- "Chronicles",
405
- "Ezra",
406
- "Nehemiah",
407
- "Esther",
408
- "Job",
409
- "Psalms",
410
- "Psalm",
411
- "Proverbs",
412
- "Ecclesiastes",
413
- "Song of Solomon",
414
- "Isaiah",
415
- "Jeremiah",
416
- "Lamentations",
417
- "Ezekiel",
418
- "Daniel",
419
- "Hosea",
420
- "Joel",
421
- "Amos",
422
- "Obadiah",
423
- "Jonah",
424
- "Micah",
425
- "Nahum",
426
- "Habakkuk",
427
- "Zephaniah",
428
- "Haggai",
429
- "Zechariah",
430
- "Malachi",
431
- "Matthew",
432
- "Mark",
433
- "Luke",
434
- "John",
435
- "Acts",
436
- "Romans",
437
- "Corinthians",
438
- "Galatians",
439
- "Ephesians",
440
- "Philippians",
441
- "Colossians",
442
- "Thessalonians",
443
- "Timothy",
444
- "Titus",
445
- "Philemon",
446
- "Hebrews",
447
- "James",
448
- "Peter",
449
- "John",
450
- "Revelation",
451
- "Re",
452
- "Ap",
453
- "Jd.",
454
- "Heb.",
455
- ]
456
-
457
- const preStrings = ["III", "II", "I", "1st", "2nd", "3rd", "First", "Second", "Third", "1", "2", "3"]
458
- const preStringed = [
459
- "Sam",
460
- "Samuel",
461
- "Kings",
462
- "Kgs",
463
- "Kin",
464
- "Chron",
465
- "Chronicles",
466
- "Corinthians",
467
- "Co",
468
- "Cor",
469
- "Thessalonians",
470
- "Th",
471
- "Thes",
472
- "Thess",
473
- "Timothy",
474
- "Ti",
475
- "Tim",
476
- "Peter",
477
- "Pe",
478
- "Pet",
479
- "Pt",
480
- "John",
481
- "Jn",
482
- "Jhn",
483
- ]
484
- let newText = ""
485
-
486
- //add the prestringed versions e.g. 1 Peter
487
- for (let b = 0; b < preStringed.length; b++) {
488
- for (let pre = 0; pre < preStrings.length; pre++) {
489
- books.push(preStrings[pre] + " " + preStringed[b])
490
- }
491
- }
492
- // add the book name with . at the end as this seems to be added sometimes, at least to the shortened forms
493
- const length = books.length
494
- for (let b = 0; b < length; b++) {
495
- books.push(books[b] + ".")
496
- }
497
-
498
- // sort descending - longer items first
499
- books.sort((a, b) => b.length - a.length)
500
- let booksAt = []
501
- // go thro' each book finding where it matches in text
502
- for (let b = 0; b < books.length; b++) {
503
- const book = books[b]
504
- let chNoInText = 0
505
- while (chNoInText < text.length) {
506
- let j = text.indexOf(book, chNoInText)
507
- if (j < 0) break
508
- if (j + book.length < text.length && !text.charAt(j + book.length).match(/^[a-z]+$/)) {
509
- booksAt.push([book, j])
510
- let replacement = book
511
- for (let k = 0; k < book.length; k++) {
512
- replacement = replacement.replace(book.charAt(k), "X")
513
- }
514
- text = text.replace(book, replacement) // to prevent a shorter version matching
515
- }
516
- chNoInText = j + book.length + 1
517
- }
518
- }
519
- // into ascending order of start position
520
- booksAt.sort(function (a, b) {
521
- return a[1] - b[1]
522
- })
523
- newText = ""
524
- let chNoInText = 0
525
- for (let b = 0; b < booksAt.length; b++) {
526
- while (chNoInText < booksAt[b][1]) {
527
- //copy across characters to start of book
528
- newText += text.charAt(chNoInText)
529
- chNoInText++
530
- }
531
- newText += "<span class='passage'>" + booksAt[b][0]
532
- let passage = booksAt[b][0]
533
- chNoInText += booksAt[b][0].length //skip the 'fill-in characters
534
- for (let i = 0; i < 100; i++) {
535
- chNoInText++
536
- const nextCh = text.charAt(chNoInText)
537
- //test whether are at the end of the chapter(s) and verse(s)
538
- if (nextCh.match(/^[a-z]+$/) && nextCh !== "f" && nextCh !== "ff") break
539
- if (nextCh.match(/^[A-Z]+$/)) break
540
- newText += text.charAt(chNoInText - 1)
541
- passage += text.charAt(chNoInText - 1)
542
- }
543
- this.found.push(passage.trim())
544
- newText += "</span>&nbsp;"
545
- }
546
- console.log(newText)
547
- return this
548
- }
549
-
550
- enhance() {
551
- if (this.found.length > 0) {
552
- for (let i = 0; i < this.found.length; i++) {
553
- const passage = {
554
- original: this.found[i],
555
- book: this.bookify(this.found[i].match(this.bookRegex)[0]),
556
- chapter: this.found[i].match(this.chapterRegex),
557
- verse: this.found[i].match(this.verseRegex)[0],
558
- }
559
- this.passages.push(passage)
560
- }
309
+ const hash = full.toLowerCase().replace(/ /g, "_").replace(/:/g, ".").replace(/-/g, ".").replace(/,/g, ".")
310
+ return {
311
+ passage: full,
312
+ cv: chapter + colon + verses,
313
+ hash,
561
314
  }
562
- return this.passages
563
- }
564
-
565
- regex(text) {
566
- this.found = text.match(this.scripturesRegex)
567
- return this
568
- }
569
-
570
- regexParser() {
571
- this.passages = []
572
- for (let i = 0; i < this.found.length; i++) {
573
- let verse, chapter
574
- const hasChapterRange = this.found[i].match(/(?<=-\s?)\b\d+[.:].+\b/)
575
- const book = this.found[i].match(this.bookRegex)
576
- if (book === null) continue
577
- chapter = this.found[i].replace(book[0], "").match(this.chapterRegex)
578
-
579
- if (Array.isArray(chapter)) {
580
- chapter = chapter[0]
581
- }
582
- if (
583
- this.bookify(book).toLowerCase() === "jude" ||
584
- this.bookify(book).toLowerCase() === "philemon" ||
585
- this.bookify(book).toLowerCase() === "obadiah" ||
586
- this.bookify(book).toLowerCase() === "2 john" ||
587
- this.bookify(book).toLowerCase() === "3 john"
588
- ) {
589
- verse = this.found[i].split(" ")[1]
590
- chapter = "1"
591
- } else {
592
- if (this.found[i].match(this.verseRegex) && !hasChapterRange)
593
- verse = this.found[i].match(this.verseRegex)[0].replace(/[:.]/, "").trim()
594
- else if (this.found[i].match(this.verseRegex) && hasChapterRange)
595
- verse = this.found[i].match(this.verseRegex)
596
- ? this.found[i].match(this.verseRegex)[0].split("-")[0].trim()
597
- : ["Empty"]
598
- }
599
- if (!verse && this.found[i].match(/\d+/)) {
600
- chapter = this.found[i].match(/\d+/)[0]
601
- }
602
-
603
- const passage = {
604
- original: this.found[i].replace(/([.,])\1*$/, "").trim(),
605
- book: this.bookify(book),
606
- chapter: chapter,
607
- verses: verse ?? [],
608
- }
609
-
610
- if (hasChapterRange) {
611
- passage.to = {
612
- book: passage.book,
613
- chapter: hasChapterRange[0].match(this.chapterRegex)[0],
614
- verses: hasChapterRange[0].match(this.verseRegex)[0],
615
- }
616
- passage.to.verses = passage.to.verses.split(/,/).filter(Boolean)
617
- passage.to.testament = this.bible.old.includes(passage.to.book) ? "old" : "new"
618
- }
619
- passage.verses =
620
- typeof passage.verses !== "object"
621
- ? passage.verses.split(/,/).filter(Boolean)
622
- : passage.verses.filter((item) => item.trim())
623
- passage.testament = this.bible.old.includes(passage.book) ? "old" : "new"
624
- passage.scripture = this.scripturize(passage)
625
- this.passages.push(passage)
626
- }
627
-
628
- this.found = this.passages.map((passage) => passage.scripture)
629
- return this
630
315
  }
631
316
  }
632
317
 
@@ -0,0 +1,16 @@
1
+ const util = require("util")
2
+ const dump = (item) => {
3
+ console.log(util.inspect(item, { depth: null, colors: true }))
4
+ }
5
+
6
+ function dd(message) {
7
+ dump(message)
8
+ // Optionally, you can also force the script to stop execution
9
+ // by throwing an error
10
+ process.exit(1)
11
+ }
12
+
13
+ module.exports = {
14
+ dump,
15
+ dd,
16
+ }
@@ -0,0 +1,623 @@
1
+ const versified = {
2
+ Genesis: {
3
+ "31:55": {
4
+ lxx: "32:1",
5
+ mt: "31:55",
6
+ eng: "31:55",
7
+ },
8
+ "31:48": {
9
+ lxx: "31:47-48",
10
+ mt: "31:48",
11
+ eng: "31:48",
12
+ },
13
+ "31:52": {
14
+ lxx: "31:48",
15
+ mt: "31:52",
16
+ eng: "31:52",
17
+ },
18
+ "32:1": {
19
+ lxx: "32:2",
20
+ mt: "32:1",
21
+ eng: "32:1",
22
+ },
23
+ "32:2": {
24
+ lxx: "32:3",
25
+ mt: "32:2",
26
+ eng: "32:2",
27
+ },
28
+ "32:3": {
29
+ lxx: "32:4",
30
+ mt: "32:3",
31
+ eng: "32:3",
32
+ },
33
+ "32:4": {
34
+ lxx: "32:5",
35
+ mt: "32:4",
36
+ eng: "32:4",
37
+ },
38
+ "32:5": {
39
+ lxx: "32:6",
40
+ mt: "32:5",
41
+ eng: "32:5",
42
+ },
43
+ "32:6": {
44
+ lxx: "32:7",
45
+ mt: "32:6",
46
+ eng: "32:6",
47
+ },
48
+ "32:7": {
49
+ lxx: "32:8",
50
+ mt: "32:7",
51
+ eng: "32:7",
52
+ },
53
+ "32:8": {
54
+ lxx: "32:9",
55
+ mt: "32:8",
56
+ eng: "32:8",
57
+ },
58
+ "32:9": {
59
+ lxx: "32:10",
60
+ mt: "32:9",
61
+ eng: "32:9",
62
+ },
63
+ "32:10": {
64
+ lxx: "32:11",
65
+ mt: "32:10",
66
+ eng: "32:10",
67
+ },
68
+ "32:11": {
69
+ lxx: "32:12",
70
+ mt: "32:11",
71
+ eng: "32:11",
72
+ },
73
+ "32:12": {
74
+ lxx: "32:13",
75
+ mt: "32:12",
76
+ eng: "32:12",
77
+ },
78
+ "32:13": {
79
+ lxx: "32:14",
80
+ mt: "32:13",
81
+ eng: "32:13",
82
+ },
83
+ "32:14": {
84
+ lxx: "32:15",
85
+ mt: "32:14",
86
+ eng: "32:14",
87
+ },
88
+ "32:15": {
89
+ lxx: "32:16",
90
+ mt: "32:15",
91
+ eng: "32:15",
92
+ },
93
+ "32:16": {
94
+ lxx: "32:17",
95
+ mt: "32:16",
96
+ eng: "32:16",
97
+ },
98
+ "32:17": {
99
+ lxx: "32:18",
100
+ mt: "32:17",
101
+ eng: "32:17",
102
+ },
103
+ "32:18": {
104
+ lxx: "32:19",
105
+ mt: "32:18",
106
+ eng: "32:18",
107
+ },
108
+ "32:19": {
109
+ lxx: "32:20",
110
+ mt: "32:19",
111
+ eng: "32:19",
112
+ },
113
+ "32:20": {
114
+ lxx: "32:21",
115
+ mt: "32:20",
116
+ eng: "32:20",
117
+ },
118
+ "32:21": {
119
+ lxx: "32:22",
120
+ mt: "32:21",
121
+ eng: "32:21",
122
+ },
123
+ "32:22": {
124
+ lxx: "32:23",
125
+ mt: "32:22",
126
+ eng: "32:22",
127
+ },
128
+ "32:23": {
129
+ lxx: "32:24",
130
+ mt: "32:23",
131
+ eng: "32:23",
132
+ },
133
+ "32:24": {
134
+ lxx: "32:25",
135
+ mt: "32:24",
136
+ eng: "32:24",
137
+ },
138
+ "32:25": {
139
+ lxx: "32:26",
140
+ mt: "32:25",
141
+ eng: "32:25",
142
+ },
143
+ "32:26": {
144
+ lxx: "32:27",
145
+ mt: "32:26",
146
+ eng: "32:26",
147
+ },
148
+ "32:27": {
149
+ lxx: "32:28",
150
+ mt: "32:27",
151
+ eng: "32:27",
152
+ },
153
+ "32:28": {
154
+ lxx: "32:29",
155
+ mt: "32:28",
156
+ eng: "32:28",
157
+ },
158
+ "32:29": {
159
+ lxx: "32:30",
160
+ mt: "32:29",
161
+ eng: "32:29",
162
+ },
163
+ "32:30": {
164
+ lxx: "32:31",
165
+ mt: "32:30",
166
+ eng: "32:30",
167
+ },
168
+ "32:31": {
169
+ lxx: "32:32",
170
+ mt: "32:31",
171
+ eng: "32:31",
172
+ },
173
+ "32:32": {
174
+ lxx: "32:33",
175
+ mt: "32:32",
176
+ eng: "32:32",
177
+ },
178
+ "35:16": {
179
+ lxx: "35:16",
180
+ mt: "35:16",
181
+ eng: "35:16",
182
+ },
183
+ "35:21": {
184
+ lxx: "35:16",
185
+ mt: "35:21",
186
+ eng: "35:21",
187
+ },
188
+ "35:22": {
189
+ lxx: "35:21",
190
+ mt: "35:22",
191
+ eng: "35:22",
192
+ },
193
+ },
194
+ Exodus: {
195
+ "8:1": {
196
+ lxx: "8:1",
197
+ mt: "7:26",
198
+ eng: "8:1",
199
+ },
200
+ "8:2": {
201
+ lxx: "8:2",
202
+ mt: "7:27",
203
+ eng: "8:2",
204
+ },
205
+ "8:3": {
206
+ lxx: "8:3",
207
+ mt: "7:28",
208
+ eng: "8:3",
209
+ },
210
+ "8:4": {
211
+ lxx: "8:4",
212
+ mt: "7:29",
213
+ eng: "8:4",
214
+ },
215
+ "8:5": {
216
+ lxx: "8:5",
217
+ mt: "8:1",
218
+ eng: "8:5",
219
+ },
220
+ "8:6": {
221
+ lxx: "8:6",
222
+ mt: "8:2",
223
+ eng: "8:6",
224
+ },
225
+ "8:7": {
226
+ lxx: "8:7",
227
+ mt: "8:3",
228
+ eng: "8:7",
229
+ },
230
+ "8:8": {
231
+ lxx: "8:8",
232
+ mt: "8:4",
233
+ eng: "8:8",
234
+ },
235
+ "8:9": {
236
+ lxx: "8:9",
237
+ mt: "8:5",
238
+ eng: "8:9",
239
+ },
240
+ "8:10": {
241
+ lxx: "8:10",
242
+ mt: "8:6",
243
+ eng: "8:10",
244
+ },
245
+ "8:11": {
246
+ lxx: "8:11",
247
+ mt: "8:7",
248
+ eng: "8:11",
249
+ },
250
+ "8:12": {
251
+ lxx: "8:12",
252
+ mt: "8:8",
253
+ eng: "8:12",
254
+ },
255
+ "8:13": {
256
+ lxx: "8:13",
257
+ mt: "8:9",
258
+ eng: "8:13",
259
+ },
260
+ "8:14": {
261
+ lxx: "8:14",
262
+ mt: "8:10",
263
+ eng: "8:14",
264
+ },
265
+ "8:15": {
266
+ lxx: "8:15",
267
+ mt: "8:11",
268
+ eng: "8:15",
269
+ },
270
+ "8:16": {
271
+ lxx: "8:16",
272
+ mt: "8:12",
273
+ eng: "8:16",
274
+ },
275
+ "8:17": {
276
+ lxx: "8:17",
277
+ mt: "8:13",
278
+ eng: "8:17",
279
+ },
280
+ "8:18": {
281
+ lxx: "8:18",
282
+ mt: "8:14",
283
+ eng: "8:18",
284
+ },
285
+ "8:19": {
286
+ lxx: "8:19",
287
+ mt: "8:15",
288
+ eng: "8:19",
289
+ },
290
+ "8:20": {
291
+ lxx: "8:20",
292
+ mt: "8:16",
293
+ eng: "8:20",
294
+ },
295
+ "8:21": {
296
+ lxx: "8:21",
297
+ mt: "8:17",
298
+ eng: "8:21",
299
+ },
300
+ "8:22": {
301
+ lxx: "8:22",
302
+ mt: "8:18",
303
+ eng: "8:22",
304
+ },
305
+ "8:23": {
306
+ lxx: "8:23",
307
+ mt: "8:19",
308
+ eng: "8:23",
309
+ },
310
+ "8:24": {
311
+ lxx: "8:24",
312
+ mt: "8:20",
313
+ eng: "8:24",
314
+ },
315
+ "8:25": {
316
+ lxx: "8:25",
317
+ mt: "8:21",
318
+ eng: "8:25",
319
+ },
320
+ "8:26": {
321
+ lxx: "8:26",
322
+ mt: "8:22",
323
+ eng: "8:26",
324
+ },
325
+ "8:27": {
326
+ lxx: "8:27",
327
+ mt: "8:23",
328
+ eng: "8:27",
329
+ },
330
+ "8:28": {
331
+ lxx: "8:28",
332
+ mt: "8:24",
333
+ eng: "8:28",
334
+ },
335
+ "8:29": {
336
+ lxx: "8:29",
337
+ mt: "8:25",
338
+ eng: "8:29",
339
+ },
340
+ "8:30": {
341
+ lxx: "8:30",
342
+ mt: "8:26",
343
+ eng: "8:30",
344
+ },
345
+ "8:31": {
346
+ lxx: "8:31",
347
+ mt: "8:27",
348
+ eng: "8:31",
349
+ },
350
+ "8:32": {
351
+ lxx: "8:32",
352
+ mt: "8:28",
353
+ eng: "8:32",
354
+ },
355
+ "20:13": {
356
+ lxx: "20:13",
357
+ mt: "20:14",
358
+ eng: "20:13",
359
+ },
360
+ "20:14": {
361
+ lxx: "20:14",
362
+ mt: "20:15",
363
+ eng: "20:14",
364
+ },
365
+ "20:15": {
366
+ lxx: "20:15",
367
+ mt: "20:13",
368
+ eng: "20:15",
369
+ },
370
+ "22:1": {
371
+ lxx: "22:1",
372
+ mt: "21:37",
373
+ eng: "22:1",
374
+ },
375
+ "22:2": {
376
+ lxx: "22:2",
377
+ mt: "22:1",
378
+ eng: "22:2",
379
+ },
380
+ "22:3": {
381
+ lxx: "22:3",
382
+ mt: "22:2",
383
+ eng: "22:3",
384
+ },
385
+ "22:4": {
386
+ lxx: "22:4",
387
+ mt: "22:3",
388
+ eng: "22:4",
389
+ },
390
+ "22:5": {
391
+ lxx: "22:5",
392
+ mt: "22:4",
393
+ eng: "22:5",
394
+ },
395
+ "22:6": {
396
+ lxx: "22:6",
397
+ mt: "22:5",
398
+ eng: "22:6",
399
+ },
400
+ "22:7": {
401
+ lxx: "22:7",
402
+ mt: "22:6",
403
+ eng: "22:7",
404
+ },
405
+ "22:8": {
406
+ lxx: "22:8",
407
+ mt: "22:7",
408
+ eng: "22:8",
409
+ },
410
+ "22:9": {
411
+ lxx: "22:9",
412
+ mt: "22:8",
413
+ eng: "22:9",
414
+ },
415
+ "22:10": {
416
+ lxx: "22:10",
417
+ mt: "22:9",
418
+ eng: "22:10",
419
+ },
420
+ "22:11": {
421
+ lxx: "22:11",
422
+ mt: "22:10",
423
+ eng: "22:11",
424
+ },
425
+ "22:12": {
426
+ lxx: "22:12",
427
+ mt: "22:11",
428
+ eng: "22:12",
429
+ },
430
+ "22:13": {
431
+ lxx: "22:13",
432
+ mt: "22:12",
433
+ eng: "22:13",
434
+ },
435
+ "22:14": {
436
+ lxx: "22:14",
437
+ mt: "22:13",
438
+ eng: "22:14",
439
+ },
440
+ "22:15": {
441
+ lxx: "22:15",
442
+ mt: "22:14",
443
+ eng: "22:15",
444
+ },
445
+ "22:16": {
446
+ lxx: "22:16",
447
+ mt: "22:15",
448
+ eng: "22:16",
449
+ },
450
+ "22:17": {
451
+ lxx: "22:17",
452
+ mt: "22:16",
453
+ eng: "22:17",
454
+ },
455
+ "22:18": {
456
+ lxx: "22:18",
457
+ mt: "22:17",
458
+ eng: "22:18",
459
+ },
460
+ "22:19": {
461
+ lxx: "22:19",
462
+ mt: "22:18",
463
+ eng: "22:19",
464
+ },
465
+ "22:20": {
466
+ lxx: "22:20",
467
+ mt: "22:19",
468
+ eng: "22:20",
469
+ },
470
+ "22:21": {
471
+ lxx: "22:21",
472
+ mt: "22:20",
473
+ eng: "22:21",
474
+ },
475
+ "22:22": {
476
+ lxx: "22:22",
477
+ mt: "22:21",
478
+ eng: "22:22",
479
+ },
480
+ "22:23": {
481
+ lxx: "22:23",
482
+ mt: "22:22",
483
+ eng: "22:23",
484
+ },
485
+ "22:24": {
486
+ lxx: "22:24",
487
+ mt: "22:23",
488
+ eng: "22:24",
489
+ },
490
+ "22:25": {
491
+ lxx: "22:25",
492
+ mt: "22:24",
493
+ eng: "22:25",
494
+ },
495
+ "22:26": {
496
+ lxx: "22:26",
497
+ mt: "22:25",
498
+ eng: "22:26",
499
+ },
500
+ "22:27": {
501
+ lxx: "22:27",
502
+ mt: "22:26",
503
+ eng: "22:27",
504
+ },
505
+ "22:28": {
506
+ lxx: "22:28",
507
+ mt: "22:27",
508
+ eng: "22:28",
509
+ },
510
+ "22:29": {
511
+ lxx: "22:29",
512
+ mt: "22:28",
513
+ eng: "22:29",
514
+ },
515
+ "22:30": {
516
+ lxx: "22:30",
517
+ mt: "22:29",
518
+ eng: "22:30",
519
+ },
520
+ "22:31": {
521
+ lxx: "22:31",
522
+ mt: "22:30",
523
+ eng: "22:31",
524
+ },
525
+ "35:9": {
526
+ lxx: "35:8",
527
+ mt: "35:9",
528
+ eng: "35:9",
529
+ },
530
+ "35:10": {
531
+ lxx: "35:9",
532
+ mt: "35:10",
533
+ eng: "35:10",
534
+ },
535
+ "35:11": {
536
+ lxx: "35:10",
537
+ mt: "35:11",
538
+ eng: "35:11",
539
+ },
540
+ "35:12": {
541
+ lxx: "35:11",
542
+ mt: "35:12",
543
+ eng: "35:12",
544
+ },
545
+ "35:17": {
546
+ lxx: "35:12",
547
+ mt: "35:17",
548
+ eng: "35:17",
549
+ },
550
+ "35:13": {
551
+ lxx: "35:15",
552
+ mt: "35:13",
553
+ eng: "35:13",
554
+ },
555
+ "35:14": {
556
+ lxx: "35:16",
557
+ mt: "35:14",
558
+ eng: "35:14",
559
+ },
560
+ "35:16": {
561
+ lxx: "35:17",
562
+ mt: "35:16",
563
+ eng: "35:16",
564
+ },
565
+ "35:19": {
566
+ lxx: "35:18",
567
+ mt: "35:19",
568
+ eng: "35:19",
569
+ },
570
+ "35:15": {
571
+ lxx: "35:19",
572
+ mt: "35:15",
573
+ eng: "35:15",
574
+ },
575
+ "36:8": {
576
+ lxx: "37:1",
577
+ mt: "36:8",
578
+ eng: "36:8",
579
+ },
580
+ "36:9": {
581
+ lxx: "37:2",
582
+ mt: "36:9",
583
+ eng: "36:9",
584
+ },
585
+ "36:35": {
586
+ lxx: "37:3",
587
+ mt: "36:35",
588
+ eng: "36:35",
589
+ },
590
+ "36:36": {
591
+ lxx: "37:4",
592
+ mt: "36:36",
593
+ eng: "36:36",
594
+ },
595
+ "36:37": {
596
+ lxx: "37:5",
597
+ mt: "36:37",
598
+ eng: "36:37",
599
+ },
600
+ "36:38": {
601
+ lxx: "37:6",
602
+ mt: "36:38",
603
+ eng: "36:38",
604
+ },
605
+ },
606
+ Psalms: {
607
+ "23:1": {
608
+ lxx: "22:1",
609
+ mt: "23:1",
610
+ eng: "23:1",
611
+ },
612
+ },
613
+ "1 Samuel": {
614
+ "20:42": {
615
+ lxx: "20:41",
616
+ mt: "20:42",
617
+ eng: "20:42",
618
+ },
619
+ },
620
+ // Add more books and verses as needed
621
+ }
622
+
623
+ module.exports = versified
@@ -12,5 +12,5 @@ parser.options({
12
12
  single_chapter_1_strategy: "verse",
13
13
  sequence_combination_strategy: "combine",
14
14
  })
15
- const result = parser.parse("John 3:1-3")
15
+ const result = parser.parse("Jude 5-7,11 Numbers 14:29-30 Genesis 19:24-25 Genesis 4:3-8 Numbers 31:16 Numbers 16:1-50")
16
16
  dump(result.getPassages())
@@ -0,0 +1,8 @@
1
+ const BibleParser = require("../src/CodexParser.js")
2
+ const dump = require("../src/functions.js").dump
3
+ const parser = new BibleParser()
4
+ const text = "Job 1:1b"
5
+
6
+ const passages = parser.find(text).enhance()
7
+
8
+ dump(passages)
@@ -4,7 +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
- const text = "Psalm 95:6 MT"
7
+ const text = "John 12:38 John 1:29,34 Isaiah 53:1 Isaiah 6:10 Isaiah 6:1 Isaiah 52:13 Isaiah 6:3 LXX Isaiah 52:13 LXX Isaiah 6:7 Isaiah 53:12 Isaiah 52:13 - 53:12"
8
8
 
9
9
  const parser = new bcv_parser({
10
10
  invalid_sequence_strategy: "include",
package/tests/find.js CHANGED
@@ -2,6 +2,7 @@ const CodexParser = require("../src/CodexParser.js")
2
2
 
3
3
  const parser = new CodexParser()
4
4
 
5
- parser.find('1 John 2-3').enhance()
5
+ parser.find('Psalm 2:2-13; 3:2-4 30:5 LXX').enhance()
6
6
 
7
- console.log(parser.getPassages())
7
+ console.log(parser.getPassages())
8
+ console.log(parser.getText())
@@ -0,0 +1,10 @@
1
+ const BibleParser = require("../src/CodexParser.js")
2
+ const dump = require("../src/functions.js").dump
3
+
4
+ const parser = new BibleParser()
5
+
6
+ const text = "Genesis 22:1-2,14,19"
7
+
8
+ const passages = parser.parse(text).getPassages()
9
+
10
+ dump(passages)
@@ -0,0 +1,8 @@
1
+ const BibleParser = require("../src/CodexParser")
2
+ const dump = require("../src/functions").dump
3
+
4
+ const parser = new BibleParser()
5
+
6
+ const passages = parser.parse("Exodus 8:1").getPassages()
7
+
8
+ dump(passages)
File without changes