Class RuleMatchesAsJsonSerializer

java.lang.Object
org.languagetool.tools.RuleMatchesAsJsonSerializer

public class RuleMatchesAsJsonSerializer extends Object
Write rule matches and some meta information as JSON.
Since:
3.4, public since 3.6
  • 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. Use null if 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. Use null if results are complete.
      Since:
      4.3