bible-ref-parse 3.1.5 → 3.1.7

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.
@@ -1568,107 +1568,6 @@
1568
1568
  return this.range(passage, accum, context);
1569
1569
  }
1570
1570
 
1571
- // Handle verse ranges when in chapter context (e.g., "Sacharja 3, 1-4" = verses 1-4 in chapter 3).
1572
- cv_range(passage, accum, context) {
1573
- var book, book_id, end_v, id, ref, start_v;
1574
- passage.start_context = bcv_utils.shallow_clone(context);
1575
- // We don't need to preserve the original `type` for reparsing.
1576
- passage.type = "range";
1577
- [start_v, end_v] = passage.value;
1578
- // Create a virtual BCV range using the current chapter context
1579
- // We need to use the book ID that matches the context, not the book name
1580
- book_id = null;
1581
- ref = this.books;
1582
- for (id in ref) {
1583
- book = ref[id];
1584
- if (book.parsed.indexOf(context.b) >= 0) {
1585
- book_id = id;
1586
- break;
1587
- }
1588
- }
1589
- passage.value = [
1590
- {
1591
- type: "bcv",
1592
- value: [
1593
- {
1594
- type: "bc",
1595
- value: [
1596
- {
1597
- type: "b",
1598
- value: book_id,
1599
- indices: passage.indices
1600
- },
1601
- {
1602
- type: "c",
1603
- value: [
1604
- {
1605
- type: "integer",
1606
- value: context.c,
1607
- indices: passage.indices
1608
- }
1609
- ],
1610
- indices: passage.indices
1611
- }
1612
- ],
1613
- indices: passage.indices
1614
- },
1615
- start_v
1616
- ],
1617
- indices: passage.indices
1618
- },
1619
- end_v
1620
- ];
1621
- return this.range(passage, accum, context);
1622
- }
1623
-
1624
- // Handle book-chapter followed by verse range (e.g., "Sacharja 3, 1-4" = verses 1-4 in chapter 3).
1625
- bc_cv_range(passage, accum, context) {
1626
- var b, bc, c, cv_range, end_v, start_v;
1627
- passage.start_context = bcv_utils.shallow_clone(context);
1628
- // We don't need to preserve the original `type` for reparsing.
1629
- passage.type = "range";
1630
- [bc, cv_range] = passage.value;
1631
- // Extract the book and chapter from the bc
1632
- b = this.pluck("b", bc.value).value;
1633
- c = this.pluck("c", bc.value).value;
1634
- // Extract the verse range from cv_range
1635
- [start_v, end_v] = cv_range.value;
1636
- // Create a virtual BCV range
1637
- passage.value = [
1638
- {
1639
- type: "bcv",
1640
- value: [
1641
- {
1642
- type: "bc",
1643
- value: [
1644
- {
1645
- type: "b",
1646
- value: b,
1647
- indices: passage.indices
1648
- },
1649
- {
1650
- type: "c",
1651
- value: [
1652
- {
1653
- type: "integer",
1654
- value: c,
1655
- indices: passage.indices
1656
- }
1657
- ],
1658
- indices: passage.indices
1659
- }
1660
- ],
1661
- indices: passage.indices
1662
- },
1663
- start_v
1664
- ],
1665
- indices: passage.indices
1666
- },
1667
- end_v
1668
- ];
1669
- return this.range(passage, accum, context);
1670
- }
1671
-
1672
1571
  // Use an object to establish context for later objects but don't otherwise use it.
1673
1572
  context(passage, accum, context) {
1674
1573
  var key, ref;
@@ -3222,7 +3121,7 @@
3222
3121
  },
3223
3122
  {
3224
3123
  osis: ["Rev"],
3225
- regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Gipadayag|Rev))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3124
+ regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Pinadayag|Gipadayag|Rev))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3226
3125
  "gi")
3227
3126
  },
3228
3127
  {
@@ -3233,7 +3132,7 @@
3233
3132
  },
3234
3133
  {
3235
3134
  osis: ["Deut"],
3236
- regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:D(?:yuteronomyo|eu(?:t(?:eronomio)?)?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3135
+ regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:D(?:yuteronomyo|eu(?:t(?:eronom[ei]o)?)?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3237
3136
  "gi")
3238
3137
  },
3239
3138
  {
@@ -3334,7 +3233,7 @@
3334
3233
  },
3335
3234
  {
3336
3235
  osis: ["Eccl"],
3337
- regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:E(?:klesyastes|ccl)|Magwawali|Kaalam))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3236
+ regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:E(?:ccl(?:esiastes)?|klesyastes)|Magwawali|Kaalam))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3338
3237
  "gi")
3339
3238
  },
3340
3239
  {
@@ -3390,7 +3289,7 @@
3390
3289
  },
3391
3290
  {
3392
3291
  osis: ["Mic"],
3393
- regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Mi(?:queas|ka|k|c)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3292
+ regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:M(?:i(?:(?:qu|k)eas|ka|k|c)|equias)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3394
3293
  "gi")
3395
3294
  },
3396
3295
  {
@@ -3410,7 +3309,7 @@
3410
3309
  },
3411
3310
  {
3412
3311
  osis: ["Hag"],
3413
- regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Hag(?:eo)?|Ageo))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3312
+ regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Hag(?:geo|eo)?|Ageo))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3414
3313
  "gi")
3415
3314
  },
3416
3315
  {
@@ -3457,7 +3356,7 @@
3457
3356
  },
3458
3357
  {
3459
3358
  osis: ["Acts"],
3460
- regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:B(?:uhat[\\s\\xa0]*sa[\\s\\xa0]*mga[\\s\\xa0]*Apostoles|in(?:uhatan)?)|A(?:ng[\\s\\xa0]*Mga[\\s\\xa0]*Binuhatan|cts)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3359
+ regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:B(?:uhat(?:[\\s\\xa0]*sa[\\s\\xa0]*mga[\\s\\xa0]*Apostoles)?|in(?:uhatan)?)|A(?:ng[\\s\\xa0]*Mga[\\s\\xa0]*Binuhatan|cts)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`,
3461
3360
  "gi")
3462
3361
  },
3463
3362
  {