An open API service indexing awesome lists of open source software.

https://github.com/jacraig/spellchekr

Basic spell checker
https://github.com/jacraig/spellchekr

Last synced: 11 months ago
JSON representation

Basic spell checker

Awesome Lists containing this project

README

          

# SpellChekr
Basic spell checker. The system is based on [Peter Norvig's](http://norvig.com/spell-correct.html) spelling suggestion system.

[![.NET Publish](https://github.com/JaCraig/SpellChekr/actions/workflows/dotnet-publish.yml/badge.svg)](https://github.com/JaCraig/SpellChekr/actions/workflows/dotnet-publish.yml) [![Coverage Status](https://coveralls.io/repos/github/JaCraig/SpellChekr/badge.svg?branch=master)](https://coveralls.io/github/JaCraig/SpellChekr?branch=master)

## Usage
In order to use it you need to declare a dictionary:

public class ExampleSpellChecker : SpellingDictionaryBase
{
public ExampleSpellChecker(ObjectPool objectPool)
: base(Words, objectPool)
{
}

public override string Name => "Example";

private static readonly string[] Words = new string[]
{
"Word1",
"Word2"
...
"Word9999999"
}
}

And then set it up on the service collection along with the SpellChecker class:

ServiceCollection.AddSpellChecker();

Or if you are using Canister:

ServiceCollection.AddCanisterModules();

From there you just use the SpellChecker class:

string Output=SpellChecker.GetDictionary("Example").Correct(input);

The GetDictionary method takes in the name of the dictionary that you wish to use and Correct takes the words that you wish to check.