Telerik blogs

Sometimes the default spellchecking algorithms in RadSpell are not providing the best possible suggestions for misspelled words. For example, the phonetic algorithm works best with English words, but is not very accurate with Russian. The edit distance algorithm is language independent, but will not recognize easy mistakes if the word spelling is not very similar to the original. Unfortunately, implementing your own custom algorithm for a specific language is not an easy task.

The latest Q3 2009 release of the RadControls for ASP.NET AJAX features a new example for RadSpell, which shows how to use an existing service provided by Google to spellcheck - http://demos.telerik.com/aspnet-ajax/spell/examples/googlespell/defaultcs.aspx. This example uses a feature of the control that allows using a custom provider (SpellCheckProviderTypeName). The provider needs to implement an existing interface (ISpellCheckProvider) and define simple methods like CheckWord, GetSuggestions, etc.

The Google provider works on the server by making a secure service request to the spell check service, which in turn returns a list of misspelled words and suggestions for them. We then convert this to a format that RadSpell can work with and push it back to the client browser where the actual spell check dialog is displayed. The provider is fully functional with the exception of adding custom words to the dictionary. However, you can easily implement that as well using an example from our Knowledge base - Changing the custom dictionary files location.If you do not need to add custom words, then you can simply copy the Google provider code in your project without the need for any modifications.


About the Author

Iana Tsolova

is Product Manager at Telerik’s DevTools division. She joined the company back in the beginning of 2008 as a Support Officer and has since occupied various positions at Telerik, including Senior Support Officer, Team Lead at one of the ASP.NET AJAX teams and Technical Support Director. Iana’s main interests are web development, reading articles related to geography, wild nature and latest renewable energy technologies.

Related Posts

Comments

Comments are disabled in preview mode.