languagetool icon indicating copy to clipboard operation
languagetool copied to clipboard

[pt] Main suggestion not appearing

Open ricardojosehlima opened this issue 10 months ago • 8 comments

Hi, I'm using the premium version on Google Docs and for "ja", the main suggestion that should be "já" does not appear, as seen in the attached file. Screenshot 2024-04-09 08 03 50

ricardojosehlima avatar Apr 09 '24 14:04 ricardojosehlima

Can't repro this anywhere, on either premium or OS, on any client. Local tests with the latest released version likewise show as the first suggestion 🤔

Is this behaviour limited to Google Docs? (That would be even weirder, but you never know...)

p-goulart avatar Apr 09 '24 17:04 p-goulart

Yeah, that's weird because for sure, before the suggestion was 'já', it hasn't been like this. It happened on Canva too. I'm using Google Chrome in Windows 11.

ricardojosehlima avatar Apr 09 '24 18:04 ricardojosehlima

@ricardojosehlima can you confirm this is still occurring? We have since then released new dictionary binaries.

p-goulart avatar Apr 16 '24 15:04 p-goulart

@p-goulart Hi, not only it persists, now it has been joined by a new "friend", look at the attached image. What I have observed is that in those suggestions for "não" there are words that I have inserted in the dictionary (Naro, Nham), same for "ja" (JP, Jh, 2A) Captura de tela 2024-04-16 141343

ricardojosehlima avatar Apr 16 '24 17:04 ricardojosehlima

Aha. That was the piece of the puzzle I was missing. Now I can repro. Added JAX to my personal PT dictionary and akreayd to my personal EN dictionary... and lo and behold:

Screenshot 2024-04-16 at 7 21 29 PM Screenshot 2024-04-16 at 7 24 57 PM

This is, for now, 'expected behaviour', in that words from the user's personal dictionary are ordered first in the speller's suggestions... But I 100% see the usability issue.

@jaumeortola, thought you might be interested. Do you know of a quickfix before I start investigating?

p-goulart avatar Apr 16 '24 17:04 p-goulart

We are giving top priority to all suggestions from user dicts. See, for example: https://github.com/languagetool-org/languagetool/blob/07d276b76035fba10f731b8b3625a65508c0c597/languagetool-core/src/main/java/org/languagetool/rules/spelling/morfologik/MorfologikSpellerRule.java#L595

Maybe for short words (up to 4 or 5 characters), we should change that priority. That would mean probably ignoring the user words.

A quicker fix is to add these frequent errors to a simple replace rule: ja=já nao=não sao=são

jaumeortola avatar Apr 16 '24 18:04 jaumeortola

I think the replacement rule is a good idea, specially for nao and sao. For ja, maybe it was another word intended different from "já", but it may be rare. As for prioritizing the user dicts, after some time no suggestion from LT will appear, if the user inserted some 4 or 5 words that look like the error. But as @jaumeortola pointed, maybe for small words it shouldn't be so and the priority could hold for longer words.

ricardojosehlima avatar Apr 16 '24 18:04 ricardojosehlima

@ricardojosehlima a solution was committed by @jaumeortola at add8cee980e that specifically targets short words. If it causes no problems, it will be released to the premium version some time next week.

p-goulart avatar Apr 18 '24 07:04 p-goulart