Google 搜索中拼写错误纠正背后的算法

发布于 2024-12-06 06:17:35 字数 143 浏览 1 评论 0原文

我注意到如果我在谷歌搜索栏中输入错误,它很可能会为我纠正。

就像,如果我输入“incredible”,它会建议“incredible”,或者对于“stackovflow”,它将建议“stackoverflow”。

这种算法的核心思想是什么?

I notice if I make a typo in Google search bar, it is very likely to correct it for me.

Like, if I type "incerdible", it will suggest "incredible", or for "stackovflow", it will be "stackoverflow".

What is the core idea of such algorithm?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷爱 2024-12-13 06:17:35

这是一个解释,以及一些包含更多详细信息的链接:

http://norvig.com/spell- Correct.html

Here is an explanation, and some more links with further details:

http://norvig.com/spell-correct.html

平定天下 2024-12-13 06:17:35

有很多算法可以解决这个问题。核心算法是计算两个单词之间的差异。你可以看一下 Levenshtein distance,这是一个很好的算法。

如果你想使用类似的东西,你可以使用一些 npm 包,如下所示:

https:// www.npmjs.com/package/typo- Correction

There are many algorithms to solve that problem. The core algorithm is to calculate the difference between two words. You can take a look at Levenshtein distance, this is a great algorithm to do that.

If you want to use something like that, you can use some npm package like this:

https://www.npmjs.com/package/typo-correction

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文