from misaki import zh
g2p = zh.ZHG2P(version="1.1")
print(g2p("這是 example"))
Traceback (most recent call last):
File "./example.py", line 4, in <module>
print(g2p("這是 example"))
^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/misaki/zh.py", line 80, in __call__
segments.append(self.unk)
^^^^^^^^
AttributeError: 'ZHG2P' object has no attribute 'unk'
For ZHG2P, if the text to be converted contains English, it will throw an exception.
How can we solve this problem elegantly?
A way to solve this issue is to preprocess the input by splitting it into segments.
Any other suggestions?
For
ZHG2P, if the text to be converted contains English, it will throw an exception.How can we solve this problem elegantly?
A way to solve this issue is to preprocess the input by splitting it into segments.
Any other suggestions?