Package org.languagetool.rules
Class RemoteRuleFilters
java.lang.Object
org.languagetool.rules.RemoteRuleFilters
rules in remote-rule-filter.xml, same syntax as pattern rules
used as filters for results from matches provided by remote rule
i.e. if there is a match with equal match span from remote rule and a corresponding filter (i.e. with the same ID as the match)
the match is discarded
filtering uses the IDs from the matches, so dynamically created rules using different IDs will work
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class(package private) static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static List<Map.Entry<Pattern, List<AbstractPatternRule>>> compilePatterns(Map<String, List<AbstractPatternRule>> rules) filterMatches(Language lang, AnalyzedSentence sentence, List<RuleMatch> matches) (package private) static StringgetFilename(Language lang) (package private) static Map<String, List<AbstractPatternRule>> static voidPrint matches remaining after filtering; arguments are language code and JSON file with matches e.g.
-
Field Details
-
RULE_FILE
- See Also:
-
rules
-
-
Constructor Details
-
RemoteRuleFilters
private RemoteRuleFilters()
-
-
Method Details
-
filterMatches
public static List<RuleMatch> filterMatches(@NotNull Language lang, @NotNull AnalyzedSentence sentence, @NotNull List<RuleMatch> matches) throws ExecutionException, IOException - Throws:
ExecutionExceptionIOException
-
main
Print matches remaining after filtering; arguments are language code and JSON file with matches e.g. java [...] org.languagetool.rules.RemoteRuleFilters en matches.json- Throws:
Exception
-
load
-
compilePatterns
static List<Map.Entry<Pattern,List<AbstractPatternRule>>> compilePatterns(Map<String, List<AbstractPatternRule>> rules) -
getFilename
-