This is a migrated thread and some comments may be shown as answers.

Removing words from dictionary (cuss words, etc)

1 Answer 105 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Chad
Top achievements
Rank 1
Chad asked on 27 Feb 2012, 05:30 PM
Hi,

We want to remove certain words from the dictionary (any words that would be embarrassing for customers...  including some that may be proper anatomy words, but wouldn't be used in our application).  Is the best way to do this to download the dictionary from  http://www.telerik.com/community/forums/aspnet-ajax/spell/147971-radspell-dictionaries.aspx#576503, and edit the dictionary?  If not, what is the best way to go about that?

If we are going to edit the dictionary, can we add our own custom words directly to it rather than creating an IWordCustomDictionary?  If that's okay, what do the last two items on a line in a TDF file represent?  For example, what do the JNNL and KNNL represent in the following line:

genuinely:JNNL:KNNL

Thanks!

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivailo Karamanolev
Telerik team
answered on 01 Mar 2012, 12:18 PM
Hello,

The best way would be to download and edit the original tdf dictionary, removing and adding words at your discretion, removing the reference to the default En-US dictionary and leaving just your own. As highlighted in the Spellcheck help article, you can add a dictionary from a tdf file like this:

Copy Code
private void LoadDictionary( Stream tdfFileStream )
{
    RadDictionary dictionary = new RadDictionary();
    dictionary.Load( tdfFileStream );
    ( ( DocumentSpellChecker )this.radRichTextBox.SpellChecker ).AddDictionary( dictionary, CultureInfo.InvariantCulture );
}
The tdf file format contains the word, its metaphone key and its alternate metaphone key separated by colons. You can obtain the metaphone key of a word by adding it to a RadDictionary and calling its GetMetaphoneKey(string word) method. As the alternate metaphone key is not currently used, you can leave it empty without degrading performance.
Let us know if you need additional assistance.

Greetings,
Ivailo Karamanolev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
RichTextBox
Asked by
Chad
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Share this question
or