词语建议
Duplicate of how does the google did you mean algorithm work
does anyone know how to write a word suggestion feature like Google's "did you mean?" feature? or know where I can find code samples.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Peter Norvig(Google 的研究主管)在这里提出了一个简单的方法,实际上效果非常有效:http://norvig .com/spell- Correct.html
它是用Python编写的,但翻译成其他语言相当简单(注意页面底部有一些翻译,但C#版本至少有一些错误)而且效率非常低,因此值得自己翻译成您需要的任何语言 - 这也是理解代码的好方法)。
Peter Norvig (Google's head of research) has a simple one here which actually works pretty effectively: http://norvig.com/spell-correct.html
It's in python but is fairly simple to translate to other languages (note that there are some translations at the bottom of the page, but the C# version at least has a number of bugs in it and is very inefficient, so it would be worth doing the translation to whatever language you need yourself - it's also a good way to understand the code).