How to incorporate NLP Spelling Corrections using Java

Using our Spell Check API, you can seamlessly add an integral NLP layer to your application. Take advantage of code snippets provided below to make a connection with Java, or visit our API Console page to find code available in 12 additional programming languages.

You’ll need to start by installing the Java SDK. To do so using Maven, first add a reference to the repository in pom.xml:


Directly following that, add one to the dependency in pom.xml:


Last but not least, add the import classes and call the NLP function:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.SpellcheckApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");
Apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
SpellcheckApi apiInstance = new SpellcheckApi();
CheckWordRequest value = new CheckWordRequest(); // CheckWordRequest | Input string
try {
CheckWordResponse result = apiInstance.spellcheckCorrectJson(value);
} catch (ApiException e) {
System.err.println("Exception when calling SpellcheckApi#spellcheckCorrectJson");



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



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