From 7d0adbcad9cf2dcd4b128d58c79a0582993b1bcb Mon Sep 17 00:00:00 2001 From: Owen Song Date: Wed, 17 Jun 2026 23:54:45 +0000 Subject: [PATCH] Remove obsolete package file tinytts_text_cleaning.py --- tinytts_text_cleaning.py | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 tinytts_text_cleaning.py diff --git a/tinytts_text_cleaning.py b/tinytts_text_cleaning.py deleted file mode 100644 index 0342090..0000000 --- a/tinytts_text_cleaning.py +++ /dev/null @@ -1,28 +0,0 @@ -from __future__ import annotations - -import re - - -_QUOTE_TRANSLATION = str.maketrans( - { - "\u2018": "'", - "\u2019": "'", - "\u201c": "", - "\u201d": "", - "\u2014": ",", - "\u2013": ",", - ";": ",", - ":": ",", - "\n": ".", - } -) - - -def clean_tinytts_text(text: str) -> str: - """Normalize text into punctuation TinyTTS actually has symbols for.""" - text = str(text).translate(_QUOTE_TRANSLATION) - text = text.replace("...", "…") - text = re.sub(r"\s+", " ", text).strip() - text = re.sub(r"\s+([,.!?…])", r"\1", text) - text = re.sub(r"([,.!?…]){2,}", r"\1", text) - return text