languagetool-org / languagetool

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

[pt] PhD thesis tone: “ESTE PODE SER USADO” → “ESTE É USADO” - 2023-04-02 #8175

Open marcoagpinto opened 1 year ago

marcoagpinto commented 1 year ago

Hello @ricardojosehlima

So, once again, I am rewriting the tone of my PhD thesis.

The supervisor said it looked like an article from “Correio da Manhã” (Portuguese newspaper).

I was reading the thesis of the second-best student of the supervisor, and he uses a style of writing similar to: Uma vez conhecidos os parâmetros do modelo, ESTE PODE SER USADO para fazer previsões. To: Uma vez conhecidos os parâmetros do modelo, ESTE É USADO para fazer previsões.

How did you do in your thesis?

Does the example above work with all verbs, or only “poder” + “ser”?

This must be a “picky” rule.

Thanks!

marcoagpinto commented 1 year ago

@susanaboatto

This is a hard one since it produces 2000+ hits.

I spent the afternoon yesterday trying to fix it and decided to start from scratch.

I am not sure when I will have a proper working rule.

susanaboatto commented 1 year ago

I think this would be a very context-specific/text-type dependent rule that would be disabled by most users. It would need to be filtered and specified. We are planning to improve LT's style feature in the near future, so we could come back to this idea later on, once the “academic” tag becomes active. Until then, I think we better not create or activate it. I will start a list for rules like this.

marcoagpinto commented 1 year ago

@susanaboatto

I will place it “default=off" once it is created, then, when we have the “academic” flag working, we can look at it.

Notice that I don't know if I will manage to have the rule ready today, since I am testing it one or two postags at each run.

This way of testing can take a full day or more, usually it even takes several days.

My dear ones, so much to do and so little time. 😋

❤️ ❤️ ❤️ ❤️ ❤️

susanaboatto commented 1 year ago

Sounds like a plan! Let's place this in the academic category, so it'll be easy to find later.

marcoagpinto commented 1 year ago

Yes, Susana, a plan. 😄 😋 😛

I like to plan ahead.

marcoagpinto commented 1 year ago

@susanaboatto @ricardojosehlima

I need your advice.

Look at the current insane results: 63stable.txt

Portuguese (Portugal): 344 total matches
Portuguese (Portugal): 599999 total sentences considered
Portuguese (Portugal): ø0.00 rule matches per sentence

I have been working on the rule for three days, but it is insane the amount of complex antipatterns I had to create to have it going, but now I intend to delete the entire rule and start again from scratch and try to simplify it as much as possible.

What should I do?

Thanks!


    <!-- PODE SER USADO é usado -->
    <rule id='PHD_TESE_PODE_SER_PART_PASS_É_PART_PASS' name="[PhD Tese] Expressões do tipo 'pode ser usado' → 'é usado'" type="style"> <!--  tags='picky' default='off'> -->
      <!-- Created by Marco A.G.Pinto, Portuguese rule 2023-04-xx (2-MAR-2023+) -->
      <!--
      Ao conhecer os parâmetros do modelo, este pode ser usado para fazer previsões. → Ao conhecer os parâmetros do modelo, este é usado para fazer previsões.
      Ao conhecer os parâmetros dos modelos, estes podem ser usados para fazer previsões. → Ao conhecer os parâmetros dos modelos, estes são usados para fazer previsões.
      -->

      <antipattern>
        <token regexp='no' inflected='yes'>poder</token>
        <token regexp='no' inflected='yes'>ser</token>
        <token min="0" max="1" postag='RG' postag_regexp='no'/> <!-- pode ser TAMBÉM -->
        <token postag='VMP00.+' postag_regexp='yes'/>
        <token regexp='yes'>de|e|ou|em</token>
        <token postag='VMN0000' postag_regexp='no'/>
        <example>Em outras palavras, poderá ser preso ou tomar uma multa, entre outras sanções previstas em lei.</example>
        <example>Não, uma pessoa pode ser salva e ter um demônio.</example>
        <example>Mas o empobrecimento do eu, sempre mais ou menos presente, pode ser manifesto e estar no primeiro plano do quadro clínico.</example>
        <example>Emendas podem ser apresentadas e modificar o quadro deste PL.</example>
        <example>Para ele, a força-tarefa não poderia ser acusada de ter tentando influenciar as eleições presidenciais, porque só fez o seu trabalho.</example>
<!--
        <example></example>
        <example></example>
        <example></example>
        <example></example>
-->
      </antipattern>

      <antipattern>
        <token postag='SPS00:.+|CS|_PUNCT|RN' postag_regexp='yes'/>
        <token postag='PP.+|NC.+|AQ.+|NP.+|RN|P[ERT].+' postag_regexp='yes'/>
        <token regexp='no' inflected='yes'>poder</token>
        <token regexp='no' inflected='yes'>ser</token>
        <token min="0" max="1" postag='RG' postag_regexp='no'/> <!-- pode ser TAMBÉM -->
        <token postag='VMP00.+' postag_regexp='yes'/>
        <token regexp='yes'>de|e|ou|para|em</token>
        <token postag='VMP00.+|VMN0000' postag_regexp='yes'/>
        <token postag='SPS00|DI.+|DD.+' postag_regexp='yes'/>
        <example>Nenhuma parte do material contido neste site pode ser reproduzida ou duplicada sem autorização expressa do autor.</example>
        <example>A vogal final do substantivo e do artigo pode ser suprimida e substituída por um apóstrofo.</example>
        <example>O Gorelick disse que os resultados do seu projeto na Jordânia podem ser utilizados para avaliar a escassez de água noutros países do Médio Oriente, tais como a Síria.</example>
        <example>...e espera de Filosofia para Samambaia , se outra regional registrar carência nessa área, será que eu poderia ser alocado para suprir a carência de uma outra regional?</example>
        <example>Convém não trazer a dama muito cedo para o jogo, pois ela pode ser atacada e forçada a recuar.</example>
        <example>Isso nos permite detectar o que não pode ser removido ou alterado sem remover ou alterar o fenômeno em questão.</example>
        <example>RO-4585-77 - FALTAS ANTERIORES, JÁ PUNIDA, NÃO PODEM SER INVOCADAS PARA JUSTIFICAR A RESCISÃO.</example>
        <example>...eiros e médicos fazem tudo que é possível mas, a violência é o próprio parto porque não há nada que possa ser feito para melhorar um parto.</example>
        <example>As tags de agradecimento, fazem parte de nossa coleção de goodies, que podem ser baixados e impressos em casa quando quiserem, como esta que usamos, aqui!</example>
<!--
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
-->
      </antipattern>

      <antipattern>
        <token postag='SENT_START|_PUNCT' postag_regexp='yes'/>
        <token postag='DA.+|DI.+|SPS00' postag_regexp='yes'/>
        <token postag='NC.+|AQ.+|NP.+' postag_regexp='yes'/>
        <token min="0" max="1" postag='RN' postag_regexp='no'/>
        <token regexp='no' inflected='yes'>poder</token>
        <token regexp='no' inflected='yes'>ser</token>
        <token min="0" max="1" postag='RG' postag_regexp='no'/> <!-- pode ser TAMBÉM -->
        <token postag='VMP00.+' postag_regexp='yes'/>
        <token regexp='yes'>e|ou|como|de|em</token>
        <token min="1" max="2" postag='VMP00.+|NC.+|AQ.+|NP.+|DP.+' postag_regexp='yes'/>
        <token postag='SENT_END|_PUNCT' postag_regexp='yes'/>
        <example>A vida pode ser divertida e descontraída.</example>
        <example>A burocracia não pode ser usada como desculpa, eis que as afilhadas da Globo, no caso em tela o grupo RBS, tem competência pa...</example>
        <example>nenhuma pessoa pode ser privada de seus bens, salvo mediante o pagamento de indenização justa, por motivo de utilidade públ...</example>
        <example>O cão pode ser salvo de suas lesões.</example>
<!--
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
-->
      </antipattern>

      <antipattern>
        <token postag='V.+|DI.+|_PUNCT_COMMA' postag_regexp='yes'/>
        <token postag='CC|NC.+|AQ.+|NP.+' postag_regexp='yes'/>
        <token regexp='no' inflected='yes'>poder</token>
        <token regexp='no' inflected='yes'>ser</token>
        <token min="0" max="1" postag='RG' postag_regexp='no'/> <!-- pode ser TAMBÉM -->
        <token postag='VMP00.+' postag_regexp='yes'/>
        <token regexp='yes'>e|ou|para|em</token>
        <token postag='VMIP3.+|VMN0000|RG' postag_regexp='yes'/>
        <token postag='DA.+|DI.+|VMN0000' postag_regexp='yes'/>
        <example>O resultado nos permite explorar as formas em que a inteligência artificial é e pode ser usada para expandir o jornalismo.</example>
        <example>Se acha que alguma função pode ser adicionada ou deseja reportar um erro, por favor visite o website phpBB Area51, onde você encontrar...</example>
        <example>...io universal e voto direto e secreto, pela população para mandatos de até quatro anos de duração, e pode ser reeleito para mais um mandato.</example>
<!--
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
-->
      </antipattern>

      <antipattern>
        <token postag='PD.+|DA.|DI.+' postag_regexp='yes'/>
        <token postag='Z0.+' postag_regexp='yes'/>
        <token postag='RG' postag_regexp='no'/>
        <token regexp='no' inflected='yes'>poder</token>
        <token regexp='no' inflected='yes'>ser</token>
        <token min="0" max="1" postag='RG' postag_regexp='no'/> <!-- pode ser TAMBÉM -->
        <token postag='VMP00.+' postag_regexp='yes'/>
        <example>Na parte inferior da ponte circulam carros e na parte superior o metrô, no entanto as duas também podem ser atravessadas a pé.</example>
<!--
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
-->
      </antipattern>

      <antipattern>
        <token postag='SENT_START|_PUNCT' postag_regexp='yes'/>
        <token postag='DD.+|DA.+|DI.+|SPS00' postag_regexp='yes'>
          <exception regexp='yes'>cada|xxxx</exception>
        </token>
        <token  min="1" max="2" postag='NC.+|AQ.+|NP.+' postag_regexp='yes'/>
        <token  min="0" max="1" postag='RG' postag_regexp='no'/>
        <token regexp='no' inflected='yes'>poder</token>
        <token regexp='no' inflected='yes'>ser</token>
        <token postag='VMP00.+' postag_regexp='yes'/>
        <token regexp='yes'>por|de|como</token>
        <token postag='Z0.+' postag_regexp='yes'/>
        <token  min="1" max="2" postag='NC.+|AQ.+|NP.+' postag_regexp='yes'/>
        <token><exception regexp='yes'>de|entre|mais</exception></token>
        <example>O mundo inteiro poderia ser destruído por uma bomba atômica.</example>
        <example>Todo poema pode ser considerado de duas maneiras – como aquilo que o poeta tem a dizer, e como uma coisa que ele faz.</example>
        <example>Um servo podia ser vendido de um senhor para outro.</example>
        <example>O livro pode ser lido como uma parábola política relacionada a assuntos em voga na época de Esdras e Neemias (século...</example>
        <example>O acessório ainda pode ser utilizado como uma arma para as gordinhas: leva toda a atenção para os braços!</example>
<!--

        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
-->
      </antipattern>

      <antipattern>
        <token postag='DD.+|SPS00:DA.+' postag_regexp='yes'/>
        <token min="0" max="1" postag='NC.+|AQ.+|NP.+' postag_regexp='yes'/>
        <token regexp='no' inflected='yes'>poder</token>
        <token regexp='no' inflected='yes'>ser</token>
        <token min="0" max="1" postag='RG' postag_regexp='no'/> <!-- pode ser TAMBÉM -->
        <token postag='VMP00.+' postag_regexp='yes'/>
        <token regexp='yes'>[àao]s?|aos?|como|d[ao]s?|de|e|entre|ou|para|por|em</token> <!-- Add more words here as they are found (full list) -->
        <token postag='Z0.+' postag_regexp='yes'/>
        <token min="1" max="2" postag='NC.+|AQ.+|NP.+' postag_regexp='yes'/>
        <token postag='SPS00|CC' postag_regexp='yes'/>

        <example>Essa história pode ser adaptada para um programa de televisão.</example>
        <example>Músicas e vídeos baixados da Internet podia ser transferidos para um cartão SD e colocados no cartucho.</example>
<!--
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
        <example></example>
-->
      </antipattern>

      <pattern>
        <token postag='RG|NC.+|AQ.+|NP.+|RN|VMP00.+|SENT_START|_PUNCT|(SPS00:)?[DP][ADIPRT].+|CS|CC' postag_regexp='yes'>
          <exception postag_regexp='yes' postag='xxxxxxx|xxxxx'/> <!-- "que" CS -->
          <exception regexp='yes'>já|xxxx</exception>
        </token>
        <marker>
          <token regexp='no' inflected='yes'>poder</token>
          <token regexp='no' inflected='yes'>ser</token>
        </marker>
        <token min="0" max="1" postag='RG' postag_regexp='no'/> <!-- pode ser TAMBÉM -->
        <token postag='VMP00.+' postag_regexp='yes'/>
        <token regexp='yes'>[àao]s?|aos?|como|d[ao]s?|de|e|entre|há|ou|para|por|em</token> <!-- Add more words here as they are found -->
<token postag='V.+|DP.+|RG|Z0.+|LEFT_IS_RIGHT|xxx' postag_regexp='yes'/>
        <token min="0" max="1" postag='_PUNCT_COMMA' postag_regexp='no'/>
        <token postag='VMN0000|RG|DA.+|RM|DD.+|DI.+|CS|VMG0000|SPS00|CC|VMP00.+|SPS00:.+|NC.+|AQ.+|NP.+|SENT_END' postag_regexp='yes'/>
      </pattern>
      <filter class="org.languagetool.rules.pt.AdvancedSynthesizerFilter" args="lemmaFrom:3 lemmaSelect:V.* postagFrom:2 postagSelect:V.*"/>
      <message>Se for uma tese de doutoramento, verifique se o 'tom' de redação é o apropriado.</message>
      <suggestion>{suggestion}</suggestion>  
      <example correction="é">Ao conhecer os parâmetros do modelo, este <marker>pode ser</marker> usado para fazer previsões.</example>
      <example correction="são">Ao conhecer os parâmetros dos modelos, estes <marker>podem ser</marker> usados para fazer previsões.</example>

<!--      
contudo o modelo pode também ser aplicado a casos em que as probabilidades individuais não são iguais.
> também

      <example>A compressão é denominada como tal quando a peça estiver sendo "empurrada".</example>
      <example>A equação é usada por centenas de cientistas.</example>
      <example>Apesar de ainda não ter sido lançada oficialmente, a Amarok modificada pela Carlex já pode ser reservada por 48.650 euros, cerca de R$ 200 mil em conversão direta.</example>
      <example></example>
      <example></example>
      <example></example>
      <example></example>
      <example></example>
      <example></example>
      <example></example>
      <example></example>
      <example></example>
      <example></example>
-->

    </rule>
ricardojosehlima commented 1 year ago

Hi, it's complicated really. Look at: Preços e promoções podem ser alterados a qualquer momento, sem prévio aviso. Preços e promoções são alterados a qualquer momento, sem prévio aviso.

The second cannot replace the first and keep the meaning. The modal "poder" is doing something in this and other sentences. Every time there's this situation of meaning involved, I think LT has problems solving. But if you want to continue, best of luck for you, friend, here, no ideas.

marcoagpinto commented 1 year ago

@ricardojosehlima

I will give up on the rule.

A year or two ago, you told me to give up on a rule and I continued working on it and after all the work I gave up.

Do you remember?

Now, I will give up on this one.

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

Thanks!

ricardojosehlima commented 1 year ago

Yeah, I remember. There are some situations that LT can't handle and others that involve some difference in meaning end up being extremely complicated to solve - if they're solvable at all.

marcoagpinto commented 1 year ago

@ricardojosehlima

Dear brother,

I have spent the night thinking about this rule.

My thesis has tons of sentences affected by it.

What if I rewrite the rule and disable it? "[PhD] Em certos contextos esta perífrase poderá ser melhorada bla bla bla" (or something like this)

It will be up to the users to enable it manually.

Basically, if I have to read the almost 600 pages of my thesis to find these situations it will be very painful, so if the rule is disabled only people who really are writing a PhD thesis and want to use the rule will enable it.

Having the rule disabled by default won't annoy users, only who wants it will enable it, and my thesis will progress.

@susanaboatto If I disable it after rewriting, will it be okay? Only users who really want it will enable it manually.

Dear brother Ricardo and sister Susana, sorry if I am bothering you too much with this rule.

susanaboatto commented 1 year ago

Hi @marcoagpinto!

Yes, you can create it and set it as temp_off. We will revisit it later when we come up with a style tool. Hopefully, we'll have tags that users can activate or not to convey a more confident impression depending on their preferences. Then it should work better for those specific cases.

marcoagpinto commented 1 year ago

Hello @susanaboatto and @ricardojosehlima

I have the rule ready and committed: https://github.com/languagetool-org/languagetool/commit/ed7976da32a3a843045c51588c282f06905d521f

type="style" tags='picky' default='temp_off'>

Before committing, I emphasised the suggestion message so that the users will know that is based on the context of the sentences (they decide): <message>Se for uma tese de doutoramento, (em certos contextos) poderá melhorar o 'tom' de redação.</message>

These are the results:

Portuguese (Portugal): 564 total matches
Portuguese (Portugal): 599999 total sentences considered
Portuguese (Portugal): ø0.00 rule matches per sentence

ø=0.00

_11.txt

And the rule became very simple:


    <!-- PODE SER USADO é usado -->
    <rulegroup id='PHD_TESE_PODE_SER_PART_PASS_É_PART_PASS' name="[PhD Tese] Expressões do tipo 'pode ser usado' → 'é usado'" type="style" tags='picky' default='temp_off'>
      <!-- Created by Marco A.G.Pinto, Portuguese rule 2023-04-05 (2-MAR-2023+) -->
      <!--
      SUBRULE1:
      Ao conhecer os parâmetros do modelo, este pode ser usado para fazer previsões. → Ao conhecer os parâmetros do modelo, este é usado para fazer previsões.
      Ao conhecer os parâmetros dos modelos, estes podem ser usados para fazer previsões. → Ao conhecer os parâmetros dos modelos, estes são usados para fazer previsões.

      SUBRULE2: (forced the use of "também")
      O modelo pode também ser aplicado a casos específicos. → O modelo é também aplicado a casos específicos.
      Os modelos podem também ser aplicados a casos específicos. → Os modelos são também aplicados a casos específicos.
      -->

      <!-- pode ser [TAMBÉM] usado -->
      <rule>
        <pattern>
          <marker>
            <token regexp='yes'>podem?|poder|podendo</token>
            <token regexp='yes'>ser(em)?</token>
          </marker>
          <token min="0" max="1" postag='RG' postag_regexp='no'/> <!-- pode ser TAMBÉM -->
          <token postag='VMP00.+' postag_regexp='yes'/>
          <token regexp='yes'>[àao]s?|aos?|como|d[ao]s?|de|e|entre|há|ou|para|por|em</token> <!-- Add more words here as they are found -->
          <token min="0" max="1" postag='V.+|Z0.+' postag_regexp='yes'/>
          <token postag='NC.+|AQ.+|NP.+' postag_regexp='yes'>
            <exception postag_regexp='no' postag='RG'/>
          </token>
        </pattern>
        <filter class="org.languagetool.rules.pt.AdvancedSynthesizerFilter" args="lemmaFrom:2 lemmaSelect:V.* postagFrom:1 postagSelect:V.*"/>
        <message>Se for uma tese de doutoramento, (em certos contextos) poderá melhorar o 'tom' de redação.</message>
        <suggestion>{suggestion}</suggestion>  
        <example correction="é">Ao conhecer os parâmetros do modelo, este <marker>pode ser</marker> usado para fazer previsões.</example>
        <example correction="são">Ao conhecer os parâmetros dos modelos, estes <marker>podem ser</marker> usados para fazer previsões.</example>
      </rule>

      <!-- pode TAMBÉM ser usado -->
      <rule>
        <pattern>
          <marker>
            <token regexp='yes'>podem?|poder|podendo</token>
            <token postag='RG' postag_regexp='no'/> <!-- pode TAMBÉM ser -->
            <token regexp='yes'>ser(em)?</token>
          </marker>
          <token postag='VMP00.+' postag_regexp='yes'/>
          <token regexp='yes'>[àao]s?|aos?|como|d[ao]s?|de|e|entre|há|ou|para|por|em</token> <!-- Add more words here as they are found -->
          <token min="0" max="1" postag='V.+|Z0.+' postag_regexp='yes'/>
          <token postag='NC.+|AQ.+|NP.+' postag_regexp='yes'>
            <exception postag_regexp='no' postag='RG'/>
          </token>
        </pattern>
        <filter class="org.languagetool.rules.pt.AdvancedSynthesizerFilter" args="lemmaFrom:3 lemmaSelect:V.* postagFrom:1 postagSelect:V.*"/>
        <message>Se for uma tese de doutoramento, (em certos contextos) poderá melhorar o 'tom' de redação.</message>
        <suggestion>{suggestion} \2</suggestion>  
        <example correction="é também">O modelo <marker>pode também ser</marker> aplicado a casos específicos.</example>
        <example correction="são também">Os modelos <marker>podem também ser</marker> aplicados a casos específicos.</example>
      </rule>

    </rulegroup>

Thank you, my dear ones!

🤗 🤗 🤗 🤗 🤗 🤗 🤗 🤗 🤗 🤗 🤗 🤗 ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️

marcoagpinto commented 1 year ago

Ahhhh…

I would also like to propose the use of “PhD” in the rules to avoid using “doutoramento” (pt-PT) and “doutorado” (pt-BR).

After the new tags become functional, the PhD students will know what a PhD is and no need for “doutorado”/“doutoramento”.

susanaboatto commented 1 year ago

I think "científico" or "universitário" would be better alternatives, as not every academic text is necessarily related to a PhD.

marcoagpinto commented 1 year ago

I think "científico" or "universitário" would be better alternatives, as not every academic text is necessarily related to a PhD.

Great idea, Susana!

❤️ ❤️ ❤️ ❤️ ❤️