Package org.languagetool.tools
Class RuleMatchesAsJsonSerializer
java.lang.Object
org.languagetool.tools.RuleMatchesAsJsonSerializer
Write rule matches and some meta information as JSON.
- Since:
- 3.4, public since 3.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionruleMatchesToJson(List<RuleMatch> matches, String text, int contextSize, DetectedLanguage detectedLang) ruleMatchesToJson(List<RuleMatch> matches, List<RuleMatch> hiddenMatches, String text, int contextSize, DetectedLanguage detectedLang, String incompleteResultsReason) ruleMatchesToJson(List<RuleMatch> matches, List<RuleMatch> hiddenMatches, AnnotatedText text, int contextSize, DetectedLanguage detectedLang, String incompleteResultsReason)
-
Constructor Details
-
RuleMatchesAsJsonSerializer
public RuleMatchesAsJsonSerializer() -
RuleMatchesAsJsonSerializer
public RuleMatchesAsJsonSerializer(int compactMode) - Since:
- 4.7
-
-
Method Details
-
ruleMatchesToJson
public String ruleMatchesToJson(List<RuleMatch> matches, String text, int contextSize, DetectedLanguage detectedLang) -
ruleMatchesToJson
public String ruleMatchesToJson(List<RuleMatch> matches, List<RuleMatch> hiddenMatches, String text, int contextSize, DetectedLanguage detectedLang, String incompleteResultsReason) - Parameters:
incompleteResultsReason- use a string that explains why results are incomplete (e.g. due to a timeout) - a 'warnings' section will be added to the JSON. Usenullif results are complete.- Since:
- 3.7
-
ruleMatchesToJson
public String ruleMatchesToJson(List<RuleMatch> matches, List<RuleMatch> hiddenMatches, AnnotatedText text, int contextSize, DetectedLanguage detectedLang, String incompleteResultsReason) - Parameters:
incompleteResultsReason- use a string that explains why results are incomplete (e.g. due to a timeout) - a 'warnings' section will be added to the JSON. Usenullif results are complete.- Since:
- 4.3
-