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
+2 -3
@@ -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 @@
</script>
</body>
</html>
</html>