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

自定义数据时,使用setSpell自定义读音会报错 #285

Open
ruihanma opened this issue Apr 17, 2024 · 1 comment
Open

自定义数据时,使用setSpell自定义读音会报错 #285

ruihanma opened this issue Apr 17, 2024 · 1 comment

Comments

@ruihanma
Copy link

使用setSpell时,库会对数据进行校验
例如「哼」,它在百度汉语上有两个读音「hēng」和「hng」
但是「hng」会被判定为错误读音
image

希望能够支持这种自定义,或者有个配置项比如跳过校验,强制加入之类

期待您的回复

@Th3G33k
Copy link

Th3G33k commented May 24, 2024

As a workaround, you can:

cnchar.dict.spell.hng = '0:'
cnchar.setSpell('哼', ['hng'])
console.log(cnchar.spellToWord('hng'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants