Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开启拼音模式后,"乐"字在姓名中的读音也变了 #237

Closed
Yananay opened this issue May 20, 2024 · 2 comments · Fixed by #238 or #240
Closed

开启拼音模式后,"乐"字在姓名中的读音也变了 #237

Yananay opened this issue May 20, 2024 · 2 comments · Fixed by #238 or #240
Labels
feature A feature need to add

Comments

@Yananay
Copy link

Yananay commented May 20, 2024

代码:
console.log(
"不开启姓氏模式,曾乐的读音:",
pinyin("曾乐", {
toneType: "none",
})
);

console.log(
"开启姓氏模式,曾乐的读音:",
pinyin("曾乐", {
toneType: "none",
mode: "surname",
})
);

结果:
不开启姓氏模式,曾乐的读音: ceng le
开启姓氏模式,曾乐的读音: zeng yue

试了一下其他姓氏也会这样

问:姓氏模式打开应该只会订正姓的读音,而不应该订正名字的读音?请问是否有这个功能呢

@zh-lx zh-lx added the feature A feature need to add label May 21, 2024
@zh-lx
Copy link
Owner

zh-lx commented May 21, 2024

感谢反馈,本周会支持一下姓名模式只对字符串开头姓氏做匹配

@zh-lx
Copy link
Owner

zh-lx commented May 27, 2024

已在 3.21.0 版本支持该功能,设置 surname: 'head' 即可只识别字符串开头的姓氏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A feature need to add
Projects
None yet
2 participants