languagetool-org / languagetool

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

[pt] Idea for rule: “de propósito” → “deliberadamente” - 2023-05-24 #8692

Open marcoagpinto opened 1 year ago

marcoagpinto commented 1 year ago

@ricardojosehlima

Heya, Ricardo.

What about this idea?: fizeram [aquilo] de propósito

de propósitodeliberadamente

Is it a good idea?

Does it only work with the verb “fazer”?

What kind of rule shall it be? Formal? Academic? Scientific?

Thanks!

ricardojosehlima commented 1 year ago

Looks good although the suggestion is longer than what it'll replace. As for the kind, maybe all alternatives?

marcoagpinto commented 1 year ago

I can't remember the alternatives 😢 😢 😢 😢 😢 😢

ricardojosehlima commented 1 year ago

What kind of rule shall it be? Formal? Academic? Scientific? These are the alternatives

marcoagpinto commented 1 year ago

Ahhhhh… I thought “alternatives” meant to suggest other words.

😄

I will work on it in the afternoon.

Thanks!

marcoagpinto commented 1 year ago

@ricardojosehlima

Heya, Ricardo!

It is done!: https://github.com/languagetool-org/languagetool/commit/528c678e865c86ad2c8a187f037dd83ae8623cfd

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

0.txt

    <!-- DE PROPÓSITO deliberadamente -->
    <rulegroup id='DE_PROPOSITO_DELIBERADAMENTE' name="[Científico] 'de propósito' → 'deliberadamente'" type="style" tags="picky" default='temp_off'>
      <!-- Created by Marco A.G.Pinto with Ricardo Joseh Lima suggestions, Portuguese rule 2023-05-25 (2-MAR-2023+) -->
      <!--
      Eles fizeram de propósito. → Eles fizeram deliberadamente.
      Eles fizeram aquilo de propósito. → Eles fizeram aquilo deliberadamente.
      Eles fizeram-no de propósito. → Eles fizeram-no deliberadamente.
      -->
      <rule>
        <pattern>
          <token inflected='yes'>fazer</token>
          <token min='0' max='1' postag='(SPS00:)?[DP][ADIPRT].+' postag_regexp='yes'/>
          <marker>
            <token>de</token>
            <token>propósito</token>
          </marker>
        </pattern>
        <message>Num contexto formal/científico, é preferível escrever 'deliberadamente'.</message>
        <suggestion>deliberadamente</suggestion>
        <example correction="deliberadamente">Eles fizeram <marker>de propósito</marker>.</example>
        <example correction="deliberadamente">Eles fizeram aquilo <marker>de propósito</marker>.</example>
      </rule>

      <rule>
        <pattern>
          <token inflected='yes'>fazer</token>
          <token regexp='yes' spacebefore='no'>&tracos_de_separacao;</token>
          <token regexp='yes' spacebefore='no'>&pronomes_obliquos;</token>
          <marker>
            <token>de</token>
            <token>propósito</token>
          </marker>
        </pattern>
        <message>Num contexto formal/científico, é preferível escrever 'deliberadamente'.</message>
        <suggestion>deliberadamente</suggestion>
        <example correction="deliberadamente">Eles fizeram-no <marker>de propósito</marker>.</example>
      </rule>

    </rulegroup>

Thanks!

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