languagetool-org/languagetool · error · RuntimeException
Not implemented
Error message
Not implemented
What it means
The inner rule object in GrammalecteRule only carries metadata (id, description) fetched from the remote Grammalecte server; actual matching is delegated to remote calls elsewhere. Its local match(AnalyzedSentence) method is intentionally unimplemented and always throws this RuntimeException if called directly.
Source
Thrown at languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/GrammalecteRule.java:712
GrammalecteInternalRule(String id, String desc) {
this.id = id;
this.desc = desc;
}
@Override
public String getId() {
return id;
}
@Override
public String getDescription() {
return desc;
}
@Override
public RuleMatch[] match(AnalyzedSentence sentence) {
throw new RuntimeException("Not implemented");
}
}
}
View on GitHub (pinned to 2e990059ce)
Solutions
- Do not call match() on this rule; rely on GrammalecteRule's remote fetching (ruleMatches) instead.
- If you need local execution, remove the Grammalecte rule from the local rule list or guard it behind remote-rule activation settings.
- In tests, stub the remote call rather than invoking the inner rule's match().
Defensive patterns
Strategy: type-guard
Validate before calling
if (rule instanceof GrammalecteRule.InnerRule) {
throw new UnsupportedOperationException("This rule only matches remotely; do not call match()");
} Type guard
boolean isRemoteOnly = rule.getClass().getName().contains("GrammalecteRule");
if (isRemoteOnly) { /* skip local match(); use remote path */ } Try / catch
try { return rule.match(sentence); } catch (RuntimeException e) { if (e.getMessage().equals("Not implemented")) return new RuleMatch[0]; throw e; } Prevention
- Never add the Grammalecte inner rule to a local rule list iterated via match().
- Use GrammalecteRule's remote fetching path for these matches.
- Guard tests and custom pipelines against remote-only rules.
When it happens
Trigger: Any code path invokes match(AnalyzedSentence) on the Grammalecte inner rule instance — e.g. registering the rule in a normal (local) rule set where the engine runs every rule's match() instead of the remote-detection code path.
Common situations: Developers adding the Grammalecte rule to a JLanguageTool instance directly; tests invoking match(); custom pipelines that iterate all rules locally, unaware this rule is remote-only.
Related errors
- No 'data' found in grammalecte JSON: " + map
- Format error in file ${path}, line: ${line}
- No IssueType found for name '" + name + "'. Valid values: "
- The number of forms and postags has to be the same in disamb
- Set 'no', 'regexp' and 'postag_regexp' for filter PartialPos
AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06).
Data as JSON: /api/errors/5266b954c41101f9.
Report an issue: GitHub.