plugin Spell Checker

Plugins for SynWrite and CudaText...
A:C
Posts: 3
Joined: 16.12.2017 16:51

plugin Spell Checker

Post by A:C »

Hello and thank you for the Spell Checker so far.

I had a problem with a large dictionary (about 4MB).
If I double click on one of some larger words it won't be selected anymore. It seems this behavior comes from enchant because it takes too long time to compute word fail or pass.
Therefore I changed the single click to double click for later right click spelling suggestions.
Further I disabled suggestions if you use the 'remove all marks' command because it still wasn't responding nice.

I put my version of the init and install files here as attachment. You may have a look at them and feel free to use it.
It seems that json include was not used, so I removed it also.

Best regards
Andreas
Attachments
__init__.py
(15.77 KiB) Downloaded 165 times
install.inf
(1.32 KiB) Downloaded 207 times
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

Ok, I am applying the patch but without change of on_click->on_click_dbl, because its visible regression in functions. user needs the context menu update after usual click.
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

I see regression is spell check in big files.
file 2Mb:
https://www.learningcontainer.com/downl ... text-file/
dict: EN_US.

old plugin: full check was about 14 sec here.
new plugin: full check - 18 sec.

another moment: if I cancel (Esc key) checking of the file, and run full check again, new code works MUCH SLOWER, ie it needs 30-40 sec to check the file now. seems you needs to clear old markers from previous check.
pls help.
git: https://github.com/CudaText-addons/cuda_spell_checker
A:C
Posts: 3
Joined: 16.12.2017 16:51

Post by A:C »

Hi Alexey,

THX for review.

You are right. Inserting markers is very slow.
(Inserting: I mean delete some markers in between and add again if still markers afterwards exists)
Appending markers is still fast.

So I adapted back to delete all markers first and write new marker in a bunch.
My intention was to leave all not changed markers as they are. Especially if you only use a selection. But if speed is important we have to do it this way.

Also corrected a bug: Percents were displayed wrong if a selection was used.
Attachments
__init__.7z
Version 2
(4.86 KiB) Downloaded 171 times
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

this time I don't find mistakes. thanks for your work. publishing this.
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

issue with new code.
EDIT-- it is old issue, so don't worry.

- take 2 Mb file (lorem ipsum) linked above by me
- select 2nd sentence from the 2nd paragraph. (paragraphs are EOL+EOL separated).
- call 'Check text' - plugin underlines the entire paragraph no.2, but it must check only 2nd sentence.
A:C
Posts: 3
Joined: 16.12.2017 16:51

Post by A:C »

In the 'original' source the spell check minimum is to check one line.
The 2 MB file paragraphs are realized by long lines. If you switch off word-warp you will see that the check includes only one line.

I think I can change this behavior to only check real selected area if you want. This may help if you use 'check with suggestions'. Otherwise the whole 'paragraph' is processed. May not be what users want.
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

I just added this checking, was not hard.
king.midas
Posts: 40
Joined: 26.02.2019 13:47

Post by king.midas »

Hello!

Questions:
- Is there a setting to turn off all processing on a mouse click so that there is no delay from it? In the RMB menu, there is still no "add to dictionary" item, which is often necessary
- There is a problem (checked on an "empty" distribution), only the first word is added to the dictionary by the "Add" button, nothing happens after that, the dictionary will have only one word (if you delete it, you can add a new "one word" again) - Is this a bug or should I look for the reasons in the computer?
- For a portable installation, is it possible to store the "enchant" folder with custom dictionaries somewhere in the CudaText folder?

versions:
CudaText 1.177.1.0, win64-x86_64-win32, fpc 3.2.3
cuda_spell_checker 2022.09.29
king.midas
Posts: 40
Joined: 26.02.2019 13:47

Post by king.midas »

Also, even if you call the `Remove marks` command, it is impossible to select a word that was misspelled by double-clicking
Post Reply