Lembre-se de gravar as preferências das técnicas para que não tenha de as alterar manualmente constantemente.
So, I thought it could be simplified:
para que não tenha de → para não ter de
the “não” can be min=“0” max=“1”
There is still the problem of matching the “ter” with the singular or plural of the original sentence, but I can make some tests against a corpus of 600 000 sentences.
What name shall I give to the rule ID and its description? “Simplificar: Para + Que + [não] + Verbo ter + de → para + [não] + Verb Ter + de”
This is my biggest difficulty, I am terrible at picking the names.
Also, I need your advice if the last token should be limited to “de” or if we can also use other tokens (prepositions).
on naming: it seems that there are other rules similar to this one as in “Ele disse que tem aulas → Ele disse ter aulas”, maybe it is useful to see the names for these rules and create one for all these cases; one idea “Usar a versão com infinitivo da subordinada”
on other prepositions: not a preposition, but in Brazil we use ‘que’ also ‘para que não tenha que’
<!-- USAR EXPRESSÕES MAIS SIMPLES SUGERINDO VERBOS NO INFINITIVO -->
<rulegroup id='SIMPLIFICAR_CONVERTER_PARA_VERBO_INFINITIVO' name="Simplificar: Usar a versão com infinitivo da subordinada" type="style">
<!-- Created by Marco A.G.Pinto with Ricardo Joseh Lima suggestions, Portuguese rule 2022-02-04 (1-JAN-2022+) -->
<!--
#1 - 1/2:
Grave as preferências para que não tenha de as alterar constantemente. → Grave as preferências para não ter de as alterar constantemente.
#2 - 2/2:
Grave as preferências para que tenha de as alterar constantemente. → Grave as preferências para ter de as alterar constantemente.
-->
<!-- RULE #1 - PARA QUE <NÃO> TENHA → PARA <NÃO> TER - 1/2 -->
<!--
Grave as preferências para que não tenha de as alterar constantemente. → Grave as preferências para não ter de as alterar constantemente.
-->
<rule>
<pattern>
<token>para</token>
<token>que</token>
<token postag='RN' postag_regexp='no'/>
<token postag='VMM0.+' postag_regexp='yes'>
<exception postag_regexp='yes' postag='VM[^MS].+'/>
</token>
</pattern>
<message>Em certos contextos, esta perífrase pode ser simplificada.</message>
<suggestion>\1 \3 <match no='4' postag='VMM0(.)(.)0' postag_regexp="yes" postag_replace='VMN0$1$20'/></suggestion>
<example correction="para não ter">Grave as preferências <marker>para que não tenha</marker> de as alterar constantemente.</example>
</rule>
<!-- RULE #2 - PARA QUE TENHA → PARA TER - 2/2 -->
<!--
Grave as preferências para que tenha de as alterar constantemente. → Grave as preferências para ter de as alterar constantemente.
-->
<rule>
<pattern>
<token>para</token>
<token>que</token>
<token postag='VMM0.+' postag_regexp='yes'>
<exception postag_regexp='yes' postag='VM[^MS].+'/>
</token>
</pattern>
<message>Em certos contextos, esta perífrase pode ser simplificada.</message>
<suggestion>\1 <match no='3' postag='VMM0(.)(.)0' postag_regexp="yes" postag_replace='VMN0$1$20'/></suggestion>
<example correction="para ter">Grave as preferências <marker>para que tenha</marker> de as alterar constantemente.</example>
</rule>
</rulegroup>
It gives 290 hits, and they seem all valid after my quick scroll look in the results.
Here is attached the results: afternew5.txt (139.2 KB)
Do you find any mistakes?
There are some verbs that appear between “()” in the suggestions, maybe they have an incorrect POS. I will try to fix them in the next months.