I want “você” also to suggest “o senhor|a senhora”
And “vocês” also to suggest “os senhores|as senhoras”.
How do I change the suggestion line also to cope with this?:
<rule>
<pattern>
<token regexp='yes'>vocês?</token>
<token postag="R.+" postag_regexp='yes' min='0' max='2'/>
<token postag="V...3.+" postag_regexp='yes'>
<exception postag="VMN0000"/></token>
</pattern>
<message>O uso explícito do pronome "\1" pode ser interpretado como desrespeitoso. Considere remover o pronome ou substituí-lo pelo pronome de tratamente adequado.</message>
<suggestion><match no='2' include_skipped='all'/> <match no='3' include_skipped='all'/></suggestion>
<suggestion><match no='2' include_skipped='all'/> <match no='3' include_skipped='all'/></suggestion>
<short>Tratamento inapropriado</short>
<example correction="Tenha"><marker>Você tenha</marker> mais atenção ao promenor.</example>
<example correction="Não tenha"><marker>Você não tenha</marker> atenção, não…</example>
<example correction="diz">“O teu carro é maneiro.” — <marker>você diz</marker>.</example>
<example>Encontrei o seu casaco depois de você ter saído da casa.</example>
</rule>
The current 2 suggestions look identical to me.
And there is iclude_skipped in them, but no skip in the pattern
If you want to add the extra suggestion, simply add suggestion lines.
<!-- MARCOAGPINTO 2020-07-27 (2-JUL-2020+) Improved *START* -->
<rule>
<pattern>
<token regexp='no'>você</token>
<token postag="R.+" postag_regexp='yes' min='0' max='2'/>
<token postag="V...3.+" postag_regexp='yes'>
<exception postag="VMN0000"/></token>
</pattern>
<message>O uso explícito do pronome "\1" pode ser interpretado como desrespeitoso. Considere remover o pronome ou substituí-lo pelo pronome de tratamente adequado.</message>
<suggestion><match no='2' include_skipped='all'/> <match no='3' include_skipped='all'/></suggestion>
<suggestion><match no='1' regexp_match='você' regexp_replace='o senhor'/> <match no='2' include_skipped='all'/> <match no='3' include_skipped='all'/></suggestion>
<suggestion><match no='1' regexp_match='você' regexp_replace='a senhora'/> <match no='2' include_skipped='all'/> <match no='3' include_skipped='all'/></suggestion>
<short>Tratamento inapropriado</short>
<example correction="Tenha|O senhor tenha|A senhora tenha"><marker>Você tenha</marker> mais atenção ao promenor.</example>
<example correction="Não tenha|O senhor não tenha|A senhora não tenha"><marker>Você não tenha</marker> atenção, não…</example>
<example correction="diz|O senhor diz|A senhora diz">“O teu carro é maneiro.” — <marker>você diz</marker>.</example>
<example>Encontrei o seu casaco depois de o senhor ter saído da casa.</example>
</rule>
<rule>
<pattern>
<token regexp='no'>vocês</token>
<token postag="R.+" postag_regexp='yes' min='0' max='2'/>
<token postag="V...3.+" postag_regexp='yes'>
<exception postag="VMN0000"/></token>
</pattern>
<message>O uso explícito do pronome "\1" pode ser interpretado como desrespeitoso. Considere remover o pronome ou substituí-lo pelo pronome de tratamente adequado.</message>
<suggestion><match no='2' include_skipped='all'/> <match no='3' include_skipped='all'/></suggestion>
<suggestion><match no='1' regexp_match='vocês' regexp_replace='os senhores'/> <match no='2' include_skipped='all'/> <match no='3' include_skipped='all'/></suggestion>
<suggestion><match no='1' regexp_match='vocês' regexp_replace='as senhoras'/> <match no='2' include_skipped='all'/> <match no='3' include_skipped='all'/></suggestion>
<short>Tratamento inapropriado</short>
<example correction="Tenham|Os senhores tenham|As senhoras tenham"><marker>Vocês tenham</marker> mais atenção ao promenor.</example>
<example correction="Não tenham|Os senhores não tenham|As senhoras não tenham"><marker>Vocês não tenham</marker> atenção, não…</example>
<example correction="dizem|Os senhores dizem|As senhoras dizem">“O teu carro é maneiro.” — <marker>vocês dizem</marker>.</example>
<example>Encontrei os vossos casacos depois de os senhores terem saído da casa.</example>
</rule>
<!-- MARCOAGPINTO 2020-07-27 (2-JUL-2020+) Improved *END* -->
But TESTRULES PT-PT gives tons of warnings:
2650 rules tested.
Exception in thread “main” org.junit.internal.runners.model.MultipleFailureException: There were 10 errors:
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[6] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect suggestions: Tenha|O senhor tenha|A senhora tenha != Tenha|Você tenha on input: Você tenha mais atenç?o ao promenor.)
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[6] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect input:
Você tenha mais atenç?o ao promenor.
Corrected sentence:
Você tenha mais atenç?o ao promenor.
The correction triggered an error itself:
T-V_DISTINCTION[6]:0-10:O uso explícito do pronome “Você” pode ser interpretado como desrespeitoso. Considere remover o pronome ou substituí-lo pelo pronome de tratamente adequado.
)
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[6] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect suggestions: N?o tenha|O senhor n?o tenha|A senhora n?o tenha != N?o tenha|Você n?o tenha on input: Você n?o tenha atenç?o, n?o?)
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[6] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect input:
Você n?o tenha atenç?o, n?o?
Corrected sentence:
Você n?o tenha atenç?o, n?o?
The correction triggered an error itself:
T-V_DISTINCTION[6]:0-14:O uso explícito do pronome “Você” pode ser interpretado como desrespeitoso. Considere remover o pronome ou substituí-lo pelo pronome de tratamente adequado.
)
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[6] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect suggestions: diz|O senhor diz|A senhora diz != diz|o senhor diz|a senhora diz on input: ?O teu carro é maneiro.? ? você diz.)
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[7] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect suggestions: Tenham|Os senhores tenham|As senhoras tenham != Tenham|Vocês tenham on input: Vocês tenham mais atenç?o ao promenor.)
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[7] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect input:
Vocês tenham mais atenç?o ao promenor.
Corrected sentence:
Vocês tenham mais atenç?o ao promenor.
The correction triggered an error itself:
T-V_DISTINCTION[7]:0-12:O uso explícito do pronome “Vocês” pode ser interpretado como desrespeitoso. Considere remover o pronome ou substituí-lo pelo pronome de tratamente adequado.
)
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[7] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect suggestions: N?o tenham|Os senhores n?o tenham|As senhoras n?o tenham != N?o tenham|Vocês n?o tenham on input: Vocês n?o tenham atenç?o, n?o?)
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[7] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect input:
Vocês n?o tenham atenç?o, n?o?
Corrected sentence:
Vocês n?o tenham atenç?o, n?o?
The correction triggered an error itself:
T-V_DISTINCTION[7]:0-16:O uso explícito do pronome “Vocês” pode ser interpretado como desrespeitoso. Considere remover o pronome ou substituí-lo pelo pronome de tratamente adequado.
)
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule T-V_DISTINCTION[7] in file /org/languagetool/rules/pt/pt-PT/grammar.xml: Incorrect suggestions: dizem|Os senhores dizem|As senhoras dizem != dizem|os senhores dizem|as senhoras dizem on input: ?O teu carro é maneiro.? ? vocês dizem.)
at org.junit.runners.model.MultipleFailureException.assertEmpty(MultipleFailureException.java:67)
at org.junit.rules.ErrorCollector.verify(ErrorCollector.java:39)
at org.languagetool.rules.patterns.PatternRuleTest$PatternRuleErrorCollector.check(PatternRuleTest.java:74)
at org.languagetool.rules.patterns.PatternRuleTest.main(PatternRuleTest.java:685)
Running disambiguator rule tests…
Skipping variant: Portuguese (Portugal)
Disambiguator tests successful.
Running XML bitext pattern tests…
Bitext pattern tests successful.
Validating false-friends.xml…
Validation successfully finished.
Hard to tell from a hotel and on phone. But capitals seem to be wrong. And somehow the amount of suggestions is not the same always. You would not have to do the regexp replace here either, you could just add the word litterally.
If voces is always at the start of a sentence, require that using sent_start, if not, convert case in the suggestion.
Try one of these rules first, make diz into Diz and check case. Case conversion is als available if needed.