This commit is contained in:
:NoBody: committed 2026-07-26 16:49:38 +08:00
1 parent 122c47dd20
commit bf68444629
11 files changed
+316 -1707

No files matched your search

+20 -5
View File
@@ -30,10 +30,25 @@ class TTSHTMLParser:
t = t.replace(" ", "")
if strict:
allowed_punc = {
",", ".", ";", "-", "—", "-", "–",
",", "。", ";", "、",
"!", "?", "!", "?",
"%", "%", "+", "+",
",",
".",
";",
"-",
"—",
"-",
"–",
",",
"。",
";",
"、",
"!",
"?",
"!",
"?",
"%",
"%",
"+",
"+",
}
def is_chinese(ch: str) -> bool:
@@ -42,7 +57,7 @@ class TTSHTMLParser:
t = "".join(
c for c in t if c.isalnum() or is_chinese(c) or c in allowed_punc
)
return t.replace("\n", "") if delete_eol else t
return t.replace("\n", ",") if delete_eol else t
def process(elem) -> None:
if elem.tag == "root":