New spell checker - does it work, or not?

Posted by Nick Gammon on Mon 18 Dec 2006 08:18 PM — 9 posts, 39,714 views.

Australia Forum Administrator #0
About 2 months ago MUSHclient version 3.81 was released with a new custom spellchecker, see this post for details:

http://www.gammon.com.au/forum/?id=7403


Since that time I have had no complaints about it, other than a comment that the suggested words were not in a very sensible order, a problem that was fixed in version 3.82.

To help me decide whether it is time to pull out the old spell checker, and make the new one the default, I am interested to know if anyone is using the new one, and if so, if they are happy with it? The lack of feedback indicates to me that either:

  • The new one works perfectly; or
  • No-one is using it


The new spell checker has a number of advantages over the old one, namely:

  • It does not rely upon a proprietary engine
  • It can be customized to your taste (eg. to ignore the first word in a line)
  • The dictionaries are human-readable
  • You can easily extend the dictionaries, or choose your own ones
  • You can install dictionaries for different languages


Any comments you may have will be appreciated.
USA #1
Can you import the OLD speelczecher's defenition files to the new spellchecher?. I have several custom files for names, MUF and MPI commands & def and MUCK specific words that I've been building the last few years and I don't really want to have to teach this new checker if I have too.
Australia Forum Administrator #2
I think you can import them easily enough. Open the file userdic.tlx in your spell directory. Inside should be a heap of "user" words. There will also be a letter at the end of each line, like this:


Beddington	i
Nepean	i
SSCE	i
Wintertree	i


You need to get rid of that final letter. If you open the file in the built-in notepad, you can use the Search menu -> Global Replace, to do that.


Find pattern: ^([%a%d]+)%s+%a$
Replacement: %1
Line by line: checked


Running that on the entire file should remove the final letter. Then you can save it as userdict.txt in the spell directory, and it should be your new user dictionary.

Make sure you have downloaded the dictionary files here:

http://www.gammon.com.au/files/mushclient/dicts.zip

Both userdict.txt and the files in that zip file go into your "spell" directory under the MUSHclient directory. Then go to Global Preferences -> General, and check "Custom" next to the "Enable spell check" and see what happens.
USA #3
I was going to try this out, but I only use script based spellchecking, not via the input line, so since the spellcheck scripting functions aren't synced yet with the new system, I can't really do much with it right now.

Sorry.
Australia Forum Administrator #4
It should be. The later versions call the function spellcheck_string in the spellchecker file. This should work properly.
USA #5
Nick,

It isn't working as the previous spellchecker was, at least for my scripts which I may be doing something wrong.

Here's my SpellCheck.xml plugin. When enabled (type spellcheck), it checks any line that begins with high or low white for spelling errors. If it finds an error, it'll put in the line below that there is an error with the following output:
SPELLCHECK: Silax [add this word] [suggestions]

Clicking add this word should add it to the dictionary, and clicking suggestions opens up the GUI for suggestions - which also has a button to add the word.

When I hit suggestions, then add, then close the window and look at the room again - it still shows the line under the word (Silax, for example). However, when I hit suggestions, it immediately thinks I have a valid word and kicks me out of the GUI for that and just sends me back to the world.

I have to use the script based "add this word" to get the spellchecker to ignore that word.

The commands I'm using inside the script are:
SpellCheck(b)
(checks the line for spelling errors)
world.AddSpellCheckWord (wild(1), "i", "")

To open the GUI, I use this trick

sub suggest_word(a,b,c)
  world.PushCommand
  world.setcommand c(1)
  result = spellcheckcommand(0,0)
  if result = 1 then
    result = world.GetCommand
    result = "/r" & c(1) & "/" & result
    world.PushCommand
    world.SetCommand result
  else
    world.PushCommand
  end if
end sub

where I pass the word i want as c(1).

Hope that was clear enough...


Matt
USA #6
Er, I meant to paste the link to the script. Here it is:

http://www.mononexo.com/downloadtrack/?url=&dlid=12
Amended on Mon 01 Jan 2007 11:45 PM by MattMc
Australia Forum Administrator #7
I can't really reproduce this. It seems to me that after doing an Add the word does not appear as a misspelling next time around.
Australia Forum Administrator #8
I'm not sure about your technique for forcing the GUI dialog box up. I have added a new function to version 3.85 that lets you call the GUI interface directly.