3.84 and Dictionaries

Posted by Balerion on Tue 06 Feb 2007 12:19 PM — 11 posts, 30,749 views.

#0
I've found that when I start MUSHclient, the old spellchecking is not enabled despite it being checked in Global Preferences > General. I have to go there, turn on the custom spellchecking, let it load the custom dictionaries, then go back and uncheck the custom box before I can use the default.

Is this a common problem, and is there any way to get around having to keep doing this?
#1
Hrm .... I take it this is expected behavior? Could the next version change this, maybe? :)
Australia Forum Administrator #2
Sorry for the slow reply.

Yes, it seems to do as you describe. There must be some sequencing problem in the way it handles the new and old spellcheck methods.

To be honest, I am thinking of phasing out the old spellchecker, as part of a program of ongoing improvements.

Is there any major reason why you don't simply use the new spellchecker?
#3
The dictionaries aren't quite as good as the old spellchecker's, but that's mostly laziness on my part. That said, when I use the experimental spellchecker, most of my worlds hang on startup (I have it connect to worlds in my global list when it starts) and I think it's because of the process of loading the dictionaries for the spellchecker that does it. I have to disconnect and reconnect to get them to connect properly.
Australia Forum Administrator #4
I can't reproduce that. It should only load the dictionary once, as it is a global thing, not per-world. Does it load the dictionary successfully?
#5
Yeah. It does load it once, but the window showing the progress of the dictionaries (which are the package you've pointed to) loading definitely seems to be affecting the connection the process. The worlds are stuck in a hung state. If I disable the spellchecker, close the client, and start again, the connections happen normally.
Australia Forum Administrator #6
Try editing the file spellchecker.lua which implements the new spellchecker. This will be in the same directory as MUSHclient.exe. Near the bottom will be the following lines, delete (or comment out) the lines in bold:


  -- local dlg = progress.new ("Loading dictionaries ...")
  
  -- dlg:range (0, #files)
  -- dlg:setstep (1)
  
  for k, v in ipairs (files) do
    ok, result = pcall (function () 
                          read_dict (dlg, v) 
                        end)
    if not ok then 
      -- dlg:close ()
      error (result)
    end -- not ok
  end -- reading each file
  
  -- dlg:close ()



Also a bit further up, you need to delete or comment out some other lines:


-- read one of the dictionaries
local function read_dict (dlg, name)
 -- dlg:step ()
 -- dlg:status (directory .. name)
 -- if dlg:checkcancel () then
 --   error "Dictionary loading cancelled"
 -- end -- if
  for line in io.lines (directory .. name) do
     insert_word (line) 
  end 
end -- read_dict


I have commented them out (the "--" part will not be in the original). Then try again.
#7
Does seem to have fixed the problem. Thanks. :)
#8
Just to update here, 4.0 also still has the sequencing problem with the old spellchecker (first noted in the original post).

Is there any way to correct this bug so I don't have to load the custom dictionaries then uncheck it? Until someone updates the LUA-based spellchecker with some sort of configuration dialog and the ability to skip capitalized words, I'd prefer to use the old one.
Australia Forum Administrator #9
I am not planning to continue supporting the proprietary spell checker. I suggest upgrading to version 4.01, and considering making changes to the spellchecker.lua file to skip capitalized words. You could edit spellchecker.lua, and around line 142, add the extra code in bold:


-- check for one word, called by spellcheck (invokes suggestion dialog)
local function checkword_and_suggest (word)

  -- ignore words starting in caps
  if string.find (word, "^[A-Z]") then
    return word, "ignore"
  end -- ignore word starting with A-Z

  uc_word = make_upper (word)  -- convert to upper-case if wanted


#10
That's a shame. The proprietary spellchecker is (currently) better than the LUA script, in terms of ease of use and speed. I do hope someone develops dialogs for it once the source is released (or maybe someone will look into integrating something like Aspell -- that'd be very nice).

Is there any way to get MUSHclient to load and then unload the spellchecker automatically on startup, perhaps? That seems to work to make the proprietary spellchecker function, and it would be a minimal hassle for a user.