Back to LanguageTool Homepage - Privacy - Imprint

English rule had VBP


(PeterLawrence) #1

Hi, I've found that the rule HAVE_PART_AGREEMENT didn't seem to pick up a few errors with the word "had" followed by a verb present tense. Hence, I've derived the following rule.

<rule id="HAD-VBP" name="Had + verb present tense">    
         <pattern>
          <token>had</token>
          <marker>
             <token postag='VBP'>
               <exception postag='JJ|JJR|JJS|VBN' postag_regexp='yes'>
               </exception><exception>become</exception>
             </token>
          </marker>
         </pattern>
         <message>
          Possible agreement error -- use past participle here:
          <suggestion><match no="2" postag="VBN"/></suggestion>.
        </message>
        <example type="incorrect">They had <marker>play</marker> the game</example>
        <example type="correct">They had <marker>played</marker> the game</example>
        </rule>

It's the only rule which spots the errors in these sentences
"They had shoot the chicken" or
"They had play the game".
However, for something like "They had modify the text.", this is flagged by this rule as well as HAVE_PART_AGREEMENT rule.


(PeterLawrence) #2

Sorry the rule "HAVE_PART_AGREEMENT" also identifies the error in "They had shoot the chicken"


(Daniel Naber) #3

Thanks. I tried this on a few hundred thousand test sentences I got some false alarms which could be fixed with these anitpatterns:

            <antipattern>

                <token>had</token>
                <token chunk="B-NP-plural"></token>
            </antipattern>
            <antipattern>
                <token>had</token>
                <token chunk="B-NP-singular"></token>
            </antipattern>

Some examples of sentences that would cause a false alarm without these patterns:

We had snow this morning.
I had curry and rice last night.
He had trouble breathing.
They had art lessons from John Bradley of Keighley.
It had feature limitations such as...
Tom had lamb chops, potatoes and mushroom soup for dinner.
The sources he had access to gave him less information...
You've already had cake.
I didn't know you had hay fever.

So your rule has been added and will go live tonight on languagetool.org, thanks again!


(PeterLawrence) #4

Thanks, I was kind of thinking of taking a look at the HAVE_PART_AGREEMENT and see why it identified quite a few "had"-VBP cases, but for some reason missed "play".
I tested the last rule on the website languagetool rule editor, so I assume you must have access to something a bit more sophisticated.

I've also taken a look at that-VBP and have come up with this rule...

<rule id="THAT-VBP" name="That + verb present tense">

         <pattern>
          <token>that</token>
          <marker>
             <token postag='VBP'><exception regexp='yes'>use|emphasize</exception></token>
          </marker>
          <token min='0' postag='JJ|JJR|JJS' postag_regexp='yes'></token>
          <token regexp='yes'>the|here</token>
         </pattern>
         <message>
          Possible agreement error -- use past participle here:
          <suggestion><match no="2" postag="VBN"/></suggestion>.
        </message>
        <example type="incorrect">The person that <marker>lay</marker> the road</example>
        <example type="correct">The person that <marker>laid</marker> the road.</example>
        <example type="incorrect">The person that <marker>walk</marker> around the world</example>
        <example type="correct">The person that <marker>walked</marker> around the world.</example>
</rule>

This one also didn't identified any false alarms on the ruleEditor.


(Daniel Naber) #5

The way I test is documented at http://wiki.languagetool.org/developing-robust-rules#toc3. I use Wikipedia and Tatoeba data. Here are some sentences that are matched by THAT-VBP:

...such as those that occur on the illuminated side of Earth.
Lincoln's Navy set up a naval blockade that shut down the South's normal trade...
...collectivism has triumphed to such an extent that even the word 'I' has been forgotten and replaced with...
..l and contemporary anthropological materials that document the world's cultures and the history of anthropol...
Agriculture is the set of activities that transform the environment for the production of animals and...
Structural formulae that represent the bonds as being at right angles to one another...


(PeterLawrence) #6

OK thanks I have worked on a number of other rules so will use the larger test data in future.
The English chucker based rules look interesting and is something I'll look into.