1.1
This commit is contained in:
1 parent
122c47dd20
commit
bf68444629
11 files changed
+316
-1707
No files matched your search
@@ -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":
|
||||
|
||||
Reference in new issue
Block a user