Back to LanguageTool Homepage - Privacy - Imprint

Add rule


(Mility) #21
<rule id="LEARN_NNNNS_TO_DO" name="wrong preposition: 'learn sth on do'(to do)">    
             <pattern>
              <token inflected='yes'>learn</token>
             <token postag='NN|NNS' postag_regexp='yes'><exception>tool</exception></token>
             <marker>
             <token postag='IN'><exception>to</exception></token>
             </marker>
               <token postag='VB'></token>
             </pattern>
            <message>Did you mean <suggestion>to</suggestion>?</message>
            <example correction=''>We can learn ways <marker>on</marker> manage complex relationships with colleagues.</example>
            <example>We can learn ways to manage complex relationships with colleagues.</example>
            </rule>

(Daniel Naber) #22

This rule matches some sentences which are, I think, correct, e.g.:

“it is futile to seek meaning in life”
“so it is difficult to see how to identify”
“At six months of age it is able to dig its own burrows”
“Is it possible to take a shuttle bus from the airport to the hotel?”
“Is it dangerous to take a subway alone?”


(Daniel Naber) #23

Thanks, I’ve added this rule.


(Mility) #24

Thanks, it is not a robust rule.


(Daniel Naber) #25

Thanks, I’ve added this rule, too.


(Mility) #26
<rule id="UPPERCASE_WORDS_AFTER_COMMA" name="uppercase(lowercase) words after comma">    
               <pattern>
                 <token>,</token>
                 <marker>
                 <token case_sensitive="yes" regexp="yes">[A-Z][a-z]+ <exception postag='NNP|null' postag_regexp='yes'></exception></token>
                 </marker>
               </pattern>
                 <message>The word <match no="2"/> should probably be lowercase: <suggestion><match case_conversion="startlower" no="2"></match></suggestion>.</message>
                 <example correction=''>As a result, <marker>You</marker> will have your rule in XML format.</example>
                 <example>As a result, you will have your rule in XML format.</example>  
              </rule>
<rule id="IT_IS_JJ_TO_VBG" name="it is jj to vbg(do)">    
           <pattern>
              <token>it</token>
              <token inflected='yes'>be</token>
              <token min='0' max='1'>not</token>
              <token postag='JJ'></token>
              <token>to</token>
              <marker>
               <token postag='VBG' postag_regexp='yes'></token>
              </marker>
          </pattern>
              <message>Did you mean <suggestion><match no ="6"  postag ="VB" /></suggestion>?</message>
              <example correction=''>They think that it is not easy to <marker>grasping</marker> skills.</example>
              <example>They think that it is not easy to grasp skills.</example>
              </rule>

	  	<!-- English rule, 2015-04-26 -->
        
<rule id="BE_USE_TO_DO" name="be use(used) to do">    
             <pattern case_sensitive='yes'>
             <token inflected='yes'>be</token>
             <marker>
             <token>use</token>
             </marker>
             <token>to</token>
              </pattern>
              <message>Did you mean <suggestion><match no="2" postag="VBD"></match></suggestion>?</message>
              <example correction=''>He is <marker>use</marker> to a vegetarian diet.</example>
              <example>He is used to a vegetarian diet.</example>
             </rule>





<rulegroup id="NEEDN'T_TO_DO_AND_DON'T_NEED_DO" name="needn't to do(do) and don't need do(to do)">    
         <rule>
          <pattern>
         <token>need</token>
        <token>not</token>
         <marker>
           <token>to</token>
          <token postag='VB'></token>
         </marker>
         </pattern>
         <message>Did you mean <suggestion><match no = "4"/></suggestion>?</message>
         <example correction=''>They need not <marker>to change</marker> them.</example>
          <example>They need not change them.</example>
          </rule>

       <!-- English rule, 2015-04-26 -->
         
<rule>    
            <pattern>
            <token>needn</token>
            <token spacebefore="no" regexp="yes">['’]</token>
            <token>t</token>
            <marker>
            <token>to</token>
            <token postag='VB'><exception regexp='yes'>get</exception></token>
           </marker>
           </pattern>
           <message>Did you mean <suggestion><match no = "4"/></suggestion>?</message>
           <example correction=''>They needn't <marker>to change</marker> them.</example>
           <example>They needn't change them.</example>
            </rule>

      
<rule>    
             <pattern>
             <token>do</token>
             <token > not</token>
             <token>need</token>
             <marker>
           <token postag='VB'><exception regexp='yes'>proof|fake</exception></token>
           </marker>
             </pattern>
             <message>Did you mean <suggestion>to <match no = "4"/></suggestion>?</message>
             <example correction=''>They do not need <marker>change</marker> them.</example>
             <example>They do not need to change them.</example>
          </rule>

      
<rule>    
         <pattern>
           <token>don</token>
             <token spacebefore="no" regexp="yes">['’]</token>
             <token>t</token>
             <token>need</token>
             <marker>
             <token postag='VB'><exception regexp='yes'>proof|fake</exception></token>
           </marker>
           </pattern>
            <message>Did you mean <suggestion>to <match no = "5"/></suggestion>?</message>
            <example correction=''>They don't need <marker>change</marker> them.</example>
            <example>They don't need to change them.</example>
            </rule>

      </rulegroup>
<rule id="SHOULD_BE_DO" name="should be do(done)">    
            <pattern>
            <token>should</token>
             <token>be</token>
             <marker>
              <token postag='VB|NN:UN' postag_regexp='yes'><exception postag='JJ'></exception><exception>president</exception></token>
             </marker>
             </pattern>
             <message>Did you mean  <suggestion><match no = "3" postag ="VBN"/>?</suggestion></message>
             <example correction=''>If you have after-school activities, the homework should be <marker>do</marker> first.</example>
             <example>If you have after-school activities, the homework should be done first.</example>
             </rule>

(Daniel Naber) #27

Thanks, I’ve added all rules except UPPERCASE_WORDS_AFTER_COMMA. I’m not sure about that rule yet, it’s correct, but maybe we should check uppercase everywhere, not just after a comma?