Class RemoteRuleMatch


  • @Experimental
    class RemoteRuleMatch
    extends java.lang.Object
    A potential error as returned by the HTTP API of LanguageTool.
    Since:
    4.0
    • Constructor Summary

      Constructors 
      Constructor Description
      RemoteRuleMatch​(java.lang.String ruleId, java.lang.String msg, java.lang.String context, int contextOffset, int offset, int errorLength)  
      RemoteRuleMatch​(java.lang.String ruleId, java.lang.String msg, java.lang.String context, int contextOffset, int offset, int errorLength, int estimatedContextForSureMatch)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) int estimatedContextForSureMatch()  
      java.util.Optional<java.lang.String> getCategory()
      The error's category.
      java.util.Optional<java.lang.String> getCategoryId()
      The id of the error's category.
      java.lang.String getContext()
      The error in its context.
      int getContextOffset()
      The character position of the error start inside the result of getContext().
      int getErrorLength()
      The length of the error in characters.
      int getErrorOffset()
      The character position where the error starts.
      java.util.Optional<java.lang.String> getLocQualityIssueType()  
      java.lang.String getMessage()
      A text describing the error to the user.
      java.util.Optional<java.util.List<java.lang.String>> getReplacements()
      Potential corrections for the error.
      java.lang.String getRuleId()
      Unique (per language) identifier for the error.
      java.util.Optional<java.lang.String> getRuleSubId()
      Optional sub id (rule groups have a sub id for each rule).
      java.util.Optional<java.lang.String> getShortMessage()
      Optional short message describing the error.
      java.util.Optional<java.lang.String> getUrl()
      URL with a more detailed explanation of the error.
      (package private) boolean isTouchedByOneOf​(java.util.List<org.languagetool.rules.RuleMatch> matches)  
      (package private) void setCategory​(java.lang.String category)  
      (package private) void setCategoryId​(java.lang.String categoryId)  
      (package private) void setLocQualityIssueType​(java.lang.String locQualityIssueType)  
      (package private) void setReplacements​(java.util.List<java.lang.String> replacements)  
      (package private) void setRuleSubId​(java.lang.String subId)  
      (package private) void setShortMsg​(java.lang.String shortMsg)  
      (package private) void setUrl​(java.lang.String url)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • ruleId

        private final java.lang.String ruleId
      • msg

        private final java.lang.String msg
      • context

        private final java.lang.String context
      • contextOffset

        private final int contextOffset
      • offset

        private final int offset
      • errorLength

        private final int errorLength
      • estimatedContextForSureMatch

        private final int estimatedContextForSureMatch
      • subId

        private java.lang.String subId
      • shortMsg

        private java.lang.String shortMsg
      • replacements

        private java.util.List<java.lang.String> replacements
      • url

        private java.lang.String url
      • category

        private java.lang.String category
      • categoryId

        private java.lang.String categoryId
      • locQualityIssueType

        private java.lang.String locQualityIssueType
    • Constructor Detail

      • RemoteRuleMatch

        RemoteRuleMatch​(java.lang.String ruleId,
                        java.lang.String msg,
                        java.lang.String context,
                        int contextOffset,
                        int offset,
                        int errorLength)
      • RemoteRuleMatch

        RemoteRuleMatch​(java.lang.String ruleId,
                        java.lang.String msg,
                        java.lang.String context,
                        int contextOffset,
                        int offset,
                        int errorLength,
                        int estimatedContextForSureMatch)
    • Method Detail

      • isTouchedByOneOf

        boolean isTouchedByOneOf​(java.util.List<org.languagetool.rules.RuleMatch> matches)
      • getRuleId

        public java.lang.String getRuleId()
        Unique (per language) identifier for the error.
      • getRuleSubId

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

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

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

        public java.util.Optional<java.util.List<java.lang.String>> getReplacements()
        Potential corrections for the error. Note that corrections might be wrong and they are not necessarily ordered by quality.
      • 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 java.util.Optional<java.lang.String> getUrl()
        URL with a more detailed explanation of the error.
      • getCategory

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

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

        public java.util.Optional<java.lang.String> getLocQualityIssueType()
      • setRuleSubId

        void setRuleSubId​(java.lang.String subId)
      • setShortMsg

        void setShortMsg​(java.lang.String shortMsg)
      • setReplacements

        void setReplacements​(java.util.List<java.lang.String> replacements)
      • setUrl

        void setUrl​(java.lang.String url)
      • setCategory

        void setCategory​(java.lang.String category)
      • setCategoryId

        void setCategoryId​(java.lang.String categoryId)
      • setLocQualityIssueType

        void setLocQualityIssueType​(java.lang.String locQualityIssueType)
      • estimatedContextForSureMatch

        @Experimental
        int estimatedContextForSureMatch()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object