Bug 153948 - LanguageTool Server: changing language of a paragraph doesn't re-check grammar
Summary: LanguageTool Server: changing language of a paragraph doesn't re-check grammar
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.6.0 target:7.5.2
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-03 18:56 UTC by Mike Kaganski
Modified: 2023-03-08 03:24 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A sentence marked with wrong language (10.26 KB, application/vnd.oasis.opendocument.text)
2023-03-03 18:56 UTC, Mike Kaganski
Details
Screenshot with selected options. (81.63 KB, application/vnd.oasis.opendocument.graphics)
2023-03-03 23:12 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2023-03-03 18:56:51 UTC
Created attachment 185734 [details]
A sentence marked with wrong language

Pre-requisites:

1. Configure LibreOffice 7.4+ to use LanguageTool Server (Options->Language Settings->LanguageTool Server);
2. Disable Hunspell and Lightproof checkers for German (Germany) and English (USA), the two languages that are used in the test; make sure that LanguageTool is enabled for them. This is done at Options->Language Settings->Writing Aids, Available Language Modules section, [ Edit ] button; in the dialog, select the required language, and configure options;  select another language and repeat. Close the dialog, apply.

Reproduction:

3. Open the attachment. Make sure that automatic spell check is enabled (Shift+F7). The sentence is marked German (Germany), so should get underlined as misspelled; right-clicking the underlined words would show explanations and suggestions in German.
4. Tools->Language->For All Text->English (USA).

At this point, the spelling should get re-checked, and the spelling marks disappear. Actually, this doesn't happen. The underlines stay; and this is not an artifact. Clicking inside the paragraph shows English (USA) in the status bar, as expected; but right-clicking the "misspelled" words shows the same German explanations/suggestions.
Comment 1 m_a_riosv 2023-03-03 23:12:56 UTC
Created attachment 185740 [details]
Screenshot with selected options.

(In reply to Mike Kaganski from comment #0)
> Created attachment 185734 [details]
> ............
> At this point, the spelling should get re-checked, and the spelling marks
> disappear. Actually, this doesn't happen. The underlines stay; and this is
> not an artifact. Clicking inside the paragraph shows English (USA) in the
> status bar, as expected; but right-clicking the "misspelled" words shows the
> same German explanations/suggestions.
Forgive @Mike but works fine for me.
Version: 7.5.1.2 (X86_64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded

If needed, I could send you the profile.
Comment 2 Mike Kaganski 2023-03-04 04:58:54 UTC
(In reply to m.a.riosv from comment #1)
> Created attachment 185740 [details]
> Screenshot with selected options.

:-D Didn't you overlook the "Disable Hunspell and Lightproof checkers for German (Germany) and English (USA)", as shown on your first screenshot? I believe that you see the other checker in work, because of that.

You can tell one from another, if you look at the spelling error context menu. Hunspell does not decorate the topmost element with an icon (there is no explanation at all); LanguageTool has its explanation marked with an icon.
Comment 3 Commit Notification 2023-03-04 07:08:35 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5b9089a23757805ffdc852944d6483cf0db15121

tdf#153948: LanguageTool: cache the prepared request

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2023-03-07 10:31:04 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/6da66f1b6e86ac9b1305bdbb120077a2079600c6

tdf#153948: LanguageTool: cache the prepared request

It will be available in 7.5.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 m_a_riosv 2023-03-08 03:24:39 UTC
Sorry mike, I misinterpreted step 2, I did just the opposite.