twl-generator 1.2.14 → 1.2.15
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": "twl-generator",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.15",
|
|
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": {
|
package/src/utils/twl-matcher.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
function generateVariants(term, isName = false) {
|
|
5
5
|
const variants = new Set([term]);
|
|
6
6
|
|
|
7
|
-
const isNoun = ['horn', 'mare', 'steed', 'horse', 'doe', 'deer', 'father', 'Father'].includes(term) || isName;
|
|
7
|
+
const isNoun = ['horn', 'mare', 'steed', 'horse', 'doe', 'deer', 'father', 'Father', 'cross', 'well'].includes(term) || isName;
|
|
8
8
|
const doNotPluralize = ['doe'].includes(term);
|
|
9
9
|
const doNotDepluralize = ['kids'].includes(term) || isName;
|
|
10
10
|
|
|
@@ -27,7 +27,13 @@ async function getCachedZip() {
|
|
|
27
27
|
const cached = localStorage.getItem(CACHE_KEY);
|
|
28
28
|
if (cached) {
|
|
29
29
|
const data = JSON.parse(cached);
|
|
30
|
-
if
|
|
30
|
+
// Only use cache if version matches and cache is less than 5 minutes old
|
|
31
|
+
const FIVE_MINUTES = 5 * 60 * 1000;
|
|
32
|
+
if (
|
|
33
|
+
data.version === CACHE_VERSION &&
|
|
34
|
+
data.timestamp &&
|
|
35
|
+
(Date.now() - data.timestamp) < FIVE_MINUTES
|
|
36
|
+
) {
|
|
31
37
|
console.log('Using cached ZIP from browser storage');
|
|
32
38
|
return new Uint8Array(data.zipData);
|
|
33
39
|
} else {
|