[pt] Improve the "No verb" rule

Hello!

I want to fix Tiago’s rule and came up with an antipattern that detects if a sentence has a verb.

However, it doesn’t work when tested in the stand-alone application.

What is wrong with this code?:

  <antipattern>
      <token postag='SENT_START'/>
	  <token postag='V.+|UNKNOWN' postag_regexp='yes'/>	
  <token postag='SENT_END'/>
 </antipattern>

Thanks!

I think that antipattern would match “sentences” that have only a verb, any nothing else.

Ohhhh… how do I make it work then with multi word sentences?

Thanks.

Just match the verb, not SENT_START and SENT_END.

@dnaber

It still says that these three sentences have no verb:

Esta técnica falha 5 em cada 1000 ocorrências.
Mudanças no comportamento, personalidade ou modo de pensar.
Sistema de Crenças: São os argumentos e os pesos.

“falha”=verb
“pensar”=verb
“são”=verb

  <antipattern>
	  <token postag='V.+|UNKNOWN' postag_regexp='yes'/>	
  </antipattern>
  <pattern>
      <token postag='SENT_START'/>
    <marker>
      <token min='2'>
        <exception postag='V.+|UNKNOWN' postag_regexp='yes'/>
		<exception postag="NCFS000" regexp="yes">.+ção</exception>			
	  </token>
      <token skip='-1'>
        <exception postag='V.+|UNKNOWN' postag_regexp='yes'/>
        <exception scope="next" postag='V.+|UNKNOWN' postag_regexp='yes'/>
		<exception postag="NCFS000" regexp="yes">.+ção</exception>
		<exception scope="next" postag="NCFS000" regexp="yes">.+ção</exception>
	  </token>
    <and>
      <token regexp='yes'>[.?!…”»]|&quot;</token>
      <token postag='SENT_END'/>
    </and>
    </marker>
  </pattern>

Thanks!

“The text matched by the antipattern needs to overlap the text matched by the pattern for the antipattern to become active.” (Development Overview - LanguageTool Wiki)

@dnaber

I am very stressed :frowning:

Why does:

  <pattern>
      <token postag='SENT_START'/>
    <marker>
      <token min='2'>
        <exception postag='V.*' postag_regexp='yes'/>
		<exception postag="NCFS000" regexp="yes">.+ção</exception>			
	  </token>
      <token skip='-1'>
        <exception postag='V.*' postag_regexp='yes'/>
        <exception scope="next" postag='V.*' postag_regexp='yes'/>
		<exception postag="NCFS000" regexp="yes">.+ção</exception>
		<exception scope="next" postag="NCFS000" regexp="yes">.+ção</exception>
	  </token>
    <and>
      <token regexp='yes'>[.?!…”»]|&quot;</token>
      <token postag='SENT_END'/>
    </and>
    </marker>
  </pattern>

detects well the last three sentences which have verbal nouns, but not the first three which have real verbs?

Esta técnica falha 5 em cada 1000 ocorrências.
Mudanças no comportamento, personalidade ou modo de pensar.
Sistema de Crenças: São os argumentos e os pesos.

Gestão Regional de Conservação.
O estudo de métodos de redução de dados.
Duração das batalhas até 10 horas.

Also, I tried to check an OR example but the guide text has missing/wrong/confuse information?:
http://wiki.languagetool.org/development-overview#toc16

“OR can be used to match a token if one or both of two conditions are matched. This is sometimes a more compact alternative to writing more than one rule. For example, this would match don’t walk as well as do not walk :”

<or>
  <token>t</token>
  <token>not</token>
</or>
<token>walk</token>

Thanks!