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

蔡 解析有问题 #7

Open
marlti7 opened this issue Jan 9, 2018 · 6 comments
Open

蔡 解析有问题 #7

marlti7 opened this issue Jan 9, 2018 · 6 comments

Comments

@marlti7
Copy link

marlti7 commented Jan 9, 2018

'sa','cai', 'ca' 查了下不是多音字,就念cai

@marlti7
Copy link
Author

marlti7 commented Jan 9, 2018

遇到‘+’, 返回一个空数组
不应该是匹配不到,原是什么,返回什么吗?

@marlti7
Copy link
Author

marlti7 commented Jan 9, 2018

能提供一个取首字母的方法吗

@breezewish
Copy link
Owner

breezewish commented Jan 22, 2018

Hi, according to Wikipedia, there are multiple pronunciations for 蔡:

https://zh.wiktionary.org/zh-hans/%E8%94%A1

@breezewish
Copy link
Owner

遇到‘+’, 返回一个空数组
不应该是匹配不到,原是什么,返回什么吗?

You can enable the keepUnrecognized option.

@breezewish
Copy link
Owner

能提供一个取首字母的方法吗

Recommended to use it with a string matching library, for example, the string_score library in the sample, which handles initials well.

@XieJiSS
Copy link

XieJiSS commented Dec 11, 2018

取首字母你可以[[], [], []].map(s => { if(s[0]) return s[0][0]; else return ""; });一下,或者想获得全部组合可以把每个字符当成一个Node,强行加一个""空字符串当成跟节点来构成一个Tree,对这个Tree做DFS就可以了

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

3 participants