Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pt] Added antipattern to rule ID:GENERAL_VERB_AGREEMENT_ERRORS #9506

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

marcoagpinto
Copy link
Member

Heya,

Here is an AP to remove false positives.

<antipattern>
<token postag='AQ..S.+|NC.S.+' postag_regexp='yes'/>
<token postag='SPS00'/>
<token>nós</token>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, but I feel like it's not limited to 'nós'. Any plural personal pronoun could be substituted here. 'Para vocês', 'por eles', etc.

@marcoagpinto marcoagpinto merged commit 7a35230 into master Oct 23, 2023
2 checks passed
@marcoagpinto marcoagpinto deleted the lt_marcoagpinto_20231020_0220 branch October 23, 2023 11:14
@marcoagpinto
Copy link
Member Author

@p-goulart

I was going to improve it in the code, but it is a subrule dedicated to “nós” so it won't deal with other pronouns:

        <rule> <!-- #6: $quantifier entre nós + verb -->
            <antipattern>
                <token regexp='yes'>(?:alg|n|nenh)?uma?|maioria|ninguém|nada|tudo</token>
                <token regexp='yes'>de|entre</token>
                <token>nós</token>
                <token min="0" max="3" postag='R.+' postag_regexp='yes'>
                    <exception scope='next'>,</exception>
                </token>
                <token postag='V.[CIS].3S0' postag_regexp='yes'/>
            </antipattern>
            <antipattern>
                <token>nós</token>
                <token regexp='yes'>aqui|lá|ali</token>
                <token>fora</token>
                <example>Nós aqui fora não concordamos</example>
            </antipattern>


            <antipattern>
                <token postag='AQ..S.+|NC.S.+' postag_regexp='yes'/>
                <token postag='SPS00'/>
                <token>nós</token>
                <token postag='V.[CIS].3S0' postag_regexp='yes'/>
                <example>Este método por nós empregue reutiliza o código-fonte.</example>
                <example>Por exemplo, no âmbito do tratamento de pedidos, a transportadora contratada por nós receberá os dados necessários para a execução do seu trabalho.</example>
                <example>É bom para nós entender outras culturas.</example>
                <example>Foi muito difícil pra nós decidir qual comprar.</example>
                <example>Quando alguma garota te segurar, o resto de nós terá uma chance.</example>
            </antipattern>



            <pattern>
                <marker>
                    <token>nós</token>
                    <token min="0" max="3" postag='R.+' postag_regexp='yes'>
                        <exception>,</exception>
                    </token>
                    <token postag='V.[CIS].([23]P|[123]S).' postag_regexp='yes'>
                        <exception>como</exception>
                        <exception postag='V.[CIS].1P0' postag_regexp='yes'/>
                    </token>
                </marker>
                <token negate_pos='yes' postag='AQ..S.+' postag_regexp='yes'/>
            </pattern>
            <message>&MSG_ECV;</message>
            <suggestion><match no='1' include_skipped='all'/> <match no='2' include_skipped='all'/> <match no='3' include_skipped='all' postag='(V.[CIS].)..(.)' postag_replace='$1\1P$2' postag_regexp='yes'/></suggestion>
            <suggestion><match no='1' include_skipped='all'>nos</match> <match no='2' include_skipped='all'/> <match no='3' include_skipped='all'/></suggestion>
            <example correction='Nós não passeamos|Nos não passeia'><marker>Nós não passeia</marker> na praia.</example>
            <!-- 	TODO 'Nós não passeamo' is a inflection for reflexive forms. Find a way to remove it from suggestions -->
            <example><marker>Nós ainda não passeamos</marker> na praia.</example>
            <example>Nós preocupar-nos-iamos, talvez, com esta manifestação de ignorância.</example>
            <example>Um de nós passeia na praia.</example>
            <example>E antes em <marker>nós semeia</marker> esta vileza.</example>
            <example>A probabilidade de prosseguir trilhas entre <marker>nós é</marker> conseguida na função.</example>
        </rule>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants