Update tts_chunk_player.html

bumped sentence splitting
This commit is contained in:
erew123 authored and GitHub committed 2024-01-07 21:33:33 +00:00
1 parent 374c794fa9
commit a22830f700
1 file changed
+1 -2
@@ -655,8 +655,7 @@
cleanedText = cleanedText.replace(/%/g, " percent"); cleanedText = cleanedText.replace(/%/g, " percent");
cleanedText = cleanedText.replace(/\.\s'/g, ".'"); cleanedText = cleanedText.replace(/\.\s'/g, ".'");
cleanedText = cleanedText.replace(/[^a-zA-Z0-9\s\.,;:!?\-\'"À-ÿ\u0400-\u04FF\u0150\u0151\u0170\u0171]\$/g, ''); cleanedText = cleanedText.replace(/[^a-zA-Z0-9\s\.,;:!?\-\'"À-ÿ\u0400-\u04FF\u0150\u0151\u0170\u0171]\$/g, '');
//let sentences = cleanedText.match(/("[^"]+"|[^.!?]+[.!?]+)/g); let sentences = cleanedText.split(/(?<=[.!?:])\s+/);
let sentences = cleanedText.match(/(?:\d+\.\d+|[^\d.!?])+\b[.!?]+(?=\s|$)/g);
if (!sentences) { if (!sentences) {
console.error("No sentences found in the input text."); console.error("No sentences found in the input text.");