how to correct spelling mistakes in Google custom API
Asked Answered
T

1

7

I am using Google's custom search API, I make an HTTP request to a URL that looks like this:

https://www.googleapis.com/customsearch/v1?key=<my-key>&cref=&num=10&q=how+can+i+do+htis

if you search for "how can i do htis" on Google you are told "Showing results for how can i do this", and give you some results (call them result set A)

but if you use the API to search for the misspelled string, you get different results than those of A... Searching with a correctly spelled string gives you result A, which matches the ordinary search service on Google

Is there a way to search directly using the suggested string? I want to use the API I can't afford implementing a spell checker myself that can also correct people names and everything

Tracay answered 7/11, 2011 at 18:13 Comment(0)
A
2

I think what you want to do is possible using the spelling suggestions of Google. This is part of the xml-results returned by your query.

See API here.

Attwood answered 8/8, 2012 at 11:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.