diff --git a/text/japanese.py b/text/japanese.py index 75a8433..de53a4d 100644 --- a/text/japanese.py +++ b/text/japanese.py @@ -19,16 +19,27 @@ def hiragana2p(text: str) -> str: - avoid using `:`, instead, `あーーー` -> `a a a a`. - avoid converting `o u` to `o o` (because the input is already actual `yomi`). - avoid using `N` for `ん` (for compatibility) + - use `v` for `ゔ` related text. """ # 3文字以上からなる変換規則 - text = text.replace("う゛ぁ", " b a") - text = text.replace("う゛ぃ", " b i") - text = text.replace("う゛ぇ", " b e") - text = text.replace("う゛ぉ", " b o") + text = text.replace("う゛ぁ", " v a") + text = text.replace("う゛ぃ", " v i") + text = text.replace("う゛ぇ", " v e") + text = text.replace("う゛ぉ", " v o") text = text.replace("う゛ゅ", " by u") + # ゔ等の処理を追加 + text = text.replace("ゔぁ", " v a") + text = text.replace("ゔぃ", " v i") + text = text.replace("ゔぇ", " v e") + text = text.replace("ゔぉ", " v o") + text = text.replace("ゔゅ", " by u") + # 2文字からなる変換規則 - text = text.replace("ぅ゛", " b u") + text = text.replace("ぅ゛", " v u") + + # ゔの処理を追加 + text = text.replace("ゔ", " v u") text = text.replace("あぁ", " a a") text = text.replace("いぃ", " i i")