Spell Check

The Spell Checking engine can also be customized to ignore certain text or words from being spell checked. By setting the respective properties, these words will be overlooked and will not indicate them as misspelled words. This option will be effective when there are a number of email id’s and addresses, HTML tags, combination of words and numbers, combination of upper and lower case words that are used frequently in the document.

Ignore Spell Check

Property

Description

IgnoreEmailAddress

Specifies whether or not to ignore email address during Spell Check. Default value is false.

IgnoreHtmlTags

Specifies whether or not to ignore HTML tags during Spell Check. Default value is false.

IgnoreUrl

Specifies whether or not to ignore Internet address during Spell Check. Default value is false.

IgnoreMixedCaseWords

Specifies whether or not to ignore mixed case words during Spell Check.  Default value is false.

IgnoreUpperCaseWords

Specifies whether or not to ignore uppercase words during Spell Check. Default value is false.

IgnoreAlphaNumericWords

Specifies whether or not to Spell Check numbers or words with numbers during Spell Check. Default value is false.

Setting Spell Check Options

Create a spell checker instance and set the spell checking options as given below:

SfSpellChecker SpellChecker = new SfSpellChecker();

SpellChecker.IgnoreUrl = true;

SpellChecker.IgnoreUpperCaseWords = true;

SpellChecker.IgnoreAlphaNumericWords = true;

SpellChecker.IgnoreEmailAddress = true;

SpellChecker.IgnoreMixedCaseWords = true;

SpellChecker.IgnoreHtmlTags = true;

Getting Suggestions for Error Word

SfSpellChecker provides support to get suggestion list by passing the error word in the below methods.

  • GetSuggestions
  • GetPhoneticWords
  • GetAnagrams
SfSpellChecker SpellChecker = new SfSpellChecker();

SpellChecker.GetSuggestions("offce");

SpellChecker.GetPhoneticWords("offce");

SpellChecker.GetAnagrams("offce");