Back to LanguageTool Homepage - Privacy - Imprint

Add rule


(Mility) #1

<rule id="ID" name="the lost">    
           <pattern>
                <token>play</token>
                <token regexp="yes">piano|guitar|violin</token>
            </pattern>
            <message>Did you miss <suggestion>the</suggestion>?</message>
            <short>Possible typo</short>
            <example type='incorrect' correction="play the piano">I like <marker>play piano</marker>.</example>
            <example type="correct">I like play the piano.</example>
       </rule>

(yeryry) #2

This is a good idea for a rule, but I feel it needs more work. I think this usage is normal in some dialects, or maybe even certain contexts, so the message should say this. There are also many other musical instruments that could be used...
Also, the example sentences should be correct other than the error that is being identified, so incorrect example could be "I like to play piano." and the corrected one "I like to play the piano".
There's also "I like playing piano" -> "I like playing the piano", which isn't covered by the rule as it is.


(Mility) #3

Thanks, you are right.


(Mility) #4
<rule id="lost the" name="LOST_THE">

 <pattern>
  <token regexp="yes">play|playing</token>
 <marker>
   <token regexp="yes">piano|guitar|violin</token>
   </marker>
 </pattern>
  <message>Did you miss <suggestion>the</suggestion>before <match no="2"/>? (However, This usage is normal in some dialects.)</message>
  <short>Possible typo</short>
  <!-- List_of_musical_instruments are so much, you can add it from below wedsite -->
  <url>http://en.wikipedia.org/wiki/List_of_musical_instruments</url>
  <example type='incorrect' correction="play the piano">I like to<marker>play piano</marker>.</example>
  <example type="correct">I like to play the piano.</example>
  <example type='incorrect' correction="playing the piano">I like <marker>playing piano</marker>.</example>
  <example type="correct">I like playing the piano.</example>
</rule>

(Daniel Naber) #5

People here argue that both variations are fine: http://english.stackexchange.com/questions/6635/omission-of-definite-article-with-musical-instruments


(Mility) #6

Thanks.
We are used to plus the in front of the instrument in our daily life. So I remind it.


(Mility) #7

I want to check the grammar error of this sentence( Paste you own text here.),
and created a new rule below, but it's does'nt work. What's wrong with him?

<rule id="ID" name="PRP+NN:UN">

 <pattern>
 <marker>
  <token postag='PRP'></token>
  </marker>
  <token postag='JJ' min='0' max='2'></token>
  <token postag='NN:UN'></token>
 </pattern>
 <message>Did you mean <suggestion><match no="1" postag_regexp="yes" postag="PRP$" ></match></suggestion>?</message>
 <short>Grammatical problem</short>
 <example correction=''>Paste <marker>you</marker> own text here.</example>
 <example>Paste your own text here</example>
</rule>

(Daniel Naber) #8

What do you mean by "doesn't work"? It works for me when I try it in the online editor (http://community.languagetool.org/ruleEditor/expert).


(Mility) #9

Feedback:
Potential error at line 0, column 7: Did you mean you?
Suggested correction: [you]

The feedback doesn't meet the expected(you->your).


(Daniel Naber) #10

In the match element, please try without postag_regexp="yes" (as the $ in PRP is a special character in regular expressions).


(Mility) #11

Potential error at line 0, column 7: Did you mean ?
Suggested correction: []

The feedback doesn't meet the expected as well.


(Daniel Naber) #12

For some reason, our dictionary doesn't contain the information that the PRP$ form of "you" is "your". You'd have to work around that, maybe by using the form and adding an "r", if that works for all cases.


(Mility) #13

Add rule:

<rule id="ID" name="in present(at present)">

 <pattern>
  <token>in</token>
  <token>present</token>
 </pattern>
 <message>Did you mean <suggestion>at <match no="2"/> </suggestion> (=at the moment, now)?</message>
 <example correction=''>I don't need the dictionary <marker>in present</marker>.</example>
 <example>I don't need the dictionary at present.</example>
</rule>

(Daniel Naber) #14

If you search the web, there are quite some cases where "in present" is okay.


(Mility) #15

Ohh, Thanks.
add a rule.

<rule id="DOSE" name="dose(does)">

 <pattern>
  <token>He</token>
  <marker>
  <token>dose</token>
  </marker>
  <token>not</token>
 </pattern>
 <message>Did you mean <suggestion>does</suggestion>?</message>
 <short>Possible typo</short>
 <example correction=''>He <marker>dose</marker> not eat alone.</example>
 <example>He does not eat alone.</example>
</rule>

(Daniel Naber) #16

Thanks, LT can actually already detect that, at least for your example sentence. The online rule editor will note you about that and display "Note: LanguageTool can already detect the following error(s) in your first wrong example sentence: ..."


(Mility) #17

It's display doesn't meet the expected(dose->does). But (dose->doses).

Note: LanguageTool can already detect the following error(s) in your first wrong example sentence:

The pronoun 'He' must be used with a third-person verb: <i>doses</i>.

(Daniel Naber) #18

That's right, but adding another rule doesn't help that much, because it will match the same place in the text as the existing rule and then it's up to the user interface which of the two errors to display, so the new rule might not become visible.


(Mility) #19

Thanks, sometimes
Subject and verb are separated, i.e. the verb does not occur directly after the subject: *The characters
in Shakespeare’s Twelfth Night lives in a world that has been turned upside-down.
How to create s new LT rule for this?


(Daniel Naber) #20

This is documented at http://wiki.languagetool.org/using-chunks