Package org.languagetool.rules.patterns
Class RuleSet
java.lang.Object
org.languagetool.rules.patterns.RuleSet
An object holding a set of rules with an optional possibility to fetch only the ones applicable for a given sentence
(via
rulesForSentence(org.languagetool.AnalyzedSentence)), to avoid even invoking the definitely inapplicable ones.
The filtering is based on cues provided by the rules, e.g. possible token strings or lemmas in pattern rules.- Since:
- 5.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallRules()static <T> List<T> filterList(BitSet includedIndices, List<T> list) private static RuleSetstatic RuleSetrulesForSentence(AnalyzedSentence sentence) static RuleSettextHinted(List<? extends Rule> rules) static RuleSettextLemmaHinted(List<? extends Rule> rules)
-
Field Details
-
ruleIds
-
-
Constructor Details
-
RuleSet
public RuleSet()
-
-
Method Details
-
allRules
- Returns:
- all rules in this set, not filtered
-
rulesForSentence
- Returns:
- all rules from
allRules()that might be applicable to the given sentence.
-
allRuleIds
- Returns:
- the ids of
allRules() - Since:
- 5.6
-
plain
- Returns:
- a simple RuleSet that returns all the rules from
rulesForSentence(org.languagetool.AnalyzedSentence)
-
textLemmaHinted
- Returns:
- a RuleSet whose
rulesForSentence(org.languagetool.AnalyzedSentence)excludes rules requiring token texts or lemmas that don't occur in the given sentence
-
textHinted
- Returns:
- a RuleSet whose
rulesForSentence(org.languagetool.AnalyzedSentence)excludes rules requiring token texts that don't occur in the given sentence.
-
hinted
-
filterList
-