Skip to content

Commit

Permalink
refine multilingual functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
lmxue committed Feb 17, 2024
1 parent 03df61e commit 7310116
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions text/g2p_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def _initialize_backend(
words_mismatch=words_mismatch,
)
elif backend in ["pypinyin", "pypinyin_initials_finals"]:
if language != "cmn":
raise ValueError(f"{language} is not supported for pypinyin and pypinyin_initials_finals.")
return PypinyinBackend(
backend=backend,
punctuation_marks=punctuation_marks + self.separator.word,
Expand Down

0 comments on commit 7310116

Please sign in to comment.