Initializes a new instance of the Speller class by specifying a dictionary file.
This sample shows how to instantiate this class by specifying a physical path to the dictionary file.
// Create array lists for spell errors
ArrayList spellErrors = new ArrayList();
StringBuilder sbSpellErrors = new StringBuilder();
// Create spell checker
Speller speller = new Speller(@"C:\Inetpub\wwwroot\WebApplication1\UltimateSpellInclude\Dictionary\en-US\en-US.dic");
// Call spell check
spellErrors = speller.SpellCheck("text to spell check");
// Create a string in the form of misspelledWord,textIndex,type,suggestion1,suggestion2,...|misspelledWord,textIndex,type,suggestion1,suggestion2,...
foreach (SpellError spellError in spellErrors)
{
sbSpellErrors.Append(spellError.MisspelledWord);
sbSpellErrors.Append(",");
sbSpellErrors.Append(spellError.TextIndex);
sbSpellErrors.Append(",");
sbSpellErrors.Append(Convert.ToInt32(spellError.Type).ToString());
foreach (string suggestion in spellError.Suggestions)
{
sbSpellErrors.Append(",");
sbSpellErrors.Append(suggestion);
}
sbSpellErrors.Append("|");
}
sbSpellErrors.Remove(sbSpellErrors.Length - 1, 1);
Speller Class | Karamasoft.WebControls.UltimateSpell Namespace | Speller Constructor Overload List