languagetool-org / languagetool

Style and Grammar Checker for 25+ Languages
https://languagetool.org
GNU Lesser General Public License v2.1
12.31k stars 1.39k forks source link

[es] agreement error not caught: que las palabras son correctos #7031

Open tiff opened 2 years ago

tiff commented 2 years ago

He checado que las palabras son correctos en mis vocabularios. Veo que tengo que repetirlos.

User claims it must be "correctAs" and "repetirlos".

jaumeortola commented 2 years ago

The user is right ("las palabras son correctAs"). We have tried some rules, but they still have too many false positives and they are disabled.

Regarding "repetirlos/repetirlas", it is impossible to know what is the reference (las palabras / mis vocabularios?) and the correct gender.

ricardojosehlima commented 2 years ago

For Portuguese the same happens: "as palavras estão corretos" is not caught. I would like to see, if possible, some false positives, maybe I could contribute in finding some pattern (for Portuguese).

jaumeortola commented 2 years ago

@ricardojosehlima Great if you try something. I have written some rules for this in Catalan and Spanish. They work only for simple patterns. But they can cause many false positives, and when the subject is not simple (not just determiner + noun (+ adj)) it becomes really tricky.

I suggest adapting the Catalan rule CONCORDANCES_ATRIBUT in Portuguese.

ricardojosehlima commented 2 years ago

Hi @jaumeortola (and @jaumeortola and @susanaboatto). I have a created a tentative rule for "as palavras estão corretos": !-- Portuguese rule, 2022-09-02 -- rule id="LIGAO" name="Ligação" pattern token postag='SPS00:DA0FP0' negate_pos='yes'> token postag='NCFP000'> token>estão token postag='AQ0MP0'> /pattern message>conserte o adjetivo example correction=''>As palavras estão corretos. example>As palavras estão corretas. /rule

and checked it using the editor LT provides in its site. It works. Some observations:

marcoagpinto commented 2 years ago

If @susanaboatto doesn't have the chance of doing it, I will look at it tonight or at 5am (as usual)

But @jaumeortola weeks ago said we must avoid using "negate=yes" in rules.

marcoagpinto commented 2 years ago

@ricardojosehlima

Thank you for your efforts ❤️

marcoagpinto commented 2 years ago

The false positives are all fixable, they only require time to test.

First the rule is tested against 600 000 sentences, and then it is adding antipatterns and repeating the tests until all is fine.

marcoagpinto commented 2 years ago

@ricardojosehlima

Hello!

https://github.com/languagetool-org/languagetool/commit/54df6f56b77befdce00b034e80bae42830444211

I have been at it for around 12 hours, and it only works for your example verb form:

A palavra estão corretos.
A palavra está correto.

The second one isn't recognised.

I have removed tons of false positives, but I am very depressed and won't touch this rule again.

I am sorry.

@jaumeortola and @susanaboatto , can one of you try to fix the rule?

Thanks!

BEFORE:

Portuguese (Portugal): 403 total matches
Portuguese (Portugal): 582235 total sentences considered
Portuguese (Portugal): ø0.00 rule matches per sentence

1_before.txt

AFTER:

Portuguese (Portugal): 20 total matches
Portuguese (Portugal): 582235 total sentences considered
Portuguese (Portugal): ø0.00 rule matches per sentence

21_after.txt

marcoagpinto commented 2 years ago

Well,

I have come up with an idea right now: to break the rule in several parts and have an antipattern just for “gente”.

Tomorrow I will try to redo the rule.

EDIT: I have been resting a bit, and the “a gente” isn't for an antipattern. I must think better tomorrow.

marcoagpinto commented 2 years ago

@ricardojosehlima @jaumeortola @susanaboatto

Update: I have been breaking the rule into several antipatterns and the results are being good so far.

Give me more an hour or two, and I believe I will have the rule working.

marcoagpinto commented 2 years ago

@ricardojosehlima

Hello!

Here it is the best it can get: https://github.com/languagetool-org/languagetool/commit/dd439bf6227bc76cc70fed68162714e6baae4f3e

Portuguese (Portugal): 13 total matches
Portuguese (Portugal): 582235 total sentences considered
Portuguese (Portugal): ø0.00 rule matches per sentence

_18.txt

@jaumeortola @susanaboatto There are some sentences (false positives) I couldn't fix, such as:

A senhora tem filhos?
Por que as pessoas têm filhos?
As crianças têm direitos.

The fix in the pattern would be to remove words which are both adjective and noun (exception add “NCM.+”), but I am scared it may remove valid hits.

I will need help to assess the use of “NCM.+” as an exception.

@susanaboatto @jaumeortola Please reflect if we should use the noun exception, I want to avoid reducing the rule accuracy.

Thanks!

marcoagpinto commented 2 years ago

If you decide to use “NCM.+”, please feel free to replace it yourselves directly in the rule.

marcoagpinto commented 2 years ago

@ricardojosehlima @susanaboatto @jaumeortola

I was looking at the sentences above and noticed they all have the verb "ter”.

Maybe we could add an exception to verb "ter”?

marcoagpinto commented 2 years ago

I am just testing it against 600 000 sentences.

We will know soon.

marcoagpinto commented 2 years ago

@ricardojosehlima @susanaboatto @jaumeortola !!!

It is fixed!!!! https://github.com/languagetool-org/languagetool/commit/b67d2e3d79fe7ce1189af70b59536fcd2d0acf92

Portuguese (Portugal): 8 total matches
Portuguese (Portugal): 582235 total sentences considered
Portuguese (Portugal): ø0.00 rule matches per sentence

_19.txt

@jaumeortola Maybe you could adapt the rule to Spanish?

❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️

ricardojosehlima commented 2 years ago

Hi @marcoagpinto I didn't understand the details of the rule but it is supposed to apply only to the verbs ser and estar:

Elas estão bonitos hoje As palavras são corretos

If this is the case and the only examples caught were in _19.txt then it's fine.

marcoagpinto commented 2 years ago

Hello @ricardojosehlima

I have improved the rule.

I didn't know the verbs were only "ser" and "estar", so I used it for all verbs except "ter" because it caused too many false positives or so, I can't remember.

https://github.com/languagetool-org/languagetool/commit/3b77f31dbfc836fa3c7d71b4fd08ecc2d59573ad

https://github.com/languagetool-org/languagetool/commit/7006ba7214dd26a9c1945c4d9ed3c9bc8d3e7780

Portuguese (Portugal): 9 total matches
Portuguese (Portugal): 582235 total sentences considered
Portuguese (Portugal): ø0.00 rule matches per sentence

20.txt

Rule code (extremely complex):

`

  <!-- Created by Ricardo Joseh Lima and improved by Marco A.G.Pinto and Susana Boatto, Portuguese rule 2022-09-04/11 (25-JUL-2022+) -->
  <!--
  As palavras estão corretos. → As palavras estão corretas.
  A palavra está correto. → A palavra está correta.

  A hipótese for correto. → A hipótese for correta.
  As hipóteses forem corretos. → As hipóteses forem corretas.

  A avaliação é correto. → A avaliação é correta.
  As avaliações são corretos. → As avaliações são corretas.

  Ela está bonito hoje. → Ela está bonita hoje.
  Elas estão bonitos hoje. → Elas estão bonitas hoje.
  -->
  <rule id='LIGACAO_ECG_V2' name="Ligação ECG">

    <antipattern>
      <token postag='AQ.M.+|NCM.+|CC|RG' postag_regexp="yes"/>
      <token postag='DA0F.+|SPS00:DA0F.+' postag_regexp="yes"/>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token postag='VMIP3.+|VMSF3.+' postag_regexp="yes"/>
      <token postag='AQ.M.+' postag_regexp="yes"/>
      <example>O café da manhã está pronto?</example>
      <example>O cérebro com os centros diretivos da mente funciona encerrado na caixa craniana, à maneira de usina quase lacrada num cofre forte.</example>
      <example>O chapéu das mulheres é caro.</example>
      <example>Eu não sou fã da revista, mas não dá para negar que os produtos da marca são lindíssimos!</example>
      <example>Os ovos da barata são escuros.</example>
      <example>O nível da água está altíssimo.</example>
      <example>O banheiro da suite é amplo, bem ventilado e com acabamento de alto padrão.</example>
      <example>O pescoço da girafa é longo.</example>
      <example>O cabelo da Maria está longo.</example>
      <example>O vinho e a cerveja estão bons.</example>
      <example>Os camarões, os caranguejos e as lagostas são crustáceos.</example>
      <example>O papel é branco, a neve também é branca. O papel e a neve são brancos.</example>
      <example>Pablo e a esposa são católicos.</example>
      <example>O bem e a verdade andam juntos.</example>
      <example>O Tomás e a Maria andam preocupados.</example>
      <example>O Tom e a Maria são vegetarianos.</example>
      <example>...um tipo de motor que usamos para automatizar portas deslizantes, é especial pois a instalação exige cuidados especiais.</example>
      <example>estudo das organizações modernas através da cultura é novo.</example>
    </antipattern>

    <antipattern>
      <token postag='DA0F.+|SPS00:DA0F.+' postag_regexp="yes"/>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token postag='DA0F.+|SPS00:DA0F.+' postag_regexp="yes"/>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token postag='VMIP3.+|VMSF3.+' postag_regexp="yes"/>
      <token postag='AQ.M.+' postag_regexp="yes"/>
      <example>A maioria das orações possui sujeito.</example>
      <example>Um terço da superfície da Terra é deserto.</example>
      <example>Geralmente, os erros cometidos na esfera da religião são perigosos, enquanto aqueles que se cometem no âmbito da filosofia são simplesmente ridículos.</example>
      <example>As asas das borboletas são ótimos modelos para o estudo dos mecanismos da evolução.</example>
    </antipattern>

    <antipattern>
      <token postag='DA0F.+|SPS00:DA0F.+|PP.F.+|SPS00:PP.F.+' postag_regexp="yes"/>
      <token min="0" max="1" postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token postag='VMIP3.+|VMSF3.+' postag_regexp="yes"/>
      <and>
        <token postag='AQ.M.+|NCM.+' postag_regexp="yes"/>
        <token regexp="yes" inflected="yes">&languages;</token>
      </and>
      <example>Quem nasce na Suécia é sueco.</example>
      <example>Muitas pessoas na África falam francês.</example>
      <example>A senhora fala espanhol?</example>
      <example>A mulher fala espanhol.</example>
      <example>Quem nasce na Holanda é holandês.</example>
      <example>Por que a senhora estuda francês?</example>
      <example>As principais línguas-fonte da interlíngua são Português, Espanhol, Italiano, Francês e Inglês.</example>
      <example>É difícil encontrar falantes nativos de Árabe em Dubai, onde a maioria das pessoas fala Inglês.</example>
      <example>A minha matéria favorita na escola é francês.</example>
      <example>O marido dela é americano.</example>
      <example>Ela fala chinês.</example>
      <example>Ela sabe francês às avessas.</example>
      <example>Além do inglês, ela fala francês fluentemente.</example>
    </antipattern>

    <antipattern>
      <token postag='DA0F.+|SPS00:DA0F.+' postag_regexp="yes"/>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token postag='VMIP3.+|VMSF3.+' postag_regexp="yes"/>
      <token postag='AQ.M.+' postag_regexp="yes"/>
      <token postag='AQ.M.+|NCM.+|V.+|SPS00|CC|CS|RG|I|RM|RN' postag_regexp="yes"/>
      <example>Para ter êxito na vida é preciso trabalhar duro.</example>
      <example>De outro lado, as imagens são verdadeiros livros que ensinam a prática das virtudes.</example>
      <example>A festa anima todo mundo.</example>
      <example>Os direitos das mulheres são direitos humanos.</example>
      <example>“A educação cria bons homens, e bons homens agem nobremente”.</example>
      <example>A palavra tem vários significados.</example>
      <example>Hoje a cidade está meio parada.</example>
      <example>As únicas coisas que a preocupação traz são cabelos brancos, receita de remédios e remédios.</example>
      <example>As borboletas são belíssimos insetos que simbolizam desde sempre a eternidade.</example>
      <example>Eu não consigo entender porque as pessoas têm medo de ideias novas. Eu tenho medo é das antigas.</example>
      <example>A vida tem altos e baixos.</example>
      <example>Um dia na pista é bom para você.</example>
      <example>Atualmente, a empresa oferece horários e passagens de ônibus para a região Centro-Oeste do estado mineiro.</example>
      <example>A gente treina juntos já.</example>
      <example>Os habitantes da ilha são altos e fortes.</example>
      <example>Nas cidades moram ricos e pobres.</example>
      <example>Assim, o aumento significativo de ações na Justiça provoca reflexos em todo o segmento.</example>
    </antipattern>

    <antipattern>
      <token postag='DA0F.+|SPS00:DA0F.+' postag_regexp="yes"/>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token postag='VMIP3.+|VMSF3.+' postag_regexp="yes"/>
      <token postag='AQ.M.+' postag_regexp="yes"/>
      <token min="0" max="1" postag='_PUNCT' postag_regexp="no"/>
      <token postag='[DP][ADIPR].M.+|SPS00:[DP][ADIPR].M.+' postag_regexp="yes"/>
      <token postag='AQ.M.+|NCM.+|_PUNCT|[DP][ADIPR].C.+|SPS00:[DP][ADIPR].C.+' postag_regexp="yes"/>
      <example>Como em outras cidades, o lixo separado pela população acaba misturado nos caminhões que o recolhe.</example>
      <example>A criança tem medo do escuro.</example>
      <example>As indicações são reflexo do acompanhamento atento da cena teatral brasileira que os dois fazem durante todo o ano.</example>
      <example>Outro fator importante que o usuário deve ter em conta é que a videochamada consome dados do plano de internet móvel.</example>
      <example>Outra questão que a série aborda são os laços de família que Kara Danvers tem com Clark Kent.</example>
      <example>As crianças têm medo do escuro.</example>
      <example>Apenas uma minoria da população fala português no imenso sertão moçambicano.</example>
      <example>A senhora tem medo dele.</example>
      <example>As senhoras têm medo dele.</example>
      <example>Nestes arquivos, as pessoas disponibilizam áudios nos quais simplesmente falam e expõem suas opiniões sobre os mais diversos assuntos, como política ...</example>
    </antipattern>

    <antipattern>
      <token postag='DA0F.+|SPS00:DA0F.+' postag_regexp="yes"/>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token postag='VMIP3.+|VMSF3.+' postag_regexp="yes"/>
      <token postag='AQ.M.+' postag_regexp="yes"/>
      <token postag='_PUNCT' postag_regexp="no"/>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <example>A fauna inclui macacos, cutias, tartarugas e caranguejos terrestres.</example>
    </antipattern>

    <antipattern>
      <token postag='DA0F.+|SPS00:DA0F.+' postag_regexp="yes"/>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token postag='VMIP3.+|VMSF3.+' postag_regexp="yes"/>
      <token postag='AQ.M.+' postag_regexp="yes"/>
      <token min="0" max="1" postag='_PUNCT' postag_regexp="no"/>
      <token postag='[DP][ADIPR].F.+|SPS00:[DP][ADIPR].F.+' postag_regexp="yes"/>
      <token postag='AQ.F.+|NCF.+|_PUNCT|[DP][ADIPR].C.+|SPS00:[DP][ADIPR].C.+' postag_regexp="yes"/>
      <example>As pessoas têm medo da guerra.</example>
      <example>A casa fica junto da baía.</example>
      <example>O problema da seca é histórico na região de clima semiárido do Nordeste.</example>
      <example>Toda a gente tem medo da morte.</example>
      <example>A complacência granjeia amigos; a verdade, inimigos.</example>
    </antipattern>

    <antipattern>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token postag='DA0F.+|SPS00:DA0F.+' postag_regexp="yes"/>
      <token postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <token>são</token>
      <token postag='AQ.M.+|NCM.+' postag_regexp="yes"/>
      <example>A coisa mais preciosa na vida são momentos.</example>
    </antipattern>

    <antipattern>
      <token postag='SENT_START|_PUNCT' postag_regexp="yes"/>
      <token postag='DA0F.+|SPS00:DA0F.+|PP.F.+|SPS00:PP.F.+' postag_regexp="yes"/>
      <token postag='V.+' postag_regexp="yes">
          <exception regexp='no'>são</exception>
      </token>
      <token postag='AQ.M.+|NCM.+|NP.+' postag_regexp="yes">
          <exception scope="next" postag='RG' postag_regexp='no'/>
      </token>
      <example>Ele passa o tempo a jogar computador.</example>
      <example>Ela fala bonito.</example>
      <example>Ela usa vestidos sarapintados a fim de chamar a atenção.</example>
      <example>Ela monta computadores.</example>
      <example>Ela toca violino bem.</example>
      <example>Ela come feito uma porca.</example>
      <example>12ª Sessão - Brasil S.A É preciso melhorar a atividade pública e buscar novas formas de convídio Devemos buscar uma governança mais e...</example>
    </antipattern>

    <antipattern>
      <token postag='DA0F.+|SPS00:DA0F.+|PP.F.+|SPS00:PP.F.+' postag_regexp="yes"/>
      <token postag='VMN0000' postag_regexp="no"/>
      <token postag='AQ.M.+|NCM.+|NP.+' postag_regexp="yes">
          <exception scope="next" postag='RG' postag_regexp='no'/>
      </token>
      <example>...ive, quase criou uma crise política da-que-las, o que obrigou seu pai, figurinha carimbada, a pular miúdo para colocar panos quentes sobre a questão.</example>
      <example>Tenho tendência a pegar resfriados.</example>
      <example>Quando eu era menino, passava horas a ler sozinho em meu quarto.</example>
    </antipattern>

    <antipattern>
      <token postag='AQ.[CM].+|NC[CM].+|CS|VMIP1.+|VMN0000' postag_regexp="yes"/>
      <token min="0" max="1" postag='SPS00|CC|RG|_PUNCT|RM' postag_regexp="yes"/>
      <token postag='DA0F.+|SPS00:DA0F.+|PP.F.+|SPS00:PP.F.+' postag_regexp="yes"/>
      <token postag='V.+' postag_regexp="yes">
          <exception regexp='no'>são</exception>
      </token>
      <token min="0" max="1" postag='RG' postag_regexp="no"/>
      <token postag='AQ.M.+|NCM.+|NP.+' postag_regexp="yes">
          <exception scope="next" postag='RG' postag_regexp='no'/>
      </token>
      <example>... de ano mais desastroso, precisa driblar o rebaixamento - é esse o desafio do bombeiro a substituir Mano.</example>
      <example>O que está acontecendo com sua planta não é normal, aparentemente os cuidados com ela estão corretos, mas certamente alguma coisa de errado está acontecendo.</example>
      <example>Lá diz o povo que quando o barco começa a afundar os primeiros a fugir são os 28, perdão, são os ratos.</example>
      <example>Os primeiros a receber são os que ganham até um salário mínimo (R$ 998, em 2019).</example>
      <example>O pai dela é conservador e careta.</example>
      <example>A Maria, o inglês dela é bom, mas ela tem vergonha de falar com os outros em inglês.</example>
      <example>O pai dela é vivo?</example>
      <example>O cabelo dela é liso, loiro e longo.</example>
      <example>O marido dela é rico.</example>
      <example>O namorado novo dela é negro.</example>
      <example>O único objetivo verdadeiro da educação é simplesmente ensinar o homem a aprender sozinho.</example>
      <example>Ele passa o tempo a jogar computador.</example>
      <example>Andei cinco anos a estudar basco.</example>
      <example>...rantes que foram vítimas de crimes graves, pessoas sujeitas à proteção internacional e a acompanhar defensores e defensoras de direitos humanos de pessoas migrantes que estão em risco.</example>
      <example>Esta demagogia social, a tomar emprestado do movimento da classe trabalhadora sua linguagem, dando-lhe um significado racial não-classista, é...</example>
      <example>...intenção com as crônicas e dicas postadas aqui é simplesmente inspirar outros viajantes a descobrir novos lugares (ou, quem sabe, a se aventurar por novos recantos em lugares já conhecidos).</example>
      <example>...m do artigo 14 do Cdigo de Defesa do Consumidor, os artigos 186 e 927 do Novo Cdigo Civil, a seguir transcritos: "Artigo 186.</example>
      <example>O suéter dela é roxo.</example>
      <example>O cabelo dela era tão longo que alcançava o chão.</example>
      <example>É importante ressaltar que essa obra é única no mercado, pois somente ela traz tamanho número de questões do Exame de Ordem e da FGV, questões estas que estão classificadas e comentadas,...</example>
      <example>Nós estamos apenas a trinta minutos daí.</example>
      <example>Estamos apenas a trinta minutos daí.</example>
      <example>Quando o aluno trabalha sozinho ele tem que aprender também a lidar sozinho com essas questões, mas estando acompanhado por um professor, que se supõe poder orientá-lo nessas ...</example>
    </antipattern>

    <pattern>
      <token postag='DA0F.+|SPS00:DA0F.+|PP.F.+|SPS00:PP.F.+' postag_regexp="yes">
        <exception scope="previous" postag='V.+|[DP][ADIPR].C.+|SPS00:[DP][ADIPR].C.+' postag_regexp='yes'/>
        <exception scope="next" postag='AQ.M.+|NCM.+' postag_regexp='yes'/>
      </token>
      <token min="0" max="1" postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
      <or>
        <token postag='VMIP3.+|VMSF3.+' postag_regexp="yes">
          <exception postag='NC.+|AQ.+' postag_regexp='yes'/>
          <exception regexp='no' inflected='yes'>ter</exception>
        </token>
        <token>são</token>
      </or>
      <marker>
        <token postag='AQ.M.+' postag_regexp="yes">
          <exception postag='RG|[DP][ADIPR].M.+|SPS00:[DP][ADIPR].M.+' postag_regexp='yes'/>
        </token>
      </marker>
    </pattern>
    <message>&MSG_ECG;</message>
    <suggestion><match no='4' postag="AQ0M(.)0" postag_replace='AQ0F$10' postag_regexp="yes"/></suggestion>
    <example correction='correta'>A palavra está <marker>correto</marker>.</example>
    <example correction='corretas'>As palavras estão <marker>corretos</marker>.</example>
    <example correction='correta'>A hipótese for <marker>correto</marker>.</example>
    <example correction='corretas'>As hipóteses forem <marker>corretos</marker>.</example>
    <example correction='correta'>A avaliação é <marker>correto</marker>.</example>
    <example correction='corretas'>As avaliações são <marker>corretos</marker>.</example>
    <example correction='bonita'>Ela está <marker>bonito</marker> hoje.</example>
    <example correction='bonitas'>Elas estão <marker>bonitos</marker> hoje.</example>
    <example>Dirija com cuidado. Não se esqueça que a imprudência custa caro.</example>
    <example>A águia voa alto.</example>
    <example>O limite livre de impostos pra carregar vinhos para o Brasil na mala é alto.</example>
    <example>A criança aprende rápido.</example>
    <example>a parte das finanças fica meio obsoleta pra quem não trabalha.</example>
    <example>Hoje a cidade está meio triste.</example>
    <example>Eu não imaginava como o custo de vida na Austrália é alto.</example>
    <example>O que a tecnologia faz pela audição é lindo, lindo demais.</example>
    <example>é para formação de corpo de baile e bailarinos mais altos… quem dança na frente é pequeno.</example>
    <example>Fumar na cama é perigoso.</example>
    <example>As cores da alvorada são vermelho, azul e branco, as cores combinadas das bandeiras nacionais dos Estados Unidos, da Rússia e do Japã...</example>
    <example>De quem as senhoras têm medo?</example>
    <example>O Tomás disse que a Maria tem medo.</example>
    <example>As partículas alfa são partículas positivas.</example>
    <example>A senhora tem filhos?</example>
    <example>Por que as pessoas têm filhos?</example>
    <example>As crianças têm direitos.</example>
  </rule>

`

ricardojosehlima commented 2 years ago

Hmmm, looking at the 20.txt I didn't find the rule useful. It only corrected one instance (Eles são altos?), all others are cases of "a gente" which in pt-br admits masculine in the adjective: "a gente é maluco" is fine if said by male speakers; also, there is a false positive that must be removed (A porrada come feio), the rule should apply only to "ser" and "estar".

marcoagpinto commented 2 years ago

@ricardojosehlima

Ahhhh… right, I will fix it at 5am as usual.

"ser” and “estar”.

My dear brother Ricardo!

marcoagpinto commented 2 years ago

@ricardojosehlima

Meanwhile, I came up with some ideas for new rules, I will share them tomorrow or Wednesday.

I always come up with style rules…. 😄 😄 😄 😄 😄 😄 😄 😄 😄

marcoagpinto commented 2 years ago

@ricardojosehlima

I have tried applying only to those two verbs, and it throws a ton of false positives.

I will need to rewrite the rule.

I can't do it today, nor tomorrow.

It will take a few days.

Portuguese (Portugal): 26 total matches
Portuguese (Portugal): 582235 total sentences considered
Portuguese (Portugal): ø0.00 rule matches per sentence

0.txt

ricardojosehlima commented 2 years ago

Hi take a look at my original proposal, repeated below !-- Portuguese rule, 2022-09-02 -- rule id="LIGAO" name="Ligação" pattern token postag='SPS00:DA0FP0' negate_pos='yes'> token postag='NCFP000'> token>estão token postag='AQ0MP0'> /pattern message>conserte o adjetivo example correction=''>As palavras estão corretos. example>As palavras estão corretas. /rule

This rule worked on the editor, could you try it in your data?

marcoagpinto commented 2 years ago

Hi take a look at my original proposal, repeated below !-- Portuguese rule, 2022-09-02 -- rule id="LIGAO" name="Ligação" pattern token postag='SPS00:DA0FP0' negate_pos='yes'> token postag='NCFP000'> token>estão token postag='AQ0MP0'> /pattern message>conserte o adjetivo example correction=''>As palavras estão corretos. example>As palavras estão corretas. /rule

This rule worked on the editor, could you try it in your data?

The rule that way only works with “estão” (only one word), we need to make it work with all variations of a verb.

ricardojosehlima commented 2 years ago

I know it, and I said it in my original comment: it must be adapted to all forms of estar and ser. Can the lemma of these verbs be used in the rule? If so, it catches all variants.

marcoagpinto commented 2 years ago

@ricardojosehlima

I have been working on the rule since last night at 11pm or midnight.

It generates tons of false positives.

This rule will take more time to create.

ricardojosehlima commented 2 years ago

That was unexpected, can you show me the false positives with only this slight change - estão to all forms of estar and ser?

marcoagpinto commented 2 years ago

@ricardojosehlima

0.txt

I have been rewriting the antipatterns.

Currently it gives this: 18stable.txt

But it doesn't detect "ela é alto", because of this:

        <antipattern>
          <token postag='DA0F.+|SPS00:DA0F.+|PP.F.+|SPS00:PP.F.+' postag_regexp="yes"/>
          <token min="0" max="1" postag='AQ.F.+|NCF.+' postag_regexp="yes"/>
          <token regexp="yes" inflected='yes'>ser|estar</token>
          <token postag='RG' postag_regexp="no"/>
          <token postag='AQ.[CF].+|NC[CF].+|_PUNCT' postag_regexp="yes"/>
          <example>O limite livre de impostos pra carregar vinhos para o Brasil na mala é alto.</example>
          <example>A camisa foi meio carinha.</example>
          <example>Ontem ela estava meio bêbada.</example>
        </antipattern>

This antipattern is driving me crazy.

ricardojosehlima commented 2 years ago

I see... The problem seems to lie here token postag='DA0F.+|SPS00:DA0F.+|PP.F.+|SPS00:PP.F.+' postag_regexp="yes"

It should prevent na, da, in the rule so "na mala" wouldn't be captured but "a mala" yes.

marcoagpinto commented 2 years ago

@ricardojosehlima

In a few hours I will try again, I am too stressed.

❤️ ❤️ ❤️ ❤️ ❤️ ❤️

marcoagpinto commented 2 years ago

@ricardojosehlima

Silly question: "Elas foram direto para a cama." is it “direto” or “direta”?

Thanks!

ricardojosehlima commented 2 years ago

Direto, it's an adverb

marcoagpinto commented 2 years ago

Ahhhh… I was almost sure… but I had a philosophical doubt about it… lol

Well, at least I have split the antipattern into two or three.

marcoagpinto commented 2 years ago

@ricardojosehlima

!!!!

23.txt

Only two hits, and in the first one the sentence is badly structured, so I don't think I should waste time to create an antipattern for it.

I have in the checking of the rule:

      As palavras estão corretos. → As palavras estão corretas.
      A palavra está correto. → A palavra está correta.

      A avaliação é correto. → A avaliação é correta.
      As avaliações são corretos. → As avaliações são corretas.

      Ela está bonito hoje. → Ela está bonita hoje.
      Elas estão bonitos hoje. → Elas estão bonitas hoje.

      Ela é alto. → Ela é alta.
      Elas são altos. → Ela são altas.

and it seems to work properly.

If you feel everything is good, I will commit in a few minutes.

ricardojosehlima commented 2 years ago

The first one is a false positive, due to S.A. being somehow classified as something that belongs to the rule when it shouldn't. The other is ok!

marcoagpinto commented 2 years ago

Yes, notice: “S. A” not “S. A.” (period is missing, so the sentence is badly structured)

marcoagpinto commented 2 years ago

I am about to commit it.

marcoagpinto commented 2 years ago

@ricardojosehlima

Committed: https://github.com/languagetool-org/languagetool/commit/91c8c7241d4e315adb075f9de81b4758779fd6a4

@jaumeortola It seems we have your ES problem solved with this rule.

marcoagpinto commented 2 years ago

I am so happy!!!!

😄 😄 😄 😄 😄 😄 😄

Now at 5am I will post some ideas for style rules.