mirror of
https://github.com/languagetool-org/languagetool
synced 2026-04-21 13:37:25 +00:00
support custom rules as custom filter (#10626)
This commit is contained in:
parent
dcfe50e488
commit
024229c4a4
2 changed files with 8 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -6,6 +6,7 @@
|
|||
.class
|
||||
.classpath
|
||||
.idea
|
||||
.run
|
||||
.ignore
|
||||
.project
|
||||
.settings
|
||||
|
|
|
|||
|
|
@ -124,6 +124,13 @@ class PipelinePool implements KeyedPooledObjectFactory<PipelineSettings, Pipelin
|
|||
.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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue