Package org.languagetool.rules
Class SameRuleGroupFilter
- java.lang.Object
-
- org.languagetool.rules.SameRuleGroupFilter
-
- All Implemented Interfaces:
RuleMatchFilter
public class SameRuleGroupFilter extends java.lang.Object implements RuleMatchFilter
Filter rule matches so that only the first match is kept from overlapping matches with the same rule group (actually: the same id).- Since:
- 1.8
-
-
Constructor Summary
Constructors Constructor Description SameRuleGroupFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<RuleMatch>
filter(java.util.List<RuleMatch> ruleMatches)
private boolean
haveSameRuleGroup(RuleMatch match, RuleMatch nextMatch)
private boolean
overlapAndMatch(RuleMatch match, RuleMatch nextMatch)
(package private) boolean
overlaps(RuleMatch match, RuleMatch nextMatch)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.languagetool.rules.RuleMatchFilter
filter
-
-
-
-
Method Detail
-
filter
public java.util.List<RuleMatch> filter(java.util.List<RuleMatch> ruleMatches)
- Specified by:
filter
in interfaceRuleMatchFilter
- Parameters:
ruleMatches
- list of matches
-
-