refac: Tidy Chat.svelte

This commit is contained in:
kiosion
2024-08-25 20:00:49 -04:00
parent 73998a70cc
commit d78c35c9ba
2 changed files with 57 additions and 58 deletions

View File

@@ -600,7 +600,8 @@ export const extractSentencesForAudio = (text: string) => {
if (lastIndex >= 0) {
const previousText = mergedTexts[lastIndex];
const wordCount = previousText.split(/\s+/).length;
if (wordCount < 2) {
const charCount = previousText.length;
if (wordCount < 4 || charCount < 50) {
mergedTexts[lastIndex] = previousText + ' ' + currentText;
} else {
mergedTexts.push(currentText);