public class WordRepeatRule extends Rule
| Constructor and Description |
|---|
WordRepeatRule(ResourceBundle messages,
Language language) |
| Modifier and Type | Method and Description |
|---|---|
protected RuleMatch |
createRuleMatch(String prevToken,
String token,
int prevPos,
int pos,
String msg) |
String |
getDescription()
A short description of the error this rule can detect, usually in the language of the text
that is checked.
|
String |
getId()
A string used to identify the rule in e.g. configuration files.
|
boolean |
ignore(AnalyzedTokenReadings[] tokens,
int position)
Implement this method to return
true if there's
a potential word repetition at the current position should be ignored,
i.e. if no error should be created. |
RuleMatch[] |
match(AnalyzedSentence sentence)
Check whether the given sentence matches this error rule, i.e. whether it
contains the error detected by this rule.
|
void |
reset()
If a rule keeps its state over more than the check of one sentence, this
must be implemented so the internal state is reset.
|
addExamplePair, getCategory, getCorrectExamples, getIncorrectExamples, getLocQualityIssueType, getUrl, isDefaultOff, isDictionaryBasedSpellingRule, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setIncorrectExamples, setLocQualityIssueType, setUrl, supportsLanguage, toRuleMatchArray, useInOfficepublic WordRepeatRule(ResourceBundle messages, Language language)
public boolean ignore(AnalyzedTokenReadings[] tokens, int position)
true if there's
a potential word repetition at the current position should be ignored,
i.e. if no error should be created.tokens - the tokens of the sentence currently being checkedposition - the current position in the tokenspublic String getId()
RuleA-Z
and the underscore.public String getDescription()
RulegetDescription in class Rulepublic RuleMatch[] match(AnalyzedSentence sentence)
Ruleprotected RuleMatch createRuleMatch(String prevToken, String token, int prevPos, int pos, String msg)