diff --git a/apps/server/src/speech/SpeechService.test.ts b/apps/server/src/speech/SpeechService.test.ts index 7b34772837088..23d2e53c14d8b 100644 --- a/apps/server/src/speech/SpeechService.test.ts +++ b/apps/server/src/speech/SpeechService.test.ts @@ -544,6 +544,12 @@ it.effect.each([ text: "Uh, Make it red, um, blue.", expected: "Make it red, blue.", }, + { + cue: undefined, + remove: true, + text: "Um... make it red, uh… blue.", + expected: "make it red, blue.", + }, { cue: "um", remove: false, diff --git a/apps/server/src/speech/fillerWords.ts b/apps/server/src/speech/fillerWords.ts index 5061341833c06..e13127db26728 100644 --- a/apps/server/src/speech/fillerWords.ts +++ b/apps/server/src/speech/fillerWords.ts @@ -34,7 +34,7 @@ export function removeSpeechFillerWords( ]; const cuePattern = correctionCue?.trim().split(/\s+/).map(escapeRegex).join("\\s+"); const pattern = new RegExp( - `(? cue ?? "");