Check if Sentence is Spelled Correctly in Go

Simply put: our sentence spellcheck API will return each word of an input sentence with a true/false analysis of each word’s correctness. If a word is determined to be false (incorrectly spelled), a list of suggested corrections will be included for that word and appear directly beneath it in JSON format. If you’re looking to use this API in your Golang application, you can do so easily using ready-to-run code examples included below from our Cloudmersive API Console. On our console page, you’ll find code examples in 12 other programming languages along with hundreds of other APIs to choose from.

package mainimport (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {url := "https://api.cloudmersive.com/nlp-v2/spellcheck/check/sentence"
method := "POST"
payload := strings.NewReader("Sentence=%3Cstring%3E")client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Apikey", "YOUR-API-KEY-HERE")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}

Need an API key? You can easily acquire one by creating an account on our website (www.cloudmersive.com). Don’t worry — among several account options, you’ll find a free-tier account available with zero financial commitments and a limit of 800 API calls per month.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.