public abstract class AbstractSimpleReplaceRule2 extends Rule
Unlike AbstractSimpleReplaceRule, it supports phrases (Ex: "aqua forte" -> "acvaforte").
Note: Merge this into AbstractSimpleReplaceRule
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractSimpleReplaceRule2.CaseSensitivy |
| Modifier and Type | Field and Description |
|---|---|
protected Language |
language |
protected boolean |
subRuleSpecificIds |
| Constructor and Description |
|---|
AbstractSimpleReplaceRule2(ResourceBundle messages,
Language language) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkKeyWordsAreKnownToSpeller()
Create a warning if a key word of the replacement rule is not allowed by the speller rule.
|
boolean |
checkKeyWordsAreUnknownToSpeller()
Create a warning if a key word of the replacement rule is allowed by the speller rule.
|
AbstractSimpleReplaceRule2.CaseSensitivy |
getCaseSensitivy() |
abstract String |
getDescription()
A short description of the error this rule can detect, usually in the language of the text
that is checked.
|
String |
getDescription(String details)
Used if each input form the replacement file has its specific id.
|
abstract List<String> |
getFileNames() |
List<URL> |
getFilePaths() |
abstract String |
getId()
A string used to identify the rule in e.g. configuration files.
|
abstract Locale |
getLocale()
locale used on case-conversion
|
abstract String |
getMessage() |
abstract String |
getShort() |
String |
getSuggestionsSeparator() |
List<Map<String,SuggestionWithMessage>> |
getWrongWords() |
protected boolean |
isCheckingCase() |
protected boolean |
isException(String matchedText) |
protected boolean |
isIgnoreShortUppercaseWords() |
protected boolean |
isPunctuationStart(String word) |
protected boolean |
isRuleMatchException(RuleMatch ruleMatch) |
protected boolean |
isTokenException(AnalyzedTokenReadings atr) |
RuleMatch[] |
match(AnalyzedSentence sentence)
Check whether the given sentence matches this error rule, i.e. whether it
contains the error detected by this rule.
|
boolean |
separateKeyWordsBySpeller() |
protected void |
setIgnoreShortUppercaseWords(boolean value) |
protected void |
setRuleHasSuggestions(boolean value) |
void |
useSubRuleSpecificIds()
If this is set, each replacement pair will have its own rule ID, making rule deactivations more specific.
|
addExamplePair, addTags, addToneTags, cacheAntiPatterns, estimateContextForSureMatch, getAntiPatterns, getCategory, getCorrectExamples, getDistanceTokens, getErrorTriggeringExamples, getFullId, getIncorrectExamples, getLocQualityIssueType, getMinPrevMatches, getPriority, getRuleOptions, getSentenceWithImmunization, getSourceFile, getSubId, getTags, getToneTags, getUrl, hasTag, hasToneTag, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isGoalSpecific, isIncludedInHiddenMatches, isOfficeDefaultOff, isOfficeDefaultOn, isPremium, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setDistanceTokens, setErrorTriggeringExamples, setExamplePair, setGoalSpecific, setIncludedInHiddenMatches, setIncorrectExamples, setLocQualityIssueType, setMinPrevMatches, setOfficeDefaultOff, setOfficeDefaultOn, setPremium, setPriority, setTags, setToneTags, setUrl, supportsLanguage, toRuleMatchArray, useInOfficeprotected final Language language
protected boolean subRuleSpecificIds
public AbstractSimpleReplaceRule2(ResourceBundle messages, Language language)
protected boolean isCheckingCase()
public abstract String getId()
RuleA-Z
and the underscore.public abstract String getDescription()
RulegetDescription in class Rule$match will be replaced with the matching word.public abstract String getShort()
public abstract String getMessage()
$match will be replaced with the matching word
and $suggestions will be replaced with the alternatives. This is the string
shown to the user.public String getSuggestionsSeparator()
public abstract Locale getLocale()
public void useSubRuleSpecificIds()
public AbstractSimpleReplaceRule2.CaseSensitivy getCaseSensitivy()
public String getDescription(String details)
public RuleMatch[] match(AnalyzedSentence sentence)
Ruleprotected boolean isRuleMatchException(RuleMatch ruleMatch)
protected boolean isException(String matchedText)
protected boolean isTokenException(AnalyzedTokenReadings atr)
public boolean checkKeyWordsAreKnownToSpeller()
public boolean checkKeyWordsAreUnknownToSpeller()
public boolean separateKeyWordsBySpeller()
protected boolean isPunctuationStart(String word)
public List<Map<String,SuggestionWithMessage>> getWrongWords()
protected boolean isIgnoreShortUppercaseWords()
protected void setIgnoreShortUppercaseWords(boolean value)
protected void setRuleHasSuggestions(boolean value)