W dniu 2014-04-07 19:23, Mike Unwalla pisze: > Hello All, > > When I run testrules against this rule in LT 2.5, testrules does not give an > error message: > > <rule id="antipattern" name="antipattern"> > <antipattern> > <token skip="-1">happy</token> > <token>cat</token> > </antipattern> > <pattern> > <token>cat</token> > </pattern> > <message>The word 'happy' does not come anywhere before the word > 'cat'.</message> > <short>antipattern</short> > <example type="correct">The <marker>happy cat</marker> sat on the > mat.</example> > <!-- <example type="correct">The <marker>happy and fat cat</marker> sat > on the mat.</example>--> > <example type="incorrect">The lazy <marker>cat</marker> sat on the > mat.</example> > <example type="incorrect">The <marker>cat</marker> is happy.</example> > </rule> > > But, when I remove the comments from the second 'correct' example, testrules > gives an error message: > ... Did not expect error in: The happy and fat cat sat on the mat. (Rule: > antipattern[1]:[cat]:antipattern) > > http://wiki.languagetool.org/development-overview#toc12 states "You can use > all subelements of 'pattern' in 'antipattern' but 'phrase' and 'or'." > > 1. Is the antipattern correct [LT has a bug] or is the documentation > incorrect? > 2. If <token skip="-1"> is not correct, shouldn't testrules give an error?
Well, <antipattern> is simply a disambiguation immunizing rule, and disambiguation rules by default take effect only on the first token if no markers are given. Use explicit markers, and you'll get what you want: <antipattern> <marker> <token skip="-1">happy</token> <token>cat</token> </marker> </antipattern> Maybe we should change the default behavior (implying only a marker around "happy") as it may be quite confusing. I simply solved the problem by always using markers. Regards, Marcin ------------------------------------------------------------------------------ Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees _______________________________________________ Languagetool-devel mailing list Languagetool-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/languagetool-devel