Back to LanguageTool Homepage - Privacy - Imprint

Add rules


(Mility) #1
<rule id="E_NP_PLURAL_IN_E_NP_SINGULAR_IS" name="e-np-plural in e-np-singular is(are)">    
		<pattern>
			<token chunk="B-NP-plural" min="0"></token>
			<token chunk="E-NP-plural"></token>
			<token postag='IN' skip="-1">
				<exception>as</exception>
			</token>
			<token chunk="B-NP-singular" min="0"></token>
			<token chunk="E-NP-singular"></token>
			<marker>
				<token>is</token>
			</marker>
		</pattern>
		<message>Subject-Verb Agreement error, did you mean <suggestion>are</suggestion>?</message>
		<example correction=''>Poems by Longfellow <marker>is</marker> my favorite TOPIC.</example>
		<example>Poems by Longfellow are my favorite TOPIC.</example>
	</rule>

<!-- English rule, 2015-09-07 -->

<rule id="E_NP_SINGULAR_IN_E_NP_PLURAL_ARE" name="e-np-singular in e-np-plural are(is)">    
		<pattern>
			<token chunk="B-NP-singular" min="0"></token>
			<token chunk="E-NP-singular"></token>
			<token postag='IN' skip="-1">
				<exception>as</exception>
			</token>
			<token chunk="B-NP-plural" min="0"></token>
			<token chunk="E-NP-plural"></token>
			<marker>
				<token>are</token>
			</marker>
		</pattern>
		<message>Subject-Verb Agreement error, did you mean <suggestion>is</suggestion>?</message>
		<example correction=''>The pair of scissors <marker>are</marker> on the table.</example>
		<example>The pair of scissors is on the table.</example>
	</rule>

(Mility) #2
<rule id="E_NP_SINGULAR_IN_E_NP_PLURAL_WERE" name="e-np-singular in e-np-plural were(was)">    
		<pattern>
			<token chunk="B-NP-singular" min="0"></token>
			<token chunk="E-NP-singular"></token>
			<token postag='IN' skip="-1">
				<exception>as</exception>
			</token>
			<token chunk="B-NP-plural" min="0"></token>
			<token chunk="E-NP-plural"></token>
			<marker>
				<token>were</token>
			</marker>
		</pattern>
		<message>Subject-Verb Agreement error, did you mean <suggestion>was</suggestion>?</message>

		<example correction=''>The car with many riders <marker>were</marker> sppeeding around the curve.</example>
		<example>The car with many riders was sppeeding around the curve.</example>
	</rule>

(Mility) #3
 
<rule id="B_NP_SINGULAR_AND_B_NP_SINGULAR_VBZ" name="singular and singular vbz(vbp)">

                <pattern>
                        <token chunk="B-NP-singular" />
                        <token chunk="E-NP-singular" />
                        <token>and</token>
                        <token chunk="B-NP-singular" />
                        <token chunk="E-NP-singular" />
                        <marker>
                                <token postag='VBZ'></token>
                        </marker>
                </pattern>
                <message>Compound subjects joined by and are always plural: <suggestion><match no="6" postag="VBP" /></suggestion></message>
                <short>Subject-Verb Agreement</short>
                <example correction=''>A pencil and an eraser <marker>makes</marker> writing easier.</example>
                <example>A pencil and an eraser make writing easier.</example>
        </rule>

(Daniel Naber) #4

Have you checked these rules against e.g. Wikipedia? Doing so leads to some false alarms which should be analyzed to see if they can be avoided. Some examples:

A large collection of books on alchemy is kept in the Bibliotheca Philosophica...
...to match each other's styles, but it is much harder to keep dozens...
Open the cupboard to the left, the bottles are in there.
...the same day outside North America (if the awards are even televised).
...hemisphere of the cortex and that autism is a disorder of the association cortex.
...reason for the move to late February and early March is to avoid the awards ceremony occurring


(Mility) #5

Sorry, I only test them in Rule-Editor, and I will rewrite them.


(Mility) #6

How about this rule?

<rule id="BE_INTERESTINF_IN" name="be interesting(interested) in">    
		<pattern>
			<token inflected='yes'>be</token>
			<marker>
				<token inflected='yes'>interest<exception>interested</exception></token>
			</marker>
			<token>in</token>
		</pattern>
		<message>Did you mean <suggestion>interested</suggestion>?</message>
		<example correction=''>I am <marker>interesting</marker> in this book.</example>
		<example>I am interested in this book.</example>
	</rule>
<rule id="SUN_RAISED" name="sun raised(risen)">

 <pattern>
  <token skip='-1'>sun</token>
  <marker>
  <token inflected='yes'>raise</token>
  </marker>
 </pattern>
 <message>Did you mean <suggestion>risen</suggestion>?</message>
 <example correction=''>The sun has not <marker>raised</marker>.</example>
 <example>The sun has not risen.</example>
</rule>

(Daniel Naber) #7

Thanks, I've added INTERESTINF_IN. About SUN_RAISED: could a native speaker comment on this? I get a false alarm for e.g. "The sun in the sky never raised an eye to me." and I'm not sure if that skip="-1" (which allows any number of words to occur between "sun" and the forms of "raise") isn't too much.