languagetool-org / languagetool

Style and Grammar Checker for 25+ Languages
https://languagetool.org
GNU Lesser General Public License v2.1
12.48k stars 1.4k forks source link

No suggestion for some plural nouns #294

Open xavierwoo opened 9 years ago

xavierwoo commented 9 years ago

"Three apple are enough. Three apples is enough. It said there is no problem found for the two sentence."

No problem is found....

danielnaber commented 9 years ago

Would you like to write a rule for that? You could start with http://community.languagetool.org/ruleEditor2/ or http://wiki.languagetool.org/development-overview#toc0. The part-of-speech tag for numbers is CD.

xavierwoo commented 9 years ago

I will try to write a rule. But I can't get access to the server from yesterday.

Is there something wrong with it?

2015-07-28 19:47 GMT+08:00 Daniel Naber notifications@github.com:

Would you like to write a rule for that? You could start with http://community.languagetool.org/ruleEditor2/ or http://wiki.languagetool.org/development-overview#toc0. The part-of-speech tag for numbers is CD.

— Reply to this email directly or view it on GitHub https://github.com/languagetool-org/languagetool/issues/294#issuecomment-125571560 .

danielnaber commented 9 years ago

The server is running again.

f-knorr commented 8 years ago

I have tried writing rules for the above cases. As it turned out, this is a non-trivial task: There are many cases in which a simple "subject-predicate" comparison is not enough:

Here is what I tried:

<rule id="CARDINAL_NUMBER_SINGULAR" name="cardinal number followed by singular noun (e.g., 'three apple')" type="grammar">
    <antipattern>
        <token postag="CD"/>
        <token regexp='yes'>plus|minus|per|foot|inch</token>
    </antipattern>
    <pattern>
            <token postag="CD"><exception regexp='yes'>one|1|[0-9]+</exception></token>
            <token postag="JJ[RS]?" postag_regexp='yes' min='0' max='1'/>
        <marker>
            <token postag="NN(:UN)?" postag_regexp="yes"><exception postag_regexp='yes' postag='JJ|CD|NNP?S'/></token>
        </marker>
    </pattern>
    <message>Did you mean <suggestion><match no="3" postag="NNS"/></suggestion>?</message>
    <example correction=''>He ate three <marker>apple</marker>.</example>
    <example correction=''>Look at these four beautiful <marker>painting</marker>.</example>
    <example correction=''>Ten <marker>year</marker> is a long time to wait.</example>
    <example correction=''>Eating more than two chocolate <marker>doughnut</marker> is not healthy.</example>
    <example>Five plus three is eight.</example>
    <example>Five factorial equals 120.</example>
    <example>It is six o'clock.</example>
    <example>It's six ten.</example>
    <example>It's five to four.</example>
    <example>A table five foot by three foot by two foot six high.</example>
    <example>He holds forty per cent of the stocks.</example>
    <example>Three hundred and twenty-nine</example>
    <example>Fifteen square meters of carpet.</example>
    <example>In fourteen hundred ninety-two Columbus sailed the ocean blue.</example>
</rule>

<rule id="PLURAL_SINGULAR_VERB" name="Agreement error: Noun (plural) followed by verb (3rd ps. sing. present)">
  <pattern>
    <marker>
    <token postag="NNP?S" postag_regexp="yes"><exception scope="previous" postag="CD"/><exception postag_regexp='yes' postag='NNP|NN:UN'/></token>
    <token postag="VBZ" postag_regexp="yes"><exception postag_regexp='yes' postag='NNS'/></token>
    </marker>
  </pattern>
  <message>Did you mean <suggestion><match no="1"/> <match no="2" postag="VBP"/></suggestion>?</message>
  <example correction=''>The <marker>apples is</marker> red.</example>
  <example correction=''>The <marker>women is</marker> demonstrating for their rights.</example>
  <example correction=''>The <marker>policemen sees</marker> the thief.</example>
  <example>Peter and Mary were walking down the street.</example>
  <example>Ten years is a long time to wait.</example>
  <example>Five dollars is much money.</example>
  <example>The number of skilled workers is increasing.</example>
  <example>Each of your children is safe.</example>
</rule>```
osg commented 8 years ago

"Five dollars is much money." should be "Five dollars is a lot of money."

f-knorr commented 8 years ago

@opensourcegrrrl Thank you! I have corrected the above example. (If I remember correctly, I have copied this sentence from my copy of the "Oxford Advanced Learner's Dictionary.")