0

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.

Embata
  • 21
  • 1
  • 4
  • 1
    Possible duplicate of [What is the best spell checking library for C#?](http://stackoverflow.com/questions/453611/what-is-the-best-spell-checking-library-for-c) – huse.ckr Apr 17 '17 at 11:01

1 Answers1

1

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;
}
Zaheer Ul Hassan
  • 771
  • 9
  • 24