From 00b93cfe1b2dcc6325cd8cc9e96a5eae7c1faf8f Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Wed, 7 Feb 2024 12:44:42 +0000 Subject: [PATCH] =?UTF-8?q?explicit=20allowance=20for=20=C4=87,=20=C5=9B,?= =?UTF-8?q?=20=C5=84,=20=C5=82=20etc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/script.py b/script.py index 5cee0f6..53cfef1 100644 --- a/script.py +++ b/script.py @@ -663,11 +663,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À-ÿ\u0150\u0151\u0170\u0171\$]', - "", - cleaned_part, - ) + cleaned_part = re.sub(r'[^a-zA-Z0-9\s\.,;:!?\-\'"\u0100-\u017F\u0400-\u04FFÀ-ÿ\u0150\u0151\u0170\u0171\$]', '', cleaned_part) # Remove all newline characters (single or multiple) cleaned_part = re.sub(r"\n+", " ", cleaned_part) @@ -694,11 +690,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À-ÿ\u0150\u0151\u0170\u0171\$]', - "", - cleaned_part, - ) + cleaned_part = re.sub(r'[^a-zA-Z0-9\s\.,;:!?\-\'"\u0100-\u017F\u0400-\u04FFÀ-ÿ\u0150\u0151\u0170\u0171\$]', '', cleaned_part) # 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.