From a22830f700f59c359efae483f26e8988edbfdc3c Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sun, 7 Jan 2024 21:33:33 +0000 Subject: [PATCH] Update tts_chunk_player.html bumped sentence splitting --- templates/tts_chunk_player/tts_chunk_player.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/tts_chunk_player/tts_chunk_player.html b/templates/tts_chunk_player/tts_chunk_player.html index 68c38da..21d3c6d 100644 --- a/templates/tts_chunk_player/tts_chunk_player.html +++ b/templates/tts_chunk_player/tts_chunk_player.html @@ -655,8 +655,7 @@ cleanedText = cleanedText.replace(/%/g, " percent"); cleanedText = cleanedText.replace(/\.\s'/g, ".'"); cleanedText = cleanedText.replace(/[^a-zA-Z0-9\s\.,;:!?\-\'"À-ÿ\u0400-\u04FF\u0150\u0151\u0170\u0171]\$/g, ''); - //let sentences = cleanedText.match(/("[^"]+"|[^.!?]+[.!?]+)/g); - let sentences = cleanedText.match(/(?:\d+\.\d+|[^\d.!?])+\b[.!?]+(?=\s|$)/g); + let sentences = cleanedText.split(/(?<=[.!?:])\s+/); if (!sentences) { console.error("No sentences found in the input text."); @@ -1666,4 +1665,4 @@ - \ No newline at end of file +