Closed andreyorst closed 1 year ago
There's another package for language-tool which doesn't have this problem, though it seems abandoned, and has some other bugs.
Hi @andreyorst,
I checked mhayashi1120/Emacs-langtool before, as this package is based on it but diverges from the beginning (that is why is not a fork).
As far as I know, and taking a deep look into mhayashi1120 code, he didn't remove the current instance of the match, but instead, disables the whole rule, which could lead to unpleasant results.
For example,
Take the text:
You mai find all the things in Premium apb
LanguageTool will find two errors in en-GB (mai
and apb
), but if you decide to ignore mai
, adding its rule ID to the list of ignored rules (MORFOLOGIK_RULE_EN_GB), you will also ignore apb
as it shares the same rule ID.
This will be implemented in the future, as I know it leads to that confusion of being ignored and reappearing, but I will NOT follow the approach from mhayashi1120 code.
I got some ideas on how to implement this. And will do it soon.
I checked mhayashi1120/Emacs-langtool before, as this package is based on it but diverges from the beginning (that is why is not a fork).
Ah, sorry, I didn't know that. Your package really is an improvement over the older one.
LanguageTool will find two errors in en-GB (
mai
andapb
), but if you decide to ignoremai
, adding its rule ID to the list of ignored rules (MORFOLOGIK_RULE_EN_GB), you will also ignoreapb
as it shares the same rule ID.This will be implemented in the future, as I know it leads to that confusion of being ignored and reappearing, but I will NOT follow the approach from mhayashi1120 code.
I got some ideas on how to implement this. And will do it soon.
It didn't occur to me, but yes, this is indeed a problem to disable the rule altogether. I wonder if this can be done similarly to how Flyspell handles this problem.
In Flyspell you can add an unknown word to a current buffer, and it will create a comment like # LocalWords: mai apb
to the current buffer, and then ignore all words that are stored in this comment.
(ideally, it would be great to support LocalWords
directly, as I often use Flyspell when language-tool is unavailable)
Just added support to ispell
LocalWords
, and I notice that issues with more than two words are interpreted with no problems, but could lead to other issues. As far as I tested, there are none for now.
The package will add and take account of the LocalWords
in the current buffer. Take for example:
LanguageTool is your intelligent writing assistant for all common browsers and word processors. Write or paste your text here too have it checked continously.
# Local Variables: # languagetool-correction-language: "en-GB" # End:
LanguageTool marks too have and continously. If you ignore continously, and recheck the buffer, you will get:
LanguageTool is your intelligent writing assistant for all common browsers and word processors. Write or paste your text here too have it checked continously.
# Local Variables: # languagetool-correction-language: "en-GB" # End:
# LocalWords: continously
And then if you ignore too have and recheck, you will get.
LanguageTool is your intelligent writing assistant for all common browsers and word processors. Write or paste your text here too have it checked continously.
# Local Variables: # languagetool-correction-language: "en-GB" # End:
# LocalWords: continously too have
And the issues are successfully ignored. Will merge to master in a couple of days.
Add a similar behaviour as the LanguageTool extension, in c023cd6.
You can now choose between:
LocalWords
orI believe this is the best approach as it is both flexible and robust.
What version of Emacs are you running?
GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4) of 2022-10-23
What version of LanguageTool are you running?
LanguageTool version 5.7 (2022-03-28 18:24:41 +0000, 35d0d40)
What version of this package are you running?
1.1.0
What is the current behaviour?
What is you expect to happen?
What do you do to get this bug?
A file with the following contents:
Is highlighted like this:
After I call
languagetool-correct-buffer
and press C-i on all mistakes, the highlighting goes away:But after a short delay it comes back: