Remove obsolete package file tinytts_text_cleaning.py

This commit is contained in:
Owen Song
2026-06-17 23:54:45 +00:00
committed by system
parent 6ffa0bf8fc
commit 7d0adbcad9
-28
View File
@@ -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