Hi,

the Rule class now has a method getAntiPatterns() that sub classes can 
overwrite to ignore certain phrases, in order to avoid false alarms. To 
make use of that, your rule needs to call getSentenceWithImmunization() 
in its match() method and also test the token readings for isImmunized() 
before creating a RuleMatch.

A complete example can be seen in org.languagetool.rules.de.CaseRule: 
https://github.com/languagetool-org/languagetool/blob/master/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/CaseRule.java#L61

Of course Java rules can always use their own logic to avoid false 
alarms, but I think there are many cases where using a more common 
approach is better.

Regards
  Daniel


------------------------------------------------------------------------------
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to