ignore all non-Chinese characters

This commit is contained in:
Ross Shen 2022-05-21 18:27:03 +08:00
parent 9602447a04
commit 43d6dd904b

View File

@ -37,7 +37,7 @@ def check_contain_chinese(check_str):
return False
def changepinyin (title):
a = pypinyin.pinyin(title, style=pypinyin.FIRST_LETTER)
a = pypinyin.pinyin(title, style=pypinyin.FIRST_LETTER, errors='ignore')
b = []
for i in range(len(a)):
b.append(str(a[i][0]).upper())