https://github.com/jacraig/spellchekr
Basic spell checker
https://github.com/jacraig/spellchekr
Last synced: 11 months ago
JSON representation
Basic spell checker
- Host: GitHub
- URL: https://github.com/jacraig/spellchekr
- Owner: JaCraig
- License: apache-2.0
- Created: 2020-04-17T01:16:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T20:46:00.000Z (over 1 year ago)
- Last Synced: 2024-10-29T22:48:56.778Z (over 1 year ago)
- Language: C#
- Homepage: https://jacraig.github.io/SpellChekr/
- Size: 19.5 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
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.
[](https://github.com/JaCraig/SpellChekr/actions/workflows/dotnet-publish.yml) [](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.