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

Hi @marcoagpinto

Any idea why this rule doesn’t work?

<rule>
      <pattern>
         <token postag='_PUNCT'/>
         <marker>
         <token skip='-1'>pq</token>
         </marker>
         <token min='0'>*</token>
	<token>\?</token>
	  </pattern>
      <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>
</rule>

@susanabatto

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

See the rule:
INTERNET_ABBREVIATIONS

And add words to:

        <pattern>
          <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>
        </pattern>

It is as simple as this.

:smile:

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: