Add Custom Words to Dictionary via a Function?

Posted by MattMc on Tue 31 Jan 2006 06:47 AM — 4 posts, 16,912 views.

USA #0
Is there a function to add words to the spellchecker dictionary?


Thanks
Matt
Australia Forum Administrator #1
There is no current provision to do so. You are the first to ask for it.

There appears to be support in the Sentry Spell Check Engine (which I use) to do such a thing, if I read it correctly.

However judging by the documentation the user dictionary is a simple text file with the format:


word	The word in the lexicon.
\t	A tab character.
action	Character representing the action associated with the word:a: SSCE_AUTO_CHANGE_ACTION
A: SSCE_AUTO_CHANGE_PRESERVE_CASE_ACTION
c: SSCE_CONDITIONAL_CHANGE_ACTION
C: SSCE_CONDITIONAL_CHANGE_PRESERVE_CASE_ACTION
e: SSCE_EXCLUDE_ACTION
i: SSCE_IGNORE_ACTION
otherWord	The alternate word associated with the word.


For example the default one is this:


#LID 24941
Beddington	i
Nepean	i
SSCE	i
Wintertree	i


If you wanted to add a lot of words to the user dictionary quickly, it would be pretty trivial to write a script (or use a spreadsheet or similar) to generate the required entries.
USA #2
Hi Nick,
My ultimate goal is to be able to find misspellings in a description, provide the user with a list of the words misspelled, and if they so choose (because realms these days often have non-English recognized words) they can click on the word, and then select that they wish that the word be aded to their custom dictionary.

The problem i seem to be facing with the additional information that you've given me is that the file is currently being used by Mush (or rather, the spellchecking engine?), so I can't dynamically write to it.

Using the info you just gave me, I was able to make a .temp file with the words I wanted added to the dictionary, close out of mushclient, open the temp and the .txl and append the data... but I'm hoping to be able to share this script, and this doesn't seem like a really good solution.

Any thoughts?

Matt
Australia Forum Administrator #3
I have added a new script function AddSpellCheckWord to version 3.74 of MUSHclient.