Class RemoteRuleMatch

java.lang.Object
org.languagetool.remote.RemoteRuleMatch

public class RemoteRuleMatch extends Object
A potential error as returned by the HTTP API of LanguageTool.
Since:
3.4
  • Field Details

    • ruleId

      private final String ruleId
    • ruleDescription

      private final String ruleDescription
    • msg

      private final String msg
    • context

      private final String context
    • contextOffset

      private final int contextOffset
    • offset

      private final int offset
    • errorLength

      private final int errorLength
    • subId

      private String subId
    • shortMsg

      private String shortMsg
    • replacements

      private List<String> replacements
    • url

      private String url
    • category

      private String category
    • categoryId

      private String categoryId
    • locQualityIssueType

      private String locQualityIssueType
  • Constructor Details

    • RemoteRuleMatch

      RemoteRuleMatch(String ruleId, String ruleDescription, String msg, String context, int contextOffset, int offset, int errorLength)
  • Method Details

    • getRuleId

      public String getRuleId()
      Unique (per language) identifier for the error.
    • getRuleDescription

      public String getRuleDescription()
      Description of the rule.
    • getRuleSubId

      public Optional<String> getRuleSubId()
      Optional sub id (rule groups have a sub id for each rule).
    • getMessage

      public String getMessage()
      A text describing the error to the user.
    • getShortMessage

      public Optional<String> getShortMessage()
      Optional short message describing the error.
    • getReplacements

      public Optional<List<String>> getReplacements()
      Potential corrections for the error. Note that corrections might be wrong and they are not necessarily ordered by quality.
    • getContext

      public String getContext()
      The error in its context. See getContextOffset() and getErrorLength() to get the exact position.
    • getContextOffset

      public int getContextOffset()
      The character position of the error start inside the result of getContext().
    • getErrorOffset

      public int getErrorOffset()
      The character position where the error starts.
    • getErrorLength

      public int getErrorLength()
      The length of the error in characters.
    • getUrl

      public Optional<String> getUrl()
      URL with a more detailed explanation of the error.
    • getCategory

      public Optional<String> getCategory()
      The error's category.
    • getCategoryId

      public Optional<String> getCategoryId()
      The id of the error's category.
    • getLocQualityIssueType

      public Optional<String> getLocQualityIssueType()
    • setRuleSubId

      void setRuleSubId(String subId)
    • setShortMsg

      void setShortMsg(String shortMsg)
    • setReplacements

      void setReplacements(List<String> replacements)
    • setUrl

      void setUrl(String url)
    • setCategory

      void setCategory(String category)
    • setCategoryId

      void setCategoryId(String categoryId)
    • setLocQualityIssueType

      void setLocQualityIssueType(String locQualityIssueType)
    • toString

      public String toString()
      Overrides:
      toString in class Object