I don't think it would be too hard. Before making MUSHclient open-source I replaced the proprietary spell-checker (the same one used in the SMAUG editor) with a custom one I wrote mainly in Lua.
The dictionaries I found at an open-source dictionary site. Some are already available at this site in the MUSHclient downloads area:
http://www.gammon.com.au/files/mushclient/dicts.zip
To add the same thing into SMAUG you would basically grab the MUSHclient source, search for the parts that invoke the Lua spellchecker, and build those in. Since they were both written in C++ this shouldn't be too hard.
Basically you:
- Create a Lua script space when the program starts, and load the spellchecker file (the Lua file) into it, so it reads its dictionary.
- Release that script space at program close (probably not really necessary).
- Have a function that calls the Lua script when required.
See
http://www.gammon.com.au/scripts/doc.php?general=spellcheck for the interfaces in MUSHclient.
I think I had to add a couple of extra functions to the Lua space (EditDistance and Metaphone), to help it build a list of suggested alternatives, if that was wanted.
The function in MUSHclient that spellchecks a string is:
http://www.gammon.com.au/scripts/doc.php?function=SpellCheck
There are almost certainly C libraries as well that could do it, and you could always call ispell from a shell script.
However I found my approach was reasonably fast and flexible, and at least I knew what I was doing and didn't need to install heaps of extra libraries and/or files to make it work.
You would be welcome to use the file spellchecker.lua that ships with MUSHclient - that does the reading in of the dictionaries, and compares your string of words to the dictionary.
Search the MUSHclient source for m_SpellChecker_Lua - that will find most of the references to the spell checking interface.