Back to LanguageTool Homepage - Privacy - Imprint

[pt] Detection of "por que" when written as "pq"

Hi @marcoagpinto

Any idea why this rule doesn’t work?

         <token postag='_PUNCT'/>
         <token skip='-1'>pq</token>
         <token min='0'>*</token>
      <message>Linguagem de Internet. Considere escrever <suggestion>por que</suggestion> por extenso.</message>
		  <example correction="por que">Se não houve erro algum, <marker>pq</marker> não entregou o documento?</example>
		  <example correction="por que">E faria tudo isso de novo, <marker>pq</marker> não?</example>
		  <example correction="por que">O relatório foi entregue. <marker>Pq</marker> não houve mudanças?</example>
		  <example correction="por que">O relatório foi entregue; <marker>pq</marker> não houve mudanças?</example>


It is going to give you a lot of work to create such a rule for something we already have (rule).

See the rule:

And add words to:

          <token regexp='yes'>bbiab|n|ñ|pq?|q(?:nd|ts)?|lol|vc|b(jos?|lz)|kk+|tbm?|omg|rotfl|wtf
            <exception case_sensitive='yes'>N</exception></token>

It is as simple as this.


By the way, “pq?” is already there.

I know that writing as a word gives a spelling error, it is just a matter of adding to spelling.txt .

I know, but I talked to Daniel and we think this rule needs suggestions so that people can actually apply it. So, that’s what I’m doing now. He helped me fix this already, but thanks anyway :smile:

:smile: :heart: