diff --git a/src/pages/ContentCreation.jsx b/src/pages/ContentCreation.jsx index eb36340..dbe640e 100644 --- a/src/pages/ContentCreation.jsx +++ b/src/pages/ContentCreation.jsx @@ -77,7 +77,7 @@ async function resolvePlaceholders(text, allObjects) { // ─── Fuzzy word matching ────────────────────────────────────────────────────── -function fuzzyMatch(token, wordTitle, threshold = 0.6) { +function fuzzyMatch(token, wordTitle, threshold = 0.85) { const t = token.toLowerCase(); const w = wordTitle.toLowerCase(); if (!t.startsWith(w) && !w.startsWith(t)) return false; @@ -234,7 +234,7 @@ function PairForm({ objectId, allObjects, onPairSaved }) { if (!allText.trim()) { setWordMap({}); return; } const t = setTimeout(async () => { try { - const tokens = [...new Set(allText.split(/[\s.,!?;:()\[\]"']+/).filter(w => w.length >= 2))]; + const tokens = [...new Set(allText.split(/[\s.,!?;:()\[\]"']+/).filter(w => w.length >= 4))]; if (!tokens.length) return; const results = await Promise.allSettled( tokens.map(async w => { @@ -532,7 +532,7 @@ function EditPairForm({ pair, allObjects, onSaved, onCancel, onDeleted }) { if (!allText.trim()) { setWordMap({}); return; } const t = setTimeout(async () => { try { - const tokens = [...new Set(allText.split(/[\s.,!?;:()\[\]"']+/).filter(w => w.length >= 2))]; + const tokens = [...new Set(allText.split(/[\s.,!?;:()\[\]"']+/).filter(w => w.length >= 4))]; if (!tokens.length) return; const results = await Promise.allSettled( tokens.map(async w => {