languagetool-org / languagetool

Style and Grammar Checker for 25+ Languages
https://languagetool.org
GNU Lesser General Public License v2.1
12.26k stars 1.38k forks source link

[pt] Disambiguator improvement: SPS00 to DA - 2022-10-01 #7150

Open marcoagpinto opened 1 year ago

marcoagpinto commented 1 year ago

Hello @jaumeortola

Take a look at these two sentences:

Tom tem dinheiro suficiente para comprar a casa que quer.
Tom tem dinheiro suficiente para comprar o carro que quer.

In the first one, “comprar a casa” turns “a” into SPS00.

In the second one, “comprar o carro” turns “o” into DA blah blah.

Could the disambiguator be improved to show also “a” as DA blah blah?

Thanks!

jaumeortola commented 1 year ago

I resolved the issue for this sentence. But the disambiguation of a (SPS00 vs. DA0FS0) is quite hard. Let's leave the issue open, and collect more examples of wrong disambiguation for a.

https://github.com/languagetool-org/languagetool/commit/a2fc03f5f3496c68e3d613e0f6fe6170b24250c8

marcoagpinto commented 1 year ago

@jaumeortola

I am almost certain that if you have an infinitive verb followed by an “a” it returns SPS00.

Or maybe infinitive + “a” + noun

So, it is easier to fix than it seems, at least for this case.

marcoagpinto commented 1 year ago

I had a busy night fixing false positives in my thesis, like you can see from the numerous commits.

❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️

jaumeortola commented 1 year ago

I am almost certain that if you have an infinitive verb followed by an “a” it returns SPS00.

Yes. There is a subrule of A_PREPOSTION doing exactly that (with some exceptions), and it has a comment that says it is "too aggressive".

So, with infinitive + “a” + noun or even verb + “a” + noun, is a always a determiner?

marcoagpinto commented 1 year ago

So, with infinitive + “a” + noun or even verb + “a” + noun, is a always a determiner?

Vamos comprar a casa.
Vamos comprar o carro.

It seems so.

marcoagpinto commented 1 year ago

I am not sure if it is only with infinitive.

marcoagpinto commented 1 year ago

but with infinitive it seems to happens.

marcoagpinto commented 1 year ago

When I say nouns, maybe I should also say adjectives?