Merge 7e66149757785f355ef3a9194bd68e162ad051ad into 6d51ffceafbf240145619af4c92408a6e54b7924

This commit is contained in:
Ding Junyao 2026-11-14 18:45:44 +08:00 committed by GitHub
commit b86e3687ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@ normalizer = lambda x: cn2an.transform(x, "an2cn")
current_file_path = os.path.dirname(__file__)
pinyin_to_symbol_map = {
line.split("\t")[0]: line.strip().split("\t")[1]
for line in open(os.path.join(current_file_path, "opencpop-strict.txt")).readlines()
for line in open(os.path.join(current_file_path, "opencpop-strict.txt"), encoding="utf-8").readlines()
}
import jieba_fast

View File

@ -14,7 +14,7 @@ normalizer = lambda x: cn2an.transform(x, "an2cn")
current_file_path = os.path.dirname(__file__)
pinyin_to_symbol_map = {
line.split("\t")[0]: line.strip().split("\t")[1]
for line in open(os.path.join(current_file_path, "opencpop-strict.txt")).readlines()
for line in open(os.path.join(current_file_path, "opencpop-strict.txt"), encoding="utf-8").readlines()
}
import jieba_fast

View File

@ -131,7 +131,7 @@ def replace_consecutive_punctuation(text):
def read_dict():
g2p_dict = {}
start_line = 49
with open(CMU_DICT_PATH) as f:
with open(CMU_DICT_PATH, encoding="utf-8") as f:
line = f.readline()
line_index = 1
while line:
@ -154,7 +154,7 @@ def read_dict():
def read_dict_new():
g2p_dict = {}
with open(CMU_DICT_PATH) as f:
with open(CMU_DICT_PATH, encoding="utf-8") as f:
line = f.readline()
line_index = 1
while line:
@ -167,7 +167,7 @@ def read_dict_new():
line_index = line_index + 1
line = f.readline()
with open(CMU_DICT_FAST_PATH) as f:
with open(CMU_DICT_FAST_PATH, encoding="utf-8") as f:
line = f.readline()
line_index = 1
while line:
@ -185,7 +185,7 @@ def read_dict_new():
def hot_reload_hot(g2p_dict):
with open(CMU_DICT_HOT_PATH) as f:
with open(CMU_DICT_HOT_PATH, encoding="utf-8") as f:
line = f.readline()
line_index = 1
while line: