bible-ref-parse 3.1.1 → 3.1.3
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/dist/de-bcv-parser.js +290 -520
- package/dist/de-bcv-parser.min.js +1 -1
- package/dist/test/zh.spec.js +8 -0
- package/dist/zh-bcv-parser.js +1 -102
- package/dist/zh-bcv-parser.min.js +1 -1
- package/package.json +1 -1
package/dist/test/zh.spec.js
CHANGED
|
@@ -2590,6 +2590,7 @@
|
|
|
2590
2590
|
expect(p.parse("约翰壹书》 1:1").osis()).toEqual("1John.1.1", "parsing: '约翰壹书》 1:1'");
|
|
2591
2591
|
expect(p.parse("若望一書》 1:1").osis()).toEqual("1John.1.1", "parsing: '若望一書》 1:1'");
|
|
2592
2592
|
expect(p.parse("《約壹》 1:1").osis()).toEqual("1John.1.1", "parsing: '《約壹》 1:1'");
|
|
2593
|
+
expect(p.parse("《约一》 1:1").osis()).toEqual("1John.1.1", "parsing: '《约一》 1:1'");
|
|
2593
2594
|
expect(p.parse("《约壹》 1:1").osis()).toEqual("1John.1.1", "parsing: '《约壹》 1:1'");
|
|
2594
2595
|
expect(p.parse("伊望第一 1:1").osis()).toEqual("1John.1.1", "parsing: '伊望第一 1:1'");
|
|
2595
2596
|
expect(p.parse("約翰一書 1:1").osis()).toEqual("1John.1.1", "parsing: '約翰一書 1:1'");
|
|
@@ -2598,10 +2599,13 @@
|
|
|
2598
2599
|
expect(p.parse("约翰壹书 1:1").osis()).toEqual("1John.1.1", "parsing: '约翰壹书 1:1'");
|
|
2599
2600
|
expect(p.parse("若望一書 1:1").osis()).toEqual("1John.1.1", "parsing: '若望一書 1:1'");
|
|
2600
2601
|
expect(p.parse("《約壹 1:1").osis()).toEqual("1John.1.1", "parsing: '《約壹 1:1'");
|
|
2602
|
+
expect(p.parse("《约一 1:1").osis()).toEqual("1John.1.1", "parsing: '《约一 1:1'");
|
|
2601
2603
|
expect(p.parse("《约壹 1:1").osis()).toEqual("1John.1.1", "parsing: '《约壹 1:1'");
|
|
2602
2604
|
expect(p.parse("約壹》 1:1").osis()).toEqual("1John.1.1", "parsing: '約壹》 1:1'");
|
|
2605
|
+
expect(p.parse("约一》 1:1").osis()).toEqual("1John.1.1", "parsing: '约一》 1:1'");
|
|
2603
2606
|
expect(p.parse("约壹》 1:1").osis()).toEqual("1John.1.1", "parsing: '约壹》 1:1'");
|
|
2604
2607
|
expect(p.parse("約壹 1:1").osis()).toEqual("1John.1.1", "parsing: '約壹 1:1'");
|
|
2608
|
+
expect(p.parse("约一 1:1").osis()).toEqual("1John.1.1", "parsing: '约一 1:1'");
|
|
2605
2609
|
expect(p.parse("约壹 1:1").osis()).toEqual("1John.1.1", "parsing: '约壹 1:1'");
|
|
2606
2610
|
p.include_apocrypha(false);
|
|
2607
2611
|
expect(p.parse("《伊望第一》 1:1").osis()).toEqual("1John.1.1", "parsing: '《伊望第一》 1:1'");
|
|
@@ -2624,6 +2628,7 @@
|
|
|
2624
2628
|
expect(p.parse("约翰壹书》 1:1").osis()).toEqual("1John.1.1", "parsing: '约翰壹书》 1:1'");
|
|
2625
2629
|
expect(p.parse("若望一書》 1:1").osis()).toEqual("1John.1.1", "parsing: '若望一書》 1:1'");
|
|
2626
2630
|
expect(p.parse("《約壹》 1:1").osis()).toEqual("1John.1.1", "parsing: '《約壹》 1:1'");
|
|
2631
|
+
expect(p.parse("《约一》 1:1").osis()).toEqual("1John.1.1", "parsing: '《约一》 1:1'");
|
|
2627
2632
|
expect(p.parse("《约壹》 1:1").osis()).toEqual("1John.1.1", "parsing: '《约壹》 1:1'");
|
|
2628
2633
|
expect(p.parse("伊望第一 1:1").osis()).toEqual("1John.1.1", "parsing: '伊望第一 1:1'");
|
|
2629
2634
|
expect(p.parse("約翰一書 1:1").osis()).toEqual("1John.1.1", "parsing: '約翰一書 1:1'");
|
|
@@ -2632,10 +2637,13 @@
|
|
|
2632
2637
|
expect(p.parse("约翰壹书 1:1").osis()).toEqual("1John.1.1", "parsing: '约翰壹书 1:1'");
|
|
2633
2638
|
expect(p.parse("若望一書 1:1").osis()).toEqual("1John.1.1", "parsing: '若望一書 1:1'");
|
|
2634
2639
|
expect(p.parse("《約壹 1:1").osis()).toEqual("1John.1.1", "parsing: '《約壹 1:1'");
|
|
2640
|
+
expect(p.parse("《约一 1:1").osis()).toEqual("1John.1.1", "parsing: '《约一 1:1'");
|
|
2635
2641
|
expect(p.parse("《约壹 1:1").osis()).toEqual("1John.1.1", "parsing: '《约壹 1:1'");
|
|
2636
2642
|
expect(p.parse("約壹》 1:1").osis()).toEqual("1John.1.1", "parsing: '約壹》 1:1'");
|
|
2643
|
+
expect(p.parse("约一》 1:1").osis()).toEqual("1John.1.1", "parsing: '约一》 1:1'");
|
|
2637
2644
|
expect(p.parse("约壹》 1:1").osis()).toEqual("1John.1.1", "parsing: '约壹》 1:1'");
|
|
2638
2645
|
expect(p.parse("約壹 1:1").osis()).toEqual("1John.1.1", "parsing: '約壹 1:1'");
|
|
2646
|
+
expect(p.parse("约一 1:1").osis()).toEqual("1John.1.1", "parsing: '约一 1:1'");
|
|
2639
2647
|
expect(p.parse("约壹 1:1").osis()).toEqual("1John.1.1", "parsing: '约壹 1:1'");
|
|
2640
2648
|
});
|
|
2641
2649
|
});
|
package/dist/zh-bcv-parser.js
CHANGED
|
@@ -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;
|
|
@@ -3424,7 +3323,7 @@
|
|
|
3424
3323
|
},
|
|
3425
3324
|
{
|
|
3426
3325
|
osis: ["1John"],
|
|
3427
|
-
regexp: /(^|[^0-9\\x1f])((?:《(?:约(?:翰[一壹]
|
|
3326
|
+
regexp: /(^|[^0-9\\x1f])((?:《(?:约(?:翰[一壹]书|[一壹])|若望一書|約(?:翰[一壹]書|壹)|伊望第一)》|1John)|(?:(?:约(?:翰[一壹]书|[一壹])|若望一書|約(?:翰[一壹]書|壹)|伊望第一)》|《(?:约(?:翰[一壹]书|[一壹])|若望一書|約(?:翰[一壹]書|壹)|伊望第一)|约(?:翰[一壹]书|[一壹])|若望一書|約(?:翰[一壹]書|壹)|伊望第一))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi
|
|
3428
3327
|
},
|
|
3429
3328
|
{
|
|
3430
3329
|
osis: ["2John"],
|