Accessing Google spelling/suggestion API via C# [closed]

为君一笑 提交于 2019-12-04 02:11:03

If anything, you could build it yourself with a small C# program that downloaded google's search page for a particular word i.e http://www.google.com/search?q=filipines and search for the

Showing results for philippines. Search instead for filipines

fragment, which would be contained in a <p class="sp_cnt"> in case the wording was incorrect, from there you could just extract the suggested correct spelling

Update: Actually, depending on a couple of things, it could also be in a <p class="ssp">, I think it depends on how long the phrase is, anyways you could search for the <span id="topstuff"> and find a child paragraph with either class, and extract the correct spelling from there, note that in the "ssp" case the wording is different:

Did you mean: showing result for phi

You could parse the page as an XML, if the code is XHTML compliant, then hurrah, otherwise you would have to tweak it a bit, making it "well-formed" to be loaded with XML as a XMLDocument. After that it should be easy finding the fragment of the page (should it exist) that tells you the appropriate spelling

If you don't have to use Google, the Bing API actually includes Spelling, you can use http://bingsharp.codeplex.com/

Somewhat late, but Google's spelling checker is part of the Search API. See

http://code.google.com/apis/soapsearch/reference.html#1_3

Google Search Api Sample Code http://deepumi.wordpress.com/2010/05/20/google-spell-checker-api-asp-net-c/ As u will use Proxy Authentication Error will come then add following line of code to remove error System.Net.IWebProxy theProxy = webclient.Proxy; if (theProxy != null) theProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

Here is a list of all google APIs: http://code.google.com/apis/ajax/playground/

Unfortunately it seems that there is no spelling API.

There is a Google-API Spelling implementation in Java, implemented by Kamran. It is not that complicated as I looked into the source. You might consider translating it into C# ?!

The project page states that

This is a simple Java API that makes it very easy to call Google's spell checker service from Java applications.

but which google spell checker service it uses I don't know, but it works pretty good.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!