Back to LanguageTool Homepage - Privacy - Imprint

[pt] Improve rule ID: PORTUGUESE_WORD_REPEAT_RULE

Hello @tiff @udomai @jaumeortola

The following sentence triggers an error:

É só telefonemas e e-mails de clientes a reclamar.

Since it is a Java rule and I don’t know Java, could one of you code an antipattern for it?

e
space
e > space_next="no"
- space next="no"

Thanks!

Hi!

This is REDUNDANT_CONJUNCTIONS, first subrule. It’s in the grammar.xml. Could you add the AP for

<token>e</token>
<token>e</token>
<token spacebefore="no"/>

?

Let me try.

First I will run a check on Tatoeba + Wikipedia 600 000 sentences to see the before and the after.

It didn’t work:

<!-- MARCOAGPINTO 2021-09-22 (25-JUN-2021+) *START* -->
<!--
É só telefonemas e e-mails de clientes a reclamar.
-->
      <antipattern>
		<token>e</token>
		<token>e</token>
		<token spacebefore="no"/>
      </antipattern>
<!-- MARCOAGPINTO 2021-09-22 (25-JUN-2021+) *END* -->

I tried to search for the words of the suggestion, and they aren’t found in the grammar.xml, so it must be in Java.

What message do you see? I see “Possível fragmento. Utilize apenas uma conjunção deste tipo.”

It is in the grammar.xml. The antipattern works. See this commit.

"Possível erro de digitação. Repetiu uma palavra.

Examples:
Este é é apenas uma frase de exemplo. x
Este é apenas uma frase de exemplo. ✓"

I can’t reproduce this. The sentence you gave above only triggers the XML rule:

É só telefonemas e e-mails de clientes a reclamar.

The second example you gave is a true positive (since there is a space behind the second word).

I was using the Stand-alone tool to get the examples.

that is how I find the rules.

The best solution is to add “e-mail” and “e-mails” as tagged words. This way they will be tokenized as one token. Done here: https://github.com/languagetool-org/languagetool/commit/b82994154fe7b8763f7004a9d39fcd0a40055f73