languagetool-org / languagetool

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

[LO-Add-on] Goal-specific rules don't work? #9474

Closed marcoagpinto closed 7 months ago

marcoagpinto commented 10 months ago

Heya, @FredKruse

I believe that goal-specific rules aren't working both in the stand-alone tool and in LibreOffice.

O crime é perigoso e o seu financiamento toma diversas formas.

The sentence above in Portuguese was supposed to trigger:

        <rule id='TOMAR_ASSUMIR' name="[Universitário][Científico] V. Tomar → V. Assumir" tone_tags="academic" is_goal_specific="true">
            <pattern>
                <token postag='SENT_START|AQ.+|NC.+|NP.+|CS|CC' postag_regexp='yes'/>
                <marker>
                    <token inflected='yes'>tomar
                        <exception scope='previous' postag_regexp='yes' postag='V.+|PP.+'/>
                        <exception scope='previous' regexp='yes'>decis(ão|ões)</exception>
                    </token>
                </marker>
                <token min='0' max='2' postag='SPS00|(SPS00:)?[DP][ADIPRT].+|RG' postag_regexp='yes'/>
                <token regexp='yes'>cert[ao]s?|determinad[ao]s?|diferentes?|divers[ao]s?|enormes?|formas?|imens[ao]s?|inúmer[ao]s|múltipl[ao]s|vári[ao]s|variad[ao]s</token>
                <token postag='AQ.+|NC.+|PI.+' postag_regexp='yes'>
                    <exception regexp='yes' inflected='yes'>bebida|café|caneca|cerveja|chá|colher|copo|drink|frasco|garfo|garrafa|garrafão|xícara|shot|su[mc]o|vinho|gelado|sorvete|blíster|caixa|comprimido|contracetivo|embalagem|medicação|medicamento|pílula|remédio|autocarro|automóvel|avião|carrinha|carro|jato|ônibus|táxi|veículo|comboio|trem|voo|barc[ao]|bote|canoa|ferry|banho|duche</exception> <!-- Add more words as they are found -->
                </token>
            </pattern>
            <message>Num contexto formal/científico, é preferível escrever &quot;assumir&quot;.</message>
            <suggestion><match no='2' postag='V.+' postag_regexp='yes'>assumir</match></suggestion>
            <example correction="assume">O crime <marker>toma</marker> formas impensáveis.</example>
            <example correction="assume">O crime <marker>toma</marker> formas diversas.</example>
            <example correction="assume">O crime é perigoso e o seu financiamento <marker>toma</marker> diversas formas.</example>
            <example correction="assume">O crime é perigoso e o seu financiamento <marker>toma</marker> as mais diversas formas.</example>
        </rule>

Is it a known issue?

Thanks!

evan-defran-lt commented 10 months ago

Hi Marco,

Rules with the is_goal_specific attribute set to true will display only when the user selects an associated Writing Goal in the Editor. The Writing Goal feature is currently available only in the Editor, not in any of the add-ons.

marcoagpinto commented 10 months ago

Heya,

So, could the add-ons ignore the is_goal_specific flag and use ALL rules?

evan-defran-lt commented 10 months ago

Rules with the attribute is_goal_specific="true" are displayed only in the Editor when an associated Writing Goal is selected. They are not displayed in the add-ons.

FredKruse commented 7 months ago

@marcoagpinto I think this issue can be closed.

marcoagpinto commented 7 months ago

Yes, thanks!