Skip to content

Commit 201fa1a

Browse files
fix(server): keep short punctuated dictionary terms correcting locally
Only skip fuzzy keys that a term's symbols reduce to a single letter (C#, C++). Terms such as A.I., I/O, Dr. and AT&T match their spoken forms again, as on main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 39b3c22 commit 201fa1a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/server/src/speech/customWords.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ export function makeSpeechTextCorrector(
7575
if (word.includes("&")) sources.push(word.replaceAll("&", " and "));
7676
const keys = sources.flatMap((source) => {
7777
const key = matchKey(source);
78-
// Short keys match exactly, so one that dropped symbols (C# -> c) would claim a plain word.
78+
// A term that loses its symbols to one letter (C# -> c) would claim every standalone letter.
7979
const lostSymbols = key !== source.replace(/\s+/gu, "").toLocaleLowerCase();
80-
return key.length < 4 && lostSymbols ? [] : [key];
80+
return key.length < 2 && lostSymbols ? [] : [key];
8181
});
8282
return [...new Set(keys)].filter(isAsciiKey).map((key) => ({ word, key }));
8383
});

0 commit comments

Comments
 (0)