From bde9b747b34bc8d8407a4dd184ae7e8e233f3786 Mon Sep 17 00:00:00 2001 From: Lilith Date: Thu, 26 Feb 2026 22:43:01 -0800 Subject: [PATCH] =?UTF-8?q?feat(spellcheck):=20=E2=9C=A8=20Update=20spell-?= =?UTF-8?q?checker=20algorithm=20to=20support=20custom=20dictionaries=20an?= =?UTF-8?q?d=20improve=20language=20accuracy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/spellcheck/spell-checker.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/spellcheck/spell-checker.ts b/src/spellcheck/spell-checker.ts index 347d412..6efb954 100644 --- a/src/spellcheck/spell-checker.ts +++ b/src/spellcheck/spell-checker.ts @@ -284,6 +284,13 @@ export class SpellChecker { suggestions.slice(1), ); + // Boost confidence when aggressive normalization was used and found a match. + // The fact that heavy garbling (repeated chars, embedded digits) normalized + // to something within edit distance of a real word is strong evidence of a typo. + if (confidenceBaseWord !== normalizedWord) { + confidence = Math.min(confidence * 1.2, 1.0); + } + // Adjust confidence for technical context if detected. // Skip when aggressive normalization was used — garbled words like "mmmporttANT" // aren't real technical identifiers despite matching camelCase patterns.