Kumara Bhikkhu wrote thus at 04:28 PM 30-05-14:
I meant how do I indicate in the XML to suggest the singular form of a plural word, or vice versa?

Never mind. I've got it by looking at existing rules. Had to split to 2 rules though: one for "these" and one for "those".

        <rule id="ID" name="These + Singular Noun">
                <pattern>
                        <token>these</token>
<token postag='NN|NN:UN' postag_regexp='yes'><exception postag='IN|VBP' postag_regexp='yes'/><exception chunk="E-NP-singular"/></token>
                </pattern>
                <message>"\1" and "\2" do not match grammatically.</message>
                <suggestion>\1 <match no="2" postag="NNS"/></suggestion>
                <suggestion>this \2</suggestion>
                <short>Grammar</short>
<example type='incorrect'>I find <marker>these translation</marker> misleading.</example> <example type='correct'>I find these translations misleading.</example> <example type='correct'>I find this translation misleading.</example>
        </rule>
        <rule id="ID" name="Those + Singular Noun">
                <pattern>
                        <token>those</token>
<token postag='NN|NN:UN' postag_regexp='yes'><exception postag='IN|VBP' postag_regexp='yes'/><exception chunk="E-NP-singular"/></token>
                </pattern>
                <message>"\1" and "\2" do not match grammatically.</message>
                <suggestion>\1 <match no="2" postag="NNS"/></suggestion>
                <suggestion>that \2</suggestion>
                <short>Grammar</short>
<example type='incorrect'>I find <marker>those translation</marker> misleading.</example> <example type='correct'>I find those translations misleading.</example> <example type='correct'>I find that translation misleading.</example>
        </rule> 
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to