ENB: Completing the default spell checker

24 views
Skip to first unread message

Edward K. Ream

unread,
Feb 10, 2018, 6:03:54 AM2/10/18
to leo-editor
Several tricky issues remain.  I am also fixing some bugs as I write ;-)  This will be pre-writing for documentation for the default spell checker.

User interface

What, and when, to tell the user when the main spelling dict does not exit? Imo, the spell checker should not pollute the startup log warnings, nor would users notice such warnings.  Otoh, silently ignoring the absence of the main spelling dict means that users will take awhile to notice that the spell checker doesn't know any words!

There at least two possibilities:

1. Disable the default spell checker if the main spelling dict can not be found.  This is kinda a return to the status quo ante, except that the user only needs to install the main spelling dict to have a fully functional spell checker.

2. Warn the user that the main spelling dict can not be found just the first time the user clicks the "spell" button.  This is more informative, but the spell checker is still essentially useless.

<aside>

The default check looks for the main spelling dict in one of two places:

- The path specified by @string main_spelling_dictionary
- In ~/.leo/main_spelling_dict.txt

Note that this issue does not exist for the pyenchant checker because the pyenchant module knows where its main dictionary is without being told.

Neither spell checker ever creates this file automatically, nor should they. 

</aside>

A better main dictionary

When I awoke this morning I saw that bugs might prevent some words that are actually in the main dictionary from being recognized.  I'll double check the code today.

However, I strongly suspect that the hunspell dict that has been uploaded to SourceForge is inadequate.  That's not terribly surprising.  I generated the .txt file from a script.  Heh.  Not sure where just now.

But when I awoke I also saw that it might be possible to generate a default main dict (a text file) from pyenchant's main dict!  This file is compressed in the pyenchant folder, but it may be possible to iterate through all its contents using pyenchant's api. We shall see. If so, this would resolve #711: Create bigger default spelling dicts.

Distribution

The default dict on SourceForge is a plain text file.  It should be compressed using a standard compression scheme, not some shell script as is apparently needed when using hunspell compressed folders.  The documentation will then have to explain how to unpack the file and where to put the result.

Summary

I closed #700 a bit prematurely.  Considerable work remains before the default spell checker is ready for prime time.

Edward

Edward K. Ream

unread,
Feb 10, 2018, 1:46:08 PM2/10/18
to leo-editor
On Saturday, February 10, 2018 at 5:03:54 AM UTC-6, Edward K. Ream wrote:

> What, and when, to tell the user when the main spelling dict does not exit?

Rev 0d17787 shows the Spell Tab only if a main dict exists in ~/.leo/main_spelling_dict.txt. The main dict always exists (in a different location) when pyenchant has been installed.

The show-spell-info command works even if the main dict does not exist.  In that case, the command explains in detail why there is no Spell Tab.  Imo, this is more than a good enough solution.

To do

- Document the new behavior in the release notes.

- Add a FAQ entry about the default spell checker. It will mention @string main_spelling_dictionary.

- Add an empty @string main_spelling_dictionary.to leoSettings.leo.  It's pointless to give a default.

- Improve the main dict before 5.7 final. This project will not delay 5.7b2.

Summary

Leo now works much like Leo 5.6 when ~/.leo/main_spelling_dict.txt does not exist. This is plenty good enough even for 5.7 final.

Edward
Reply all
Reply to author
Forward
0 new messages