mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-10 10:32:17 +00:00
fix flake8
This commit is contained in:
parent
df382566dc
commit
88c35c5e29
@ -321,7 +321,8 @@ def tokenize_ZH(text: str) -> List[str]:
|
|||||||
if final != "":
|
if final != "":
|
||||||
phones.append(final)
|
phones.append(final)
|
||||||
return phones
|
return phones
|
||||||
except:
|
except Exception as ex:
|
||||||
|
logging.warning(f"Tokenize ZH failed: {ex}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@ -332,7 +333,8 @@ def tokenize_EN(text: str) -> List[str]:
|
|||||||
tokens = phonemize_espeak(text, "en-us")
|
tokens = phonemize_espeak(text, "en-us")
|
||||||
tokens = reduce(lambda x, y: x + y, tokens)
|
tokens = reduce(lambda x, y: x + y, tokens)
|
||||||
return tokens
|
return tokens
|
||||||
except:
|
except Exception as ex:
|
||||||
|
logging.warning(f"Tokenize EN failed: {ex}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@ -561,7 +563,7 @@ class TokenizerLibriTTS(object):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
text = "我们是5年小米人,是吗? Yes I think so! mr king, 5 years, from 2019 to 2024. 霍...啦啦啦超过90%的人咯...?!9204"
|
text = "我们是5年小米人,是吗? Yes I think so! mr king, 5 years, from 2019 to 2024. 霍...啦啦啦超过90%的人咯...?!9204"
|
||||||
tokenizer = Tokenizer()
|
tokenizer = TokenizerEmilia()
|
||||||
tokens = tokenizer.texts_to_tokens([text])
|
tokens = tokenizer.texts_to_tokens([text])
|
||||||
print(f"tokens : {tokens}")
|
print(f"tokens : {tokens}")
|
||||||
tokens2 = "|".join(tokens[0])
|
tokens2 = "|".join(tokens[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user