Closed ricardojosehlima closed 2 years ago
@ricardojosehlima
I don't understand.
"possível" comes from the verb "poder", if I say "pode ser possível" it is redundant, if it is "possível" I don't need the "pode". Should be "deve ser possível" or simply "é possível".
Ahhhhh… 😄
I will fix it tonight, or maybe Susana will.
It is in my nightly TO-DO list.
😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄
What is the rule ID, by the way?
Or the sentence that triggers it?
LT doesn't flag it, and it should. The pattern could be the verb "poder" and its variants "pode, poderá, poderia, pôde" + ser + possível (also all this, except "ser" in the plural "podem ser possíveis", etc)
ahhhhh…
a rule
If I do it at 5am, is it too long from now?
I am very stressed.
Well, I only woke up now… 😢 😢 😢 😢 😢 😢 😢
Almost 10am.
Let me code it.
@ricardojosehlima
I have it working:
<!-- PODER SER POSSÍVEL deve ser possível -->
<rule id='PODER_SER_POSSIVEL' name="Redundância: Poder/possível">
<!-- Created by Ricardo Joseh Lima and improved by Marco A.G.Pinto, Portuguese rule 2022-08-25 (25-JUL-2022+) -->
<!--
A vitória pode ser possível. → A vitória deve ser possível.
-->
<antipattern>
<token postag='V....P.+' postag_regexp='yes'/>
<token>ser</token>
<token>possíveis</token>
<example>As vitórias podem ser possíveis.</example>
</antipattern>
<pattern>
<marker>
<token inflected='yes'>poder</token>
</marker>
<token inflected='yes'>ser</token>
<token regexp="yes">possível|possíveis</token>
</pattern>
<message>Possível redundância com poder/possível. Substitua por:</message>
<suggestion><match no='1' postag='VMI.+' postag_regexp='yes'>dever</match></suggestion>
<example correction="deve">A vitória <marker>pode</marker> ser possível.</example>
</rule>
Portuguese (Portugal): 8 total matches
Portuguese (Portugal): 582235 total sentences considered
Portuguese (Portugal): ø0.00 rule matches per sentence
Please check if all is okay: 2.txt
Also, if you have any suggestion for the rule name and suggestion message, we could use it.
Thanks!
The pattern could be the verb "poder" and its variants "pode, poderá, poderia, pôde" + ser + possível (also all this, except "ser" in the plural "podem ser possíveis", etc)
The "except "ser" in the plural"
confuses me, could you explain better?
Also, I need to add as suggestion: “é possível”, but what about “são possíveis”?
In the 2.txt all sentences use "ser” and not “é”.
Ahhh... the "é possível" and "são possíveis" is easy to code, I can base the number in "possível/possíveis".
@ricardojosehlima
https://github.com/languagetool-org/languagetool/commit/6920aeae18113830473e3ecea943db5869d36b9f
It now suggests the "é/são possível/possíveis"
Now it accepts "poder" in infinitive: https://github.com/languagetool-org/languagetool/commit/3dbe4541aa9aec84c328ffea375ac32ca97cc997
Good job! And your suggestion is better than mine, it must remain.
@ricardojosehlima
I must recommit the latest changes as I forgot to update my local copy of grammar.xml and I believe I had damaged the repository.
But I am not sure, I will recommit it tomorrow afternoon.
or tonight, as I have taken a Xanax and now I feel calm 🤣 🤣 🤣 🤣 🤣 🤣
@ricardojosehlima
!!!
Xanax and Coca-Cola: https://github.com/languagetool-org/languagetool/commit/3cd9f0762020a0c35422384489fce98a825b4f7f
Although not violating any grammatical rule, "pode ser possível" is stylistically strange, for it repeats "poder" twice in a sense. LT doesn't flag anything wrong with it nor its variants ("poderia ser possível", "podem ser possíveis", and so on). It may be worth a look and seems one of the stylistic rules that @marcoagpinto appreciates and creates.