Get TRVSpellChecker to Update

General TRichView support forum. Please post your questions here
Post Reply
standay
Posts: 274
Joined: Fri Jun 18, 2021 3:07 pm

Get TRVSpellChecker to Update

Post by standay »

Hi Sergey,

I'm using my own popup menu for spelling. I used this before with my Hunspell stuff and it worked there. It works ok with the TRVSpellChecker as well until I add or remove a word from the system user dictionary.

I get the system user dictionary using:

Code: Select all

GetEnvironmentVariable('APPDATA') + '\Microsoft\Spelling\neutral\default.dic'
Adding and removing a user dict word works fine, the given word adds or removes as is should. But the rve spelling UI (the "red squiggles") don't update consistenly after that.

How do I do a full refresh or re-check of the rve spelling when needed to get all the "red squiggles" showing correctly?

Any ideas appreciated.

Stan
Sergey Tkachenko
Site Admin
Posts: 17563
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Get TRVSpellChecker to Update

Post by Sergey Tkachenko »

It is expected that you add words in a dictionary using TRVSpellChecker.AddToDictionary.
In this case, for all editors registered by TRVSpellChecker.RegisterEditor, this word is validated automatically. If you did not register an editor, call Editor.LiveSpellingValidateWord.

As for removing a word from a dictionary, it is not implemented by TRVSpellChecker, because I thought that this function is rarely used. And there is no way to re-check only the removed word. You need re-check editors from the beginning (Editor.ClearLiveSpellingResults; Editor.StartLiveSpelling).
standay
Posts: 274
Joined: Fri Jun 18, 2021 3:07 pm

Re: Get TRVSpellChecker to Update

Post by standay »

Hi Sergey,

Thanks for the confirmation of how things are working. I was doing it that way. It looks like the main issue was I still didn't have all my old spell check stuff removed. Once I cleaned it all out, it appears to be working OK now.

I like to be able to remove a word I might accidentaly add into the user dictionary. I get to clicking things too fast and I will do that from time to time so it's nice to be able to pulla wrod out when needed.

The Hunspell stuff worked OK and usually had more suggestions for words, but not needing the dll and dictionary files anymore is really nice.

Stan
Sergey Tkachenko
Site Admin
Posts: 17563
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Get TRVSpellChecker to Update

Post by Sergey Tkachenko »

I am considering adding HunSpell as a fallback option for Windows (for older OS that do not support spellchecking). In this case, there may be an option to use HunSpell even if a native OS checker is available.
TRVSpellChecker already has code working with HunSpell, it is used for Linux, so it will not require too much work.
But it would require more settings. In Linux, Hunspell library and dictionary location is fixed. In Windows, DLL and dictionary location must be specified.
standay
Posts: 274
Joined: Fri Jun 18, 2021 3:07 pm

Re: Get TRVSpellChecker to Update

Post by standay »

Sergey Tkachenko wrote: Tue Jul 09, 2024 2:27 pm I am considering adding HunSpell as a fallback option for Windows (for older OS that do not support spellchecking). In this case, there may be an option to use HunSpell even if a native OS checker is available.
This would be a good option to have although I'm very happy with the basic OS sp checking.

You mentioned somewhere that you might be able to get the OS check to use 2 languages (dictionaries) at a time. This is an option I'd use. I like to have both US and UK checks on words. If the word passes either language it's OK. That's how I had my Hunspell stuff set.

Thanks Sergey

Stan
Sergey Tkachenko
Site Admin
Posts: 17563
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Get TRVSpellChecker to Update

Post by Sergey Tkachenko »

The current implementation of TRVSpellChecker uses only one selected language (dictionary).
I plan to implement using several dictionaries in future versions.
Post Reply