The autocorrect feature in v4 works with a specifically chosen map of common English errors, eg.
"abbout" => "about" "abotu" => "about" "abouta" => "about a"
This is safer than using the top spelling suggestion as the correction automatically, as it is possible that the user has typed a word that simply isn't known (eg. jargon). This map can be modified at runtime through the RapidSpellAsYouType.AutoCorrectionMap property, if desired.
However, if it is required to customize the autocorrector, this can be done fairly simply; In this example we use the top spelling suggestion (note this works in whatever dictionary language is loaded).
Simple handle the FoundSpellError event, and set e.Replacement to the desired correction.
void rapidSpellAsYouType1_FoundSpellingError(object sender, Keyoti.RapidSpell.Event.FoundSpellingErrorEventArgs e)
{
ArrayList s =rapidSpellAsYouType1.RapidSpellChecker.FindSuggestions(e.BadWord.Word);
if(s.Count>0)
e.Replacement = s[0].ToString();
}
|