Back to LanguageTool Homepage - Privacy - Imprint

Making ignoring rules more specific

There’s a new method AbstractSimpleReplaceRule2.useSubRuleSpecificIds() which you can call in your constructor if you extend AbstractSimpleReplaceRule2. If this is called, the matches will have more specific ids, not just something like EN_HOMOPHONES_REPLACE anymore, but more like EN_HOMOPHONES_REPLACE_WORD1_WORD2. The effect is that any user turning off the rule will then only turn off that specific pair, not the whole rule with all its pairs.

When does this make sense? I think it should be used when the pairs in your replace.txt are independant and cover many different issues. If they all cover the same issue, like “British vs. American English”, it probably makes sense to have the whole rule on or off, but I’m open to feedback.