I couldn't find any info , about creating a spell checker which reads a word from .txt file.
I will be glad if you can help with anything.
I couldn't find any info , about creating a spell checker which reads a word from .txt file.
I will be glad if you can help with anything.
To solve your problem you can use the NHunspell library.
Your check method in this case is very simple and looks like this:
bool CheckSpell(string word)
{
using (Hunspell hunspell = new Hunspell("en_GB.aff", "en_GB.dic"))
{
return hunspell.Spell(word);
}
}
You can find dictionaries on this site.
Also you can use SpellCheck class:
bool CheckSpell(string word)
{
TextBox tb = new TextBox();
tb.Text = word;
tb.SpellCheck.IsEnabled = true;
int index = tb.GetNextSpellingErrorCharacterIndex(0, LogicalDirection.Forward);
if (index == -1)
return true;
else
return false;
}