refactor: version 4.0.2 -- Duplicados de Nuevo con IA decididos por la IA

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Milton Gonzalez
2026-10-23 16:47:56 -05:00
parent 7e59f0181d
commit 3ee17d1c5a
6 changed files with 31 additions and 14 deletions
+3 -3
View File
@@ -20,9 +20,9 @@ export function keywords(text) {
return new Set(words.filter((w) => w.length > 2 && !STOPWORDS.has(w)).map(stem));
}
// Parecido si comparten >= 2 palabras clave y al menos la mitad del conjunto mas chico.
export function isSimilar(a, b) {
// Cantidad de palabras clave compartidas (filtro amplio previo a la IA).
export function sharedCount(a, b) {
let shared = 0;
for (const w of a) if (b.has(w)) shared += 1;
return shared >= 2 && shared / Math.max(1, Math.min(a.size, b.size)) >= 0.5;
return shared;
}