public abstract class AbstractSimpleReplaceRule extends Rule
rules/XX/replace.txt, where XX is a code of the language.| Constructor and Description |
|---|
AbstractSimpleReplaceRule(ResourceBundle messages) |
| Modifier and Type | Method and Description |
|---|---|
String |
getDescription()
A short description of the error this rule can detect, usually in the language of the text
that is checked.
|
String |
getEncoding()
Deprecated.
will be removed, it was always "utf-8" anyway (deprecated since 3.0)
|
String |
getId()
A string used to identify the rule in e.g. configuration files.
|
Locale |
getLocale() |
String |
getMessage(String tokenStr,
List<String> replacements) |
String |
getShort() |
protected abstract Map<String,List<String>> |
getWrongWords() |
boolean |
isCaseSensitive()
Indicates if the rule is case-sensitive.
|
boolean |
isCheckLemmas() |
protected boolean |
isTagged(AnalyzedTokenReadings tokenReadings)
This method allows to override which tags will mark token as tagged
|
protected static Map<String,List<String>> |
load(String path) |
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.
|
void |
setCheckLemmas(boolean checkLemmas)
Used to disable matching lemmas.
|
void |
setIgnoreTaggedWords()
Skip words that are known in the POS tagging dictionary, assuming they
cannot be incorrect.
|
addExamplePair, getCategory, getCorrectExamples, getIncorrectExamples, getLocQualityIssueType, getUrl, isDefaultOff, isDictionaryBasedSpellingRule, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setIncorrectExamples, setLocQualityIssueType, setUrl, supportsLanguage, toRuleMatchArray, useInOfficepublic AbstractSimpleReplaceRule(ResourceBundle messages) throws IOException
IOExceptionpublic String getEncoding()
public boolean isCaseSensitive()
true.public Locale getLocale()
isCaseSensitive()
is set to false.public void setIgnoreTaggedWords()
public String getId()
RuleA-Z
and the underscore.public String getDescription()
RulegetDescription in class Rulepublic String getShort()
public final RuleMatch[] match(AnalyzedSentence sentence)
Ruleprotected boolean isTagged(AnalyzedTokenReadings tokenReadings)
public boolean isCheckLemmas()
public void setCheckLemmas(boolean checkLemmas)