How to Spellcheck a Sentence in C# .NET Framework

Cloudmersive
1 min readJul 15, 2020

--

Spellchecking is a crucial feature, but a highly complex one to implement. There are a ton of technical pitfalls just beckoning to you the moment you start down this path. But there is hope! I will be showing you today how to employ an API to solve this problem quickly and easily. Let’s start:

First we need our package:

Install-Package Cloudmersive.APIClient.NET.NLP -Version 4.0.9

Now we call our function:

using System;using System.Diagnostics;using Cloudmersive.APIClient.NET.NLP.Api;using Cloudmersive.APIClient.NET.NLP.Client;using Cloudmersive.APIClient.NET.NLP.Model;namespace Example{public class SpellCheckCheckSentenceStringExample{public void main(){// Configure API key authorization: ApikeyConfiguration.Default.AddApiKey("Apikey", "YOUR_API_KEY");// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed// Configuration.Default.AddApiKeyPrefix("Apikey", "Bearer");var apiInstance = new SpellCheckApi();var value = value_example;  // string | Input sentence wordtry{// Spell check a sentencebool? result = apiInstance.SpellCheckCheckSentenceString(value);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling SpellCheckApi.SpellCheckCheckSentenceString: " + e.Message );}}}}

Whew! Easy.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

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

No responses yet