c# - Is there a native spell check method for datatype string? -


i working on tool analyses huge amounts of data inputted hand using old database gui not allow spell check, have on post-process. first serious program in c# , wondering, before implementing more complicated stuff dictionaries or using external libraries nhunspell, if there native method applied on regular strings check if string has spell errors inside.

i've read spellcheck class don't know how used on simple string, outside usage of textboxes. if possible give me example of how please?

thanks in advance.

i've worked on similar, i've used nhunspell (which can nuget), got (it's not exact code, it's pretty near):

public idictionary<string, ienumerable<string>> analyze(string text) {     var results = new dictionary<string, ienumerable<string>>();      using (var hunspell = new hunspell("resources\\en_gb.aff", "resources\\en_gb.dic"))     {            string[] words = regex.split(text, @"\w+", regexoptions.ignorecase);         ienumerable<string> misspelledwords = words.where(word => !hunspell.spell(word));          foreach (string word in misspelledwords)         {             ienumerable<string> suggestions = hunspell.suggest(word);             results.add(word, suggestions);         }     }     return results; } 

it analyze text, return dictionary of misspelled words along list of suggestions each.

just add, here list of hunspell dictionaries (with different languages).


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -