Knowledgebase Home Page  >  RapidSpell Desktop .NET  >  Behavior Customization
Search the Knowledge Base
How can I make lowercase 'i' a spelling error? (C#)
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=207&catId=62

Options

Print this page
Email this to a friend
This is fairly simple, however, make sure you really want to do this, as there are legitimate uses of 'i', for example:
 
"The 9th letter of the alphabet is i"
or
"i. First thing
ii. ....
"
To do it, you can add this class
    class SChecker : RapidSpellChecker
    {
        protected override bool LookUpMainDictionary(string query)
        {
            if (query == "i") return false;
            else
                return base.LookUpMainDictionary(query);
        }
        protected override bool LookUpUserDictionary(string query)
        {
            if (query == "i") return false;
            else
                return base.LookUpUserDictionary(query);
        }
        protected override System.Collections.ArrayList FindSuggestions(string word, bool searchLowerCase)
        {
            if (word == "i") return new System.Collections.ArrayList(new string[] { "I" });
            else return base.FindSuggestions(word, searchLowerCase);
        }
    }

and then use it like this
rapidSpellAsYouType1.RapidSpellChecker = new SChecker();
or
rapidSpellDialog1.CheckerEngine = new SChecker();

Related Questions:

Attachments:

No attachments were found.