Back to LanguageTool Homepage - Privacy - Imprint

[En] New Preposition Rule: agree with


#1

This is my new rule to detect wherever 'agree with' are miswritten as 'agree to/about etc'. I tested the code against many example sentences so that it does not raise a false alarm when 'agree to' or 'agree upon' is needed. It may not be 100% accurate as this type of rules are not easy to write with the imagination power of a human being. Time is also a killer factor. Thousands of examples should be referred to as patterns to make this kind of rules near to accurate. We should not expect 100% accuracy unless we take the help of some kind of linguistic automation tool like freeling and employ the statistical techniques to make rules by searching sentences from Wikipedia and tatoeba.
Unless we have this, I tried my best within all the time constraints, all my limitations.
Please test it, modify the code if required and publish it.

<rulegroup id="AGREE_WITH" name="agree with">
<!-- English rule, 2016-11-10 OK-->
<rule>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="DT" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token>agreed</token>
      <token regexp="yes">and|on|by</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="DT" postag_regexp="yes"></token>
      <token postag="NNP" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token>agreed</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="CC" postag_regexp="yes"></token>
      <token postag="VBN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected="yes">agree</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="DT" postag_regexp="yes"></token>
      <token postag="JJ" postag_regexp="yes"></token>
      <token postag="NN" postag_regexp="yes"></token>
  </antipattern>
    <antipattern>
      <token inflected="yes">agree</token>
      <token>as</token>
      <token>long</token>
      <token>as</token>
  </antipattern>
  <antipattern>
      <token inflected="yes">agree</token>
      <token inflected="yes">to</token>
      <token postag="JJ" postag_regexp="yes"></token>
      <token postag="NNS" postag_regexp="yes"></token>
      <token regexp="yes">of</token>
      <token postag="NN:UN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected="yes">agree</token>
      <token inflected="yes">to</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token postag="NN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected="yes">agree</token>
      <token inflected="yes">to</token>
      <token postag="NNP" postag_regexp="yes"></token>
      <token postag="POS" postag_regexp="yes"></token>
      <token postag="POS" postag_regexp="yes"></token>
      <token postag="NN" postag_regexp="yes"></token>
      <token postag="SENT_END"></token>
  </antipattern>
  <antipattern>
      <token inflected="yes">agree</token>
      <token inflected="yes">on</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token postag="JJR" postag_regexp="yes"></token>
      <token postag="JJ" postag_regexp="yes"></token>
      <token postag="NN|NN:UN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected="yes">agree</token>
      <token>)</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="DT" regexp="yes"></token>
      <token postag="NN:UN" regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="PRP\$" postag_regexp='yes'></token>
      <token postag="NN:UN" regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="VB" postag_regexp='yes'></token>
      <token postag="PRP|PRP\$" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">that</token>
      <token postag="NN:U|NNP|PRP|PRP\$|DT|VB" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">among</token>
      <token postag="PRP" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">among</token>
      <token postag="PRP" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="DT" regexp="yes"></token>
      <token postag="NNS" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="VBP" postag_regexp="yes"></token>
      <token postag="RP" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">on</token>
      <token postag="WRB" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="VB|VBP" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag=",|." postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="NN:UN" postag_regexp='yes'></token>
      <token postag="NNS|VBZ" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="PRP\$" postag_regexp='yes'></token>
      <token postag="NN" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token regexp="yes">it|this|that</token>
      <token postag="SENT_END"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="DT|WP" postag_regexp="yes"></token>
      <token regexp="yes">proposal|plan|deal|compromise|entry|expropriation|stipulation|request|contract|marriage|divorce|economic|financial|suggestion|opinion|offer|terms|realistic|match|game|play</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">upon</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token regexp="yes">verdict</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">on</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">term|point|research|strategy</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">on</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">term|point|research|strategy</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">man</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token postag="DT" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">next|previous|former|earlier|upcoming|coming|latter|past</token>
      <token postag="NN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="IN" postag_regexp="yes"></token>
      <token postag="DT" postag_regexp="yes"></token>
      <token postag="NN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="WP" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="PRP\$" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">proposal|plan|deal|compromise|entry|expropriation|stipulation|request|contract|marriage|divorce|economic|financial|suggestion|opinion|offer|terms|realistic|match|game|play</token>
  </antipattern>

  <pattern>
    <marker>
      <token inflected='yes'>agree<exception regexp='yes' scope='next'>that|the</exception></token>
      <token regexp='yes' negate='yes' skip='-1'>with</token>
    </marker>
    <token postag='NN|NNS|NN:U|NN:UN|NNP|NNPS|PRP|PRP\$' postag_regexp='yes'></token>
  </pattern>
  <message>Did you mean: <suggestion>agree with</suggestion>? agree with (have same opinion) otherwise: [Phrase] Agree to (accept/abide by/acquiesce/applaud/commit/comply)(idea/concept)</message>
  <short>Wrong preposition: agree with (have same opinion) otherwise: Agree to (idea) (accept)</short>
  <example correction='agree with'>If you <marker>agree to</marker> him then please show your support to him.</example>
  <example>If you agree with him then please show your support to him.</example>
  <example correction='agree with'>We cannot <marker>agree to</marker> him.</example>
  <example>We cannot agree with him.</example>
  <example correction='agree with'>We cannot <marker>agree to</marker> them.</example>
  <example>We cannot agree with them.</example>
  <example correction='agree with'>We cannot <marker>agree to</marker> you.</example>
  <example>We cannot agree with you.</example>
  <example correction='agree with'>We cannot <marker>agree to</marker> her.</example>
  <example>We cannot agree with her.</example>
</rule>

<!-- English rule, 2016-11-13 OK-->
<rule>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="DT|WP" postag_regexp="yes"></token>
      <token regexp="yes">proposal|plan|deal|compromise|entry|expropriation|stipulation|request|contract|marriage|divorce|economic|financial|suggestion|opinion|offer|terms|realistic|match|game|play</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">upon</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token regexp="yes">verdict</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">on</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">term|point|research|strategy</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">on</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">term|point|research|strategy</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">man</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token postag="DT" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">next|previous|former|earlier|upcoming|coming|latter|past</token>
      <token postag="NN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="WP" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="PRP\$" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">proposal|plan|deal|compromise|entry|expropriation|stipulation|request|contract|marriage|divorce|economic|financial|suggestion|opinion|offer|terms|realistic|match|game|play</token>
  </antipattern>

<pattern>
  <marker>
      <token inflected='yes'>agree</token>
      <token negate='yes'>with</token>
  </marker>
  <token postag='DT'></token>
  <token postag='JJ|NN' postag_regexp='yes'></token>
  <token postag='JJ|NN:UN' postag_regexp='yes'></token>
  <token postag='NN|NNS|NN:U|NN:UN|NNP|NNPS|PRP|PRP\$' postag_regexp='yes'></token>
</pattern>
<message>Did you mean: <suggestion>agree with</suggestion>? agree with (have same opinion) otherwise: [Phrase] Agree to (accept/abide by/acquiesce/applaud/commit/comply)(idea/concept)</message>
<short>Wrong preposition: agree with (have same opinion) otherwise: Agree to (idea) (accept)</short>
<example correction='agree with'>We don't <marker>agree to</marker> that communist party member.</example>
<example>We don't agree with that communist party member.</example>
<example correction='agree with'>We don't <marker>agree to</marker> that political party member.</example>
<example>We don't agree with that political party member.</example>
</rule>

<!-- English rule, 2016-11-13 OK-->
<rule>
  <antipattern>
      <token>agreed</token>
      <token regexp="yes">and|on|by</token>
  </antipattern>
  <antipattern>
      <token>agreed</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="CC" postag_regexp="yes"></token>
      <token postag="VBN" postag_regexp="yes"></token>
  </antipattern>
    <antipattern>
      <token inflected="yes">agree</token>
      <token>as</token>
      <token>long</token>
      <token>as</token>
  </antipattern>
  <antipattern>
      <token inflected="yes">agree</token>
      <token inflected="yes">to</token>
      <token postag="JJ" postag_regexp="yes"></token>
      <token postag="NNS" postag_regexp="yes"></token>
      <token regexp="yes">of</token>
      <token postag="NN:UN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected="yes">agree</token>
      <token inflected="yes">to</token>
      <token postag="NNP" postag_regexp="yes"></token>
      <token postag="POS" postag_regexp="yes"></token>
      <token postag="POS" postag_regexp="yes"></token>
      <token postag="NN" postag_regexp="yes"></token>
      <token postag="SENT_END"></token>
  </antipattern>
  <antipattern>
      <token inflected="yes">agree</token>
      <token>)</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="PRP\$" postag_regexp='yes'></token>
      <token postag="NN:UN" regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="VB" postag_regexp='yes'></token>
      <token postag="PRP|PRP\$" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">that</token>
      <token postag="NN:U|NNP|PRP|PRP\$|DT|VB" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">among</token>
      <token postag="PRP" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">among</token>
      <token postag="PRP" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="DT" regexp="yes"></token>
      <token postag="NNS" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="VBP" postag_regexp="yes"></token>
      <token postag="RP" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">on</token>
      <token postag="WRB" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="VB|VBP" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag=",|." postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="NN:UN" postag_regexp='yes'></token>
      <token postag="NNS|VBZ" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="PRP\$" postag_regexp='yes'></token>
      <token postag="NN" postag_regexp='yes'></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token regexp="yes">it|this|that</token>
      <token postag="SENT_END"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="DT|WP" postag_regexp="yes"></token>
      <token regexp="yes">proposal|plan|deal|compromise|entry|expropriation|stipulation|request|contract|marriage|divorce|economic|financial|suggestion|opinion|offer|terms|realistic|match|game|play</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">upon</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token regexp="yes">verdict</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">on</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">term|point|research|strategy</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">on</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">term|point|research|strategy</token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token regexp="yes">to</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">man</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token postag="DT" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="DT" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">next|previous|former|earlier|upcoming|coming|latter|past</token>
      <token postag="NN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="IN" postag_regexp="yes"></token>
      <token postag="DT" postag_regexp="yes"></token>
      <token postag="NN" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="WP" postag_regexp="yes"></token>
  </antipattern>
  <antipattern>
      <token inflected='yes'>agree</token>
      <token postag="IN|TO" postag_regexp="yes"></token>
      <token postag="PRP\$" postag_regexp="yes"></token>
      <token inflected='yes' regexp="yes">proposal|plan|deal|compromise|entry|expropriation|stipulation|request|contract|marriage|divorce|economic|financial|suggestion|opinion|offer|terms|realistic|match|game|play</token>
  </antipattern>

<pattern>
  <marker>
  <token inflected='yes'>agree</token>
  <token negate='yes'>with</token>
  </marker>
  <token postag='DT'></token>
  <token postag='NN|NNS|NN:U|NN:UN|NNP|NNPS|PRP|PRP\$' postag_regexp='yes'></token>
</pattern>
<message>Did you mean: <suggestion>agree with</suggestion>? agree with (have same opinion) otherwise: [Phrase] Agree to (accept/abide by/acquiesce/applaud/commit/comply)(idea/concept)</message>
<short>Wrong preposition: agree with (have same opinion) otherwise: Agree to (idea) (accept)</short>
<example correction='agree with'>I was simply saying that I <marker>agree to</marker> that man.</example>
<example>I was simply saying that I agree with that man.</example>
</rule>
</rulegroup>

(Mike Unwalla) #2

Added to my task list.


#3

Thanks @Mike_Unwalla, for adding this to your task list.


(Nicholas Walker) #4

Hello RuleFreak,

I checked your rules against the BNC-COCA 14m word corpus and the 19 sentences below (somewhat shortened and cleaned up) all produced false positives.

I highly recommend using Lextutor.ca. It has a range of corpora that you can use here: http://lextutor.ca/conc/eng/

You can find the corpus entries that generated the false alarms here: http://www.lextutor.ca/cgi-bin/conc/wwwassocwords.pl?lingo=English&unframed=true&SearchType=equals&SearchStr=agree+to&Corpus=bncoca_1-2.txt&ColloSize=1&SortType=left&LineWidth=120&Maximum=999&Gaps=no_gaps&Fam_or_Word=word&AssocWord=&Sinclair=4&AssocSide=either&blockers=&ScanWidth=5&ScanFreq=4

  1. A historic opportunity If Russia and NATO can AGREE TO a limited partnership.
  2. But could not all those who cherish political freedom AGREE TO the presumption of liberty as a minimal common denominator.
  3. The Middle and far East and the Pacific but would also likely AGREE TO the four freedoms enunciated at the October meeting.
  4. I said okay, I'll AGREE TO it, but I don't like it.
  5. The Court was asked to rule on whether an employee may AGREE TO an amendment of his employment relationship.
  6. All must AGREE TO the surrender If there is to be a renewal.
  7. Equality to two right ones does necessarily AGREE TO and is inseparable from the three angles of a triangle.
  8. Emma would not AGREE TO this and began a warm defence of Miss Fairfax.
  9. I fear that your father would not AGREE TO my methods.
  10. Ministers can still AGREE TO changes in the output.
  11. She made it clear that she would put him out of business if he didn t AGREE TO her terms.
  12. There was pressure on the Foreign Relations Committee Chairman Jesse Helms to AGREE TO them.
  13. Everyone else was urging Algeria to AGREE TO an international commission of inquiry.
  14. You don t honestly expect me to AGREE TO a statement like that do you?
  15. It puts a lot of strain on us, trying to get us to AGREE TO things that i'm sure most people would reject.
  16. You don't honestly expect me to AGREE TO that idea.
  17. I'm afraid they'll have to AGREE TO a change of day or it'll be cancelled.
  18. Bill Clinton will ultimately AGREE TO something like a billion tax cut.
  19. Indeed we cooperate when we AGREE TO rules of the game that limit competition.

I hope this helps.
Nick


#5

Thanks for informing me about their page to find sentences with the selected word.
A different question, How can I download their entire corpus? I need it.


(Nicholas Walker) #6

I am sorry. I don't know. You could ask Professor Tom Cobb, the developer, or you could do a web search for the corpora you want. Some are publically available. Some aren't.


(linzi) #7

interested in the statement you mentioned "> employ the statistical techniques to make rules by searching sentences from Wikipedia and tatoeba." and could you recommend any material about this topic? Thanks.