Spell Checker No Longer Finds Dictionary

Plugins for SynWrite and CudaText...
Post Reply
Random Void User
Posts: 56
Joined: 13.07.2024 21:19

Spell Checker No Longer Finds Dictionary

Post by Random Void User »

(CudaText 1.224.0.0, linux-x86_64-gtk2, fpc 3.2.3)

Spell checking worked until now. I get this dialog box:

Code: Select all

Dictionary for language 'en_US' could not be found
Please check https://pyenchant.github.io/pyenchant/ for details
Yet I have correct Linux packages installed. The Python console traceback:

Code: Select all

Init: cuda_spell_checker
Traceback (most recent call last):
  File "/redacted/cudatext/py/cuda_spell_checker/__init__.py", line 525, in check
    do_work(ed, False, True)
    ~~~~~~~^^^^^^^^^^^^^^^^^
  File "/redacted/cudatext/py/cuda_spell_checker/__init__.py", line 420, in do_work
    res = do_check_line(editor, nline, x_start, x_end, with_dialog, check_tokens)
  File "/redacted/cudatext/py/cuda_spell_checker/__init__.py", line 326, in do_check_line
    if dict_obj.check(sub):
       ^^^^^^^^
NameError: name 'dict_obj' is not defined
ERROR: Exception in CudaText for check: NameError: name 'dict_obj' is not defined
main Alexey
Posts: 2538
Joined: 25.08.2021 18:15

Re: Spell Checker No Longer Finds Dictionary

Post by main Alexey »

console error shows because plugin cannot import the 'enchant' lib or cannot create Dict() object.
i guess smthing is broken in the installation of Enchant in your system?
can you try these steps in the Terminal:

1.
$ pip3 install pyenchant
(this installs python Enchant lib)

2.
$ python3
>>> import enchant
>>> dict_obj=enchant.Dict('en_US')
>>> dict_obj
<enchant.Dict object at 0x7af4e825af20>

as you see I run Python, then in the python I entered 3 commands. all works for me, Dict() obj created.
main Alexey
Posts: 2538
Joined: 25.08.2021 18:15

Re: Spell Checker No Longer Finds Dictionary

Post by main Alexey »

and check what available dicts you have.
call in CudaText: Options / Settings-plugins / Spell checker / Select languge
it shows menu for me with 4-6 langs:

en
en_US
en_GB
etc.
what does it show for you?
Random Void User
Posts: 56
Joined: 13.07.2024 21:19

Re: Spell Checker No Longer Finds Dictionary

Post by Random Void User »

Yes my system was broken. CudaText now works. Maybe Void Linux rearranged its packages. CudaText spelling always worked before. I had hunspell dictionaries for a long time, plus aspell stuff. Anyway, I just installed two more Void packages, and CudaText works again:

Code: Select all

$ sudo xbps-install -S enchant2-hunspell python3-enchant
P.S. I would not use pip these days, uv or distro packaging is best.

Thanks!
main Alexey
Posts: 2538
Joined: 25.08.2021 18:15

Re: Spell Checker No Longer Finds Dictionary

Post by main Alexey »

PIP is familiar to me. I use Ubuntu and APT is less familiar (and for Void / Arch we have totally different systems).
Post Reply