twl-generator 1.2.6 → 1.2.8
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/utils/twl-matcher.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twl-generator",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
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": {
|
|
@@ -56,4 +56,4 @@
|
|
|
56
56
|
"optional": true
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
}
|
|
59
|
+
}
|
package/src/utils/twl-matcher.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
function generateVariants(term) {
|
|
5
5
|
const variants = new Set([term]);
|
|
6
6
|
|
|
7
|
-
const nouns = ['doe', 'deer'];
|
|
7
|
+
const nouns = ['doe', 'deer', 'father', 'Father'];
|
|
8
8
|
|
|
9
9
|
// Handle pluralization - simple 's' removal (but not for words ending in 'ss')
|
|
10
10
|
if (term.endsWith('s') && term.length > 2 && !term.endsWith('ss') && !term.endsWith('es')) {
|
|
@@ -90,8 +90,8 @@ class PrefixTrie {
|
|
|
90
90
|
// Insert into exact case trie
|
|
91
91
|
this._insertIntoTree(this.exactCaseRoot, term, originalTerm, articles, isOriginal, true);
|
|
92
92
|
|
|
93
|
-
// Also insert into lowercase trie for fallback
|
|
94
|
-
this._insertIntoTree(this.lowerCaseRoot, term.toLowerCase(), originalTerm, articles, isOriginal, false);
|
|
93
|
+
// // Also insert into lowercase trie for fallback - removed, too many falses
|
|
94
|
+
// this._insertIntoTree(this.lowerCaseRoot, term.toLowerCase(), originalTerm, articles, isOriginal, false);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
_insertIntoTree(root, term, originalTerm, articles, isOriginal, isExactCase) {
|
|
@@ -300,7 +300,7 @@ function generateId() {
|
|
|
300
300
|
for (let i = 0; i < 3; i++) {
|
|
301
301
|
id += lettersAndDigits[Math.floor(Math.random() * lettersAndDigits.length)];
|
|
302
302
|
}
|
|
303
|
-
return id;
|
|
303
|
+
return 'abcd' || id;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
/**
|