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

[EN] mistake not caught; user feedback #3025

Open ghost opened 4 years ago

ghost commented 4 years ago

This application has helps me a lot This application has helped me a lot

Hnasar commented 4 years ago

Yes, the first is incorrect. These are correct phrases:

bebras123 commented 4 years ago

@MikeUnwalla, can you add this rule?

<rule id="NN_HAS_HAVE_VBZ" name="incorrect verb form">
    <pattern>
        <token postag="SENT_START"/>
        <token postag="DT"/>
        <token postag="NN.*" postag_regexp="yes"/>
        <marker>
            <token regexp="yes">ha(s|ve)</token>
            <or>
                <token postag="VBZ" chunk="I-VP">
                    <exception postag="VBN"/>
                </token>
                <token postag="VBZ">
                    <exception postag="VBZ" negate_pos="yes"/>
                </token>
            </or>
        </marker>
    </pattern>
    <message>Did you mean <suggestion>has <match no="5" postag="VBN"/></suggestion> or <suggestion><match no="5"/></suggestion>?</message>
    <example correction="has helped|helps">This application <marker>has helps</marker> me a lot</example>
    <example>This application helps me a lot</example>
    <example>This application has helped me a lot</example>
    <example correction="has possessed|possesses">Each section <marker>has possesses</marker> its own specialized function.</example>
    <example correction="has been|is">The movie <marker>has is</marker> high on entertainment and it is a good youth entertainer.</example>
    <example correction="has exhibited|exhibits">The exterior <marker>has exhibits</marker> a variety of styles, with Federal and Italianate elements.</example>
    <example correction="has offered|offers">The school <marker>has offers</marker> a wide variety of courses.</example>
    <example correction="has attracted|attracts">This event <marker>has attracts</marker> over 7,000 tourists each year.</example>
    <example correction="has followed|follows">The school <marker>has follows</marker> the IGCSE syllabi in Mathematics and English.</example>
    <example correction="has grown|grows">The college <marker>has grows</marker> considerably over the years and has started accommodating science courses also and underwent a name-change from Arts College to Arts and Science College because of the changes in the course structure.</example>
</rule>
MikeUnwalla commented 4 years ago

Hi @bebras123,

I tested the rule on https://community.languagetool.org/ruleEditor/expert?devMode=true

Because the rule uses <or>, I tested with this token only:

<token regexp="yes">ha(s|ve)</token>
    <token postag="VBZ">
        <exception postag="VBZ" negate_pos="yes"/>
    </token>

The rule gives these false positives:

Unfortunately, I don't have the time to fix the false positives (and possibly others from the other rule). Possibly, one of the other maintainers (@tiff?) can look at this rule.