public class PatternRule extends AbstractPatternRule
| Constructor and Description |
|---|
PatternRule(String id,
Language language,
List<Element> elements,
String description,
String message,
String shortMessage) |
PatternRule(String id,
Language language,
List<Element> elements,
String description,
String message,
String shortMessage,
boolean isMember) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSuggestionMatch(Match m) |
List<Element> |
getElements()
For testing only.
|
String |
getMessage() |
String |
getSubId() |
boolean |
isWithComplexPhrase()
Used for testing rules: only one of the set can match.
|
RuleMatch[] |
match(AnalyzedSentence text)
Check whether the given text matches this error rule, i.e. whether the text
contains this error.
|
void |
notComplexPhrase()
Reset complex status - used for testing.
|
void |
setMessage(String message) |
void |
setSubId(String subId) |
String |
toPatternString()
Return the pattern as a string.
|
String |
toXML()
Return the pattern as an XML string.
|
getDescription, getId, reset, setEndPositionCorrection, setStartPositionCorrection, toStringaddRuleMatch, clearMatches, getCategory, getCorrectExamples, getIncorrectExamples, getMatches, getMatchesIndex, isDefaultOff, isInMatches, isInRemoved, isParagraphBackTrack, setAsDeleted, setCategory, setCorrectExamples, setDefaultOff, setIncorrectExamples, setParagraphBackTrack, supportsLanguagepublic PatternRule(String id,
Language language,
List<Element> elements,
String description,
String message,
String shortMessage)
id - Id of the Rule. Used in configuration. Should not contain special characters and should
be stable over time, unless the rule changes completely.language - Language of the Ruleelements - Element (token) listdescription - Description to be shown (name)message - Message to be displayed to the usershortMessage - Message to be displayed to the user in the context menu in OpenOffice.org/LibreOfficepublic final String getSubId()
public final void setSubId(String subId)
public final String getMessage()
public final boolean isWithComplexPhrase()
public final void notComplexPhrase()
public final String toPatternString()
public final String toXML()
public final void setMessage(String message)
public final RuleMatch[] match(AnalyzedSentence text) throws IOException
Rulematch in class AbstractPatternRuletext - a pre-analyzed sentenceIOExceptionpublic final void addSuggestionMatch(Match m)
public final List<Element> getElements()
Copyright © 2005-2011 Daniel Naber