Bug 459113 - bad replacement by Language Tool
Summary: bad replacement by Language Tool
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: composer (show other bugs)
Version: 5.21.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-14 16:03 UTC by Philippe ROUBACH
Modified: 2022-09-15 11:58 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 22.08.2


Attachments
before fixing grammar (153.62 KB, image/png)
2022-09-14 16:03 UTC, Philippe ROUBACH
Details
after fixing grammar (153.22 KB, image/png)
2022-09-14 16:04 UTC, Philippe ROUBACH
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe ROUBACH 2022-09-14 16:03:26 UTC
Created attachment 152055 [details]
before fixing grammar

Read the message in LT_fixing_1.png.
There is a sentence "- qui empêche tout passage dans l'herbe".
LT offers to replace "dans" by "sur"
I accept.
Result : "- qui empêche tout passagesurs l'herbe"
Read the replacement in LT_fixing_2.png.

For one message I get many bad replacements like this, for example "facile" by "facile,e".

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
KE Gears 2022.08.1

ADDITIONAL INFORMATION
Comment 1 Philippe ROUBACH 2022-09-14 16:04:06 UTC
Created attachment 152056 [details]
after fixing grammar
Comment 2 Laurent Montel 2022-09-14 18:52:57 UTC
Ok I can reproduce bug.
It's a bug when we replace an element with a size != from element that we want to replace.
=> after that you replace another one which doesn't have correct position.
I need to update all position.
Comment 3 Laurent Montel 2022-09-15 07:03:25 UTC
In progress.
I fixed some bugs. I added autotest. But not perfect yet.
It works when all text is in one block not when it's two blocks.
Comment 4 Laurent Montel 2022-09-15 11:58:40 UTC
Git commit 42325595ebc81460e90bb3db5820c8f02cd7c2c9 by Laurent Montel.
Committed on 15/09/2022 at 11:57.
Pushed by mlaurent into branch 'release/22.08'.

Fix bug 459113: bad replacement by Language Too

FIXED-IN: 22.08.2

M  +124  -0    kmail/grammarplugins/grammarcommon/autotests/grammarresultutiltest.cpp
M  +1    -1    kmail/grammarplugins/grammarcommon/grammarresulttextedit.cpp
M  +26   -32   kmail/grammarplugins/grammarcommon/grammarresultutil.cpp
M  +1    -1    kmail/grammarplugins/languagetool/src/languagetoolgrammarerror.cpp
M  +1    -1    kmail/grammarplugins/languagetool/src/languagetoolparser.cpp

https://invent.kde.org/pim/kdepim-addons/commit/42325595ebc81460e90bb3db5820c8f02cd7c2c9