From 558aed1888d8c881ce518ca1cd541d7137453c98 Mon Sep 17 00:00:00 2001 From: IAUSHYJ Date: Fri, 26 Apr 2024 03:40:20 +0400 Subject: [PATCH] stop cleaning common chinese punctuations --- script.py | 4 ++-- system/tts_generator/tts_generator.html | 2 +- tts_server.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/script.py b/script.py index 6bd1ee4..e358c06 100644 --- a/script.py +++ b/script.py @@ -700,7 +700,7 @@ def output_modifier(string, state): # Replace multiple exclamation marks, question marks, or other punctuation with a single instance cleaned_part = re.sub(r"([!?.])\1+", r"\1", part) # Further clean to remove any other unwanted characters - cleaned_part = re.sub(r'[^a-zA-Z0-9\s.,;:!?\-\'"$\u0400-\u04FF\u00C0-\u00FF\u0150\u0151\u0170\u0171\u0900-\u097F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF\uAC00-\uD7A3\u1100-\u11FF\u3130-\u318F]', '', cleaned_part) + cleaned_part = re.sub(r'[^a-zA-Z0-9\s.,;:!?\-\'"$\u0400-\u04FF\u00C0-\u00FF\u0150\u0151\u0170\u0171\u0900-\u097F\u2018\u2019\u201C\u201D\u3001\u3002\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF\uAC00-\uD7A3\u1100-\u11FF\u3130-\u318F\uFF01\uFF0c\uFF1A\uFF1B\uFF1F]', '', cleaned_part) # Remove all newline characters (single or multiple) # Remove all newline characters (single or multiple) cleaned_part = re.sub(r"\n+", " ", cleaned_part) @@ -727,7 +727,7 @@ def output_modifier(string, state): # Replace multiple instances of certain punctuation marks with a single instance cleaned_part = re.sub(r"([!?.])\1+", r"\1", cleaned_part) # Further clean to remove any other unwanted characters - cleaned_part = re.sub(r'[^a-zA-Z0-9\s.,;:!?\-\'"$\u0400-\u04FF\u00C0-\u00FF\u0150\u0151\u0170\u0171\u0900-\u097F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF\uAC00-\uD7A3\u1100-\u11FF\u3130-\u318F]', '', cleaned_part) + cleaned_part = re.sub(r'[^a-zA-Z0-9\s.,;:!?\-\'"$\u0400-\u04FF\u00C0-\u00FF\u0150\u0151\u0170\u0171\u0900-\u097F\u2018\u2019\u201C\u201D\u3001\u3002\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF\uAC00-\uD7A3\u1100-\u11FF\u3130-\u318F\uFF01\uFF0c\uFF1A\uFF1B\uFF1F]', '', cleaned_part) # Remove all newline characters (single or multiple) # Remove all newline characters (single or multiple) cleaned_part = re.sub(r"\n+", " ", cleaned_part) # Process the part and give it a non-character name if being used vai API or standalone. diff --git a/system/tts_generator/tts_generator.html b/system/tts_generator/tts_generator.html index bbe25f9..41cf7ef 100644 --- a/system/tts_generator/tts_generator.html +++ b/system/tts_generator/tts_generator.html @@ -927,7 +927,7 @@ cleanedText = cleanedText.replace(/\\.\\s'/g, ".'"); cleanedText = cleanedText.replace(/(?