Package | Description |
---|---|
org.languagetool | |
org.languagetool.rules |
Modifier and Type | Method and Description |
---|---|
protected void |
JLanguageTool.fetchRemoteRuleResults(long deadlineStartNanos,
JLanguageTool.Mode mode,
JLanguageTool.Level level,
List<AnalyzedSentence> analyzedSentences,
List<RuleMatch> remoteMatches,
List<FutureTask<RemoteRuleResult>> remoteRuleTasks,
List<RemoteRule> remoteRules,
List<Integer> requestSize,
Map<Integer,List<RuleMatch>> cachedResults,
Map<Integer,Integer> matchOffset,
AnnotatedText annotatedText,
Long textSessionID,
Set<ToneTag> toneTags) |
Modifier and Type | Class and Description |
---|---|
class |
BERTSuggestionRanking
reorder suggestions from another rule using BERT as a LM
|
class |
GRPCRule
Base class fur rules running on external servers;
see gRPC service definition in languagetool-core/src/main/proto/ml_server.proto
See #create(Language, ResourceBundle, RemoteRuleConfig, boolean, String, String, Map) for an easy way to add rules; return rule in Language::getRelevantRemoteRules
add it like this:
public List<Rule> getRelevantRemoteRules(ResourceBundle messageBundle, List<RemoteRuleConfig> configs, GlobalConfig globalConfig, UserConfig userConfig, Language motherTongue, List<Language> altLanguages) throws IOException {
List<Rule> rules = new ArrayList<>(super.getRelevantRemoteRules(
messageBundle, configs, globalConfig, userConfig, motherTongue, altLanguages));
Rule exampleRule = GRPCRule.create(messageBundle,
RemoteRuleConfig.getRelevantConfig("EXAMPLE_ID", configs),
"EXAMPLE_ID", "example_rule_id",
Collections.singletonMap("example_match_id", "example_rule_message"));
rules.add(exampleRule);
return rules;
}
|
class |
TestRemoteRule |