Closed BeautifulNow97 closed 1 year ago
曾的拼音首字母应该是《Z》 ,现在获取到的《C》
def get_name_prefix(name_str: str): """ 将汉字的每个首字母合大写合并在字符串中 :param name_str: :return: """ res = [] for i in lazy_pinyin(name_str, style=Style.FIRST_LETTER): res.append(i.upper()) return "".join(res)
print(get_name_prefix('曾')) result->>C
@BeautifulNow97 曾 是多音字, C 是曾经的曾那个音
运行环境
问题描述
曾的拼音首字母应该是《Z》 ,现在获取到的《C》
问题复现步骤
def get_name_prefix(name_str: str): """ 将汉字的每个首字母合大写合并在字符串中 :param name_str: :return: """ res = [] for i in lazy_pinyin(name_str, style=Style.FIRST_LETTER): res.append(i.upper()) return "".join(res)
print(get_name_prefix('曾')) result->>C