For the Oxford spelling rules for verbs, I want to prevent a rule from giving a message for verbs such as advertise, advise, appraise, and chastise. I can do that by putting the verbs into an exception on the token. To make the rule as accurate as possible, I also would like to use ‘suppress_misspelled’, because I probably do not have a full list of verbs that cannot be spelled with ize. But, I cannot do what I want.
“You can even suppress the whole rule from being matched if you use the same attribute for any suggestion element” (http://wiki.languagetool.org/development-overview#toc6). I think this sentence means that I must put ‘suppress_misspelled’ into both the suggestion and the match, as is done in some of the rules in English grammar.xml.
The rule that follows correctly ignores ‘advise’ but gives a message for ‘televise’. Any ideas why?
<rule id="TEST_SUPPRESS_MISSPELLED1" name="Test: suppress_mispelled"> <pattern> <token regexp="yes">([a-z]+?)ise</token> </pattern> <filter class="org.languagetool.rules.en.EnglishPartialPosTagFilter" args="no:1 regexp:(?i)([a-z]+?ise) postag_regexp:VBP?"/> <message>TEST1. The word '\1' is not the Oxford spelling. Use '<suggestion suppress_misspelled="yes"><match suppress_misspelled="yes" no="1" regexp_match="([a-z]+?)ise" regexp_replace="$1ize"/></suggestion>'.</message> <example correction="organize">The verb '<marker>organise</marker>' is not the Oxford spelling.</example> <example>The word '<marker>organize</marker>' is the Oxford spelling.</example> <example>We <marker>advise</marker> you to be careful.</example> <example correction="televize">They will <marker>televise</marker> the football match.</example> </rule>