Skip to content

Commit

Permalink
support custom rules as custom filter (#10626)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteVio89 authored May 30, 2024
1 parent dcfe50e commit 024229c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.class
.classpath
.idea
.run
.ignore
.project
.settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ Pipeline createPipeline(Language lang, Language motherTongue, TextChecker.QueryP
.build();
return TelemetryProvider.INSTANCE.createSpan("createPipeline", attributes, () -> {
Pipeline lt = new Pipeline(lang, params.altLanguages, motherTongue, cache, globalConfig, userConfig, params.inputLogging);
//Add custom rules as filter if there are implement the RuleMatchFilter interface
//TODO: Will not work anymore if we handle custom rules as remote rules
for (Rule rule : userConfig.getRules()) {
if (rule instanceof RuleMatchFilter) {
lt.addMatchFilter((RuleMatchFilter) rule);
}
}
lt.setMaxErrorsPerWordRate(config.getMaxErrorsPerWordRate());
lt.disableRules(disabledRuleIds);
if (config.getLanguageModelDir() != null) {
Expand Down

0 comments on commit 024229c

Please sign in to comment.