twl-generator 1.3.4 → 1.3.6
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 +2 -2
- package/src/index.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twl-generator",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Generate term-to-article lists from unfoldingWord en_tw archive for Bible books. Works in both Node.js (CLI) and React.js (browser) environments.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -59,4 +59,4 @@
|
|
|
59
59
|
"optional": true
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
}
|
package/src/index.js
CHANGED
|
@@ -512,10 +512,9 @@ function findMatchingArticles(glq, articlesList, termMap, opts = {}) {
|
|
|
512
512
|
const termOrig = tobj.orig;
|
|
513
513
|
if (termOrig) {
|
|
514
514
|
// Match if the term appears:
|
|
515
|
-
// - At word boundary (beginning
|
|
516
|
-
// -
|
|
517
|
-
|
|
518
|
-
const re3 = new RegExp(`(?:^|\\b|[—–-])${escapeRegExp(termOrig)}(?=\\b|$|[—–-])`, '');
|
|
515
|
+
// - At word boundary (beginning of word or after dash)
|
|
516
|
+
// - Allow substring matching (e.g., "reap" matches "reapers")
|
|
517
|
+
const re3 = new RegExp(`(?:^|\\b|[—–-])${escapeRegExp(termOrig)}`, '');
|
|
519
518
|
if (re3.test(textOrig)) { stage = 3; termHit = termOrig; break; }
|
|
520
519
|
}
|
|
521
520
|
}
|
|
@@ -592,7 +591,8 @@ function findMatchingArticles(glq, articlesList, termMap, opts = {}) {
|
|
|
592
591
|
}
|
|
593
592
|
} else {
|
|
594
593
|
// For non-stripped forms, match at word boundaries or after dashes (case-insensitive)
|
|
595
|
-
|
|
594
|
+
// Allow substring matching (e.g., "reap" matches "reapers")
|
|
595
|
+
const regex4 = new RegExp(`(?:^|\\b|[—–-])${escapeRegExp(form)}`, 'i');
|
|
596
596
|
if (regex4.test(textOrig)) {
|
|
597
597
|
stage = 4;
|
|
598
598
|
termHit = termOrig;
|