Use Google keyword corrections in program
Let's say I have a list of words that are not spelled correctly. I have a dictionary开发者_如何学JAVA 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.
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.
精彩评论