hunspell 拼写检查
我有一个具体的问题,需要重新排序 hunspell 因拼写错误而返回的建议单词。这些单词似乎按字母顺序返回。我想按相关性对建议进行排序,即最接近的匹配应该首先显示。 我找不到任何方法可以通过 hunspell api 来做到这一点。如何才能实现这一目标?
I had a specific question regrading ordering the suggested words returned by hunspell on a typo. The words seems to be returned in an alpha order. I want to order the suggestions by relevance, that is the closest match should show up first.
I couldn't find any way to do that via hunspell apis. How can this be achieved?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不会将结果放入排序列表或类似的东西中,是吗?
当我调用 int iCount = pHunspell->suggest(aSuggestions, "Testig") 时,我得到“Testing,Testis,Testes”。如果按字母顺序排列,“睾丸”将排在第一位,这当然不是我的意图。
在非托管 C++ 版本 1.2.2 和 1.3.2 中进行了测试。
You're not putting the results into a sorted list or anything like that, are you?
When I call
int iCount = pHunspell->suggest(aSuggestions, "Testig")
I get "Testing, Testis, Testes". If it was in alphabetical order, "Testes" would have been first, which is certainly not what I had intended.Tested in unmanaged C++ with versions 1.2.2 and 1.3.2.
我同意上面的观点。 Hunspell 利用某些概率模型(例如键盘字符近似度和语音相似度)来建议最佳匹配。您必须将其存储在已排序的列表中。
I agree with above. Hunspell makes use of certain probability models like keyboard character proximities and phonetic similarities to suggest best matches. You must be storing it in a list which gets sorted.