Package org.languagetool.server
Class RemoteRuleMatch
- java.lang.Object
-
- org.languagetool.server.RemoteRuleMatch
-
@Experimental class RemoteRuleMatch extends java.lang.ObjectA potential error as returned by the HTTP API of LanguageTool.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcategoryprivate java.lang.StringcategoryIdprivate java.lang.Stringcontextprivate intcontextOffsetprivate interrorLengthprivate intestimatedContextForSureMatchprivate java.lang.StringlocQualityIssueTypeprivate java.lang.Stringmsgprivate intoffsetprivate java.util.List<java.lang.String>replacementsprivate java.lang.StringruleIdprivate java.lang.StringshortMsgprivate java.lang.StringsubIdprivate java.lang.Stringurl
-
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) intestimatedContextForSureMatch()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.StringgetContext()The error in its context.intgetContextOffset()The character position of the error start inside the result ofgetContext().intgetErrorLength()The length of the error in characters.intgetErrorOffset()The character position where the error starts.java.util.Optional<java.lang.String>getLocQualityIssueType()java.lang.StringgetMessage()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.StringgetRuleId()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) booleanisTouchedByOneOf(java.util.List<org.languagetool.rules.RuleMatch> matches)(package private) voidsetCategory(java.lang.String category)(package private) voidsetCategoryId(java.lang.String categoryId)(package private) voidsetLocQualityIssueType(java.lang.String locQualityIssueType)(package private) voidsetReplacements(java.util.List<java.lang.String> replacements)(package private) voidsetRuleSubId(java.lang.String subId)(package private) voidsetShortMsg(java.lang.String shortMsg)(package private) voidsetUrl(java.lang.String url)java.lang.StringtoString()
-
-
-
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.
-
getContext
public java.lang.String getContext()
The error in its context. SeegetContextOffset()andgetErrorLength()to get the exact position.
-
getContextOffset
public int getContextOffset()
The character position of the error start inside the result ofgetContext().
-
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:
toStringin classjava.lang.Object
-
-