Skip to content

Commit

Permalink
Update util.py
Browse files Browse the repository at this point in the history
修复相同拼音不同声调会使干员图片丢失
  • Loading branch information
D3adEr1c committed May 20, 2022
1 parent f857060 commit e378995
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion draw_card/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@


def cn2py(word) -> str:
"""保存声调,防止出现类似方舟干员红与吽拼音相同声调不同导致红照片无法保存的问题"""
temp = ""
for i in pypinyin.pinyin(word, style=pypinyin.NORMAL):
for i in pypinyin.pinyin(word, style=pypinyin.pypinyin.TONE3):
temp += "".join(i)
return temp

Expand Down

0 comments on commit e378995

Please sign in to comment.