From 0141bbd6536afff33d54ffb9e26469bfc3fcc7ee Mon Sep 17 00:00:00 2001 From: mrfakename Date: Thu, 19 Sep 2024 16:00:45 -0700 Subject: [PATCH] Unidecode -> Anyascii --- requirements.txt | 2 +- text/english.py | 4 ++-- text/japanese.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 39dbf7d..25908d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,7 +19,7 @@ pypinyin jieba # english eng_to_ipa -unidecode +anyascii inflect # japanese # if pyopenjtalk fail to download open_jtalk_dic_utf_8-1.11.tar.gz, manually download and unzip the file below diff --git a/text/english.py b/text/english.py index 0141d64..779e9ba 100644 --- a/text/english.py +++ b/text/english.py @@ -18,7 +18,7 @@ import re import inflect -from unidecode import unidecode +from anyascii import anyascii import eng_to_ipa as ipa _inflect = inflect.engine() _comma_number_re = re.compile(r'([0-9][0-9\,]+[0-9])') @@ -158,7 +158,7 @@ def mark_dark_l(text): def english_to_ipa(text): - text = unidecode(text).lower() + text = anyascii(text).lower() text = expand_abbreviations(text) text = normalize_numbers(text) phonemes = ipa.convert(text) diff --git a/text/japanese.py b/text/japanese.py index 948702b..d696da4 100644 --- a/text/japanese.py +++ b/text/japanese.py @@ -1,5 +1,5 @@ import re -from unidecode import unidecode +from anyascii import anyascii import pyopenjtalk @@ -108,7 +108,7 @@ def japanese_to_romaji_with_accent(text): elif a2 == 1 and a2_next == 2: text += '↑' if i < len(marks): - text += unidecode(marks[i]).replace(' ', '') + text += anyascii(marks[i]).replace(' ', '') return text