ool.languagetool-core.5.6.source-code.ml_server.proto Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of languagetool-core Show documentation
Show all versions of languagetool-core Show documentation
LanguageTool is an Open Source proofreading software for English, French, German, Polish, Romanian, and more than 20 other languages. It finds many errors that a simple spell checker cannot detect like mixing up there/their and it detects some grammar problems.
syntax = "proto3";
package lt_ml_server;
option java_package = "org.languagetool.rules.ml";
option java_outer_classname = "MLServerProto";
service MLServer {
rpc Match (MatchRequest) returns (MatchResponse) {}
}
message MatchRequest {
repeated string sentences = 1; // input text to be analyzed
bool inputLogging = 2; // allow logging of input on error
repeated int64 textSessionID = 3; // session ID, for partial rollout & A/B tests
}
message MatchResponse {
repeated MatchList sentenceMatches = 1; // results for each corresponding sentence in MatchRequest (aligned)
}
message MatchList {
repeated Match matches = 1; // list of matches
}
message Match {
uint32 offset = 1; // start position in the sentence (i.e. not relative to whole text)
uint32 length = 2; // length of matched area; >0
string id = 3; // prefix for rule ids; should use a common value for one model/server
string sub_id = 4; // more specific suffix for rule ids; i.e. one model/server can return multiple values to distinguish between mach types
repeated string suggestions = 5; // legacy; use suggestedReplacements
// added later, optional (can be substituted by Java)
string ruleDescription = 6; // description of the rule; can be specific to rule_id + sub_id or shared for all sub_ids of one rule_id
string matchDescription = 7; // description of the match; displayed in e.g. the add-on pop-up
string matchShortDescription = 8; // shortened description of the match; displayed in e.g. LibreOffice context menu
string url = 9; // to show a link, e.g. with further explanations for this error
repeated SuggestedReplacement suggestedReplacements = 10; // new and extended suggestions; overwrite any values set in suggestions
bool autoCorrect = 11; // is this correction eligible for auto-correction?
}
message SuggestedReplacement {
string replacement = 1;
string description = 2;
string suffix = 3; // Value shown in the UI after the replacement (but not part of it).
float confidence = 4; // from 0 (lowest) to 1 (highest)
}