在程序中使用Google关键字修正
假设我有一个拼写不正确的单词列表。我有一本字典可以纠正它们,但字典中可能没有一些单词。有没有办法让我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需通过转到 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.