Back to LanguageTool Homepage - Privacy - Imprint

[pt] Problem creating antipattern - 2020-09-30

@jaumeortola

Hello Jaume,

Sorry to bother you all the time.

I have been trying to fix: GENERAL_GENDER_AGREEMENT_ERRORS

I created:

<!-- MARCOAGPINTO 2020-09-30 (2-JUL-2020+) *START* -->
<!-- "Ver na pasta SPAM caso nenhum link chegue." -->
      <antipattern>
		  <token regexp="yes">a|à|alguma|cada|como|com|da|desta|deste|em|na|nessa|nesta|ou|outra|para|pela|pelo|por|que|sem|sobre|sua|uma</token>
		  <token postag='NC[CF]S000|AQ0[CF]S0' postag_regexp='yes'/>
		  <token postag='NC[CM]S000|AQ0[CM]S0' postag_regexp='yes'/>
	  </antipattern>
      <!-- "É preparado com um caldo fino de cor amarelada chamado tucupi." -->
	  <!-- "Eu amo música rock." -->
	  <!-- "1998: Surgem os primeiros players portáteis de MP3, usando memória flash." -->
	  <!-- "Ao não permitir efeitos colaterais em funções, a linguagem oferece transparência referencial." -->
      <antipattern>
		  <token postag='NC[CF]S000|VMIP1S0|VMG0000|VMIP3S0|VMM02S0|RM' postag_regexp='yes'/>
		  <token postag='NC[CF]S000|AQ0[CF]S0' postag_regexp='yes'/>
		  <token postag='NC[CM]S000|AQ0[CM]S0' postag_regexp='yes'/>
	  </antipattern>		  
<!-- MARCOAGPINTO 2020-09-30 (2-JUL-2020+) *END* --> 

And:

<example type='correct'>Ver na <marker>pasta SPAM</marker> caso nenhum link chegue.</example>

It works in the stand-alone and Wikipedia tool, but a TESTRULES PT throws errors:

Testing rule 2500…
Skipped 0 rules for variant language to avoid checking rules more than once
2554 rules tested.
Exception in thread “main” org.junit.internal.runners.model.MultipleFailureException: There were 2 errors:
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule GENERAL_GENDER_AGREEMENT_ERRORS[5] in file /org/languagetool/rules/pt/grammar.xml: Est?o a comer uma sanduíche demasiado bom."
Errors expected: 1
Errors found : 0
Message: Possível erro de concordância de género.
Analyzed token readings: [/SENT_START*] Est?o[estar/VMIP3P0*] [ /null*] a[a/SPS00] [ /null*] comer[comer/VMN0000] [ /null*] uma[um/DI0FS0,uma/Z0FS0] [ /null*] sanduíche[sanduíche/NCFS000] [ /null*] demasiado[demasiado/RG,demasiado/AQ0MS0,demasiado/RG,demasiar/VMP00SM] [ /null*] bom[bom/AQ0MS0,bom/NCMS000] .[./SENT_END*,./_PUNCT*]
Matches: [])
org.languagetool.rules.patterns.PatternRuleTest$PatternRuleTestFailure(Test failure for rule GENERAL_GENDER_AGREEMENT_ERRORS[5] in file /org/languagetool/rules/pt/grammar.xml: Tem uma terrível inchaço na cabeça."
Errors expected: 1
Errors found : 0
Message: Possível erro de concordância de género.
Analyzed token readings: [/SENT_START*] Tem[ter/VMIP3S0*,ter/VMM02S0*] [ /null*] uma[um/DI0FS0,uma/Z0FS0] [ /null*] terrível[terrível/AQ0CS0] [ /null*] inchaço[inchaço/NCMS000] [ /null*] na[em+a/SPS00+DA] [ /null*] cabeça[cabeça/NCFS000] .[./SENT_END*,./_PUNCT*]
Matches: [])
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)

Do you know what is wrong with it?

Thanks!

@jaumeortola

I have been able to fix it after some analyses.

I will commit it in a few moments.

Sorry for bothering you.