I have a rule that finds a word in context (Tips and Tricks - LanguageTool Wiki). When I add an antipattern (Development Overview - LanguageTool Wiki), the rule does not give the result that I expect. Testrules gives an error message if I remove the comments from the last 2 examples.
<rule id="WORD_IN_CONTEXT_WITH_ANTIPATTERN" name="Test: word in context with antipattern">
<antipattern>
<token>car</token>
<token>boot</token>
</antipattern>
<pattern>
<token postag="SENT_START" skip="-1"><exception scope="next">elephant</exception></token>
<marker>
<token skip="-1">trunk<exception scope="next">elephant</exception></token>
</marker>
<token postag="SENT_END"><exception scope="current">elephant</exception></token>
</pattern>
<message>For AmE, use 'trunk' not 'boot'. Context: http://wiki.languagetool.org/tips-and-tricks#toc24, antipattern: http://wiki.languagetool.org/development-overview#toc13</message>
<short>Antipattern test</short>
<example type="incorrect" correction="">The automobile has a small <marker>trunk</marker>.</example>
<example type="incorrect" correction="">A <marker>trunk</marker> is a type of container.</example>
<example type="correct">The elephant has a long <marker>trunk</marker>.</example>
<example type="correct">The <marker>trunk</marker> of the elephant is large.</example>
<!-- <example type="correct">The car boot contains a <marker>trunk</marker>.</example>-->
<!-- example type="correct">Put the <marker>trunk</marker> in the car boot.</example>-->
</rule>
Should I be able to use an antipattern with the word-in-context method?