在程序中使用Google关键字修正

发布于 2024-10-02 09:31:46 字数 105 浏览 0 评论 0原文

假设我有一个拼写不正确的单词列表。我有一本字典可以纠正它们,但字典中可能没有一些单词。有没有办法让我在 Google 中搜索那些拼写错误的单词并检索 Google 提出的第一个“您是说:”建议吗?

Let's say I have a list of words that are not spelled correctly. I have a dictionary that corrects them but there may be some words not present in the dictionary. Is there a way for me to search those misspelled words in Google and retrieve the first "Did you mean:" suggestion made by Google.

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

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

发布评论

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

评论(1

月朦胧 2024-10-09 09:31:46

您只需通过转到 google.com URL + 单词字符串(我不确定确切的 Google 搜索 URL)在 Google 中搜索这些单词,在后台进行搜索项处理,然后使用类似XPATH 和 HTMLCleaner 查看是否存在“您的意思是”文本。如果是这样,请将其呈现给用户。

但我认为谷歌现在会进行自动更正搜索,因此您可能会看到“搜索:正确的拼写”,您也应该考虑这一点。

You just do a search for those words in Google by going to the google.com URL + the string of words(I'm not sure of the exact Google search URL), have the search term process in the background, then use something like XPATH and HTMLCleaner to see if there is a "Did you mean" text present. If so, present it to the user.

But I think Google now does an auto-correction search, so you may see "Searching for: CORRECTED SPELLING", something you should also take into consideration.

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