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 boolean |
subRuleSpecificIds |
Constructor and Description |
---|
AbstractSimpleReplaceRule2(ResourceBundle messages,
Language language) |
Modifier and Type | Method and Description |
---|---|
protected void |
addToQueue(AnalyzedTokenReadings token,
Queue<AnalyzedTokenReadings> prevTokens) |
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(boolean checkingCase) |
protected boolean |
isException(String matchedText) |
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() |
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, getConfigureText, getCorrectExamples, getDefaultValue, getDistanceTokens, getErrorTriggeringExamples, getFullId, getIncorrectExamples, getLocQualityIssueType, getMaxConfigurableValue, getMinConfigurableValue, getMinPrevMatches, getSentenceWithImmunization, getSourceFile, getSubId, getTags, getToneTags, getUrl, hasConfigurableValue, hasTag, hasToneTag, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isGoalSpecific, isOfficeDefaultOff, isOfficeDefaultOn, isPremium, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setDistanceTokens, setErrorTriggeringExamples, setExamplePair, setGoalSpecific, setIncorrectExamples, setLocQualityIssueType, setMinPrevMatches, setOfficeDefaultOff, setOfficeDefaultOn, setPremium, setTags, setToneTags, setUrl, supportsLanguage, toRuleMatchArray, useInOffice
public AbstractSimpleReplaceRule2(ResourceBundle messages, Language language)
public abstract String getId()
Rule
A-Z
and the underscore.public abstract String getDescription()
Rule
getDescription
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 List<Map<String,SuggestionWithMessage>> getWrongWords(boolean checkingCase)
protected void addToQueue(AnalyzedTokenReadings token, Queue<AnalyzedTokenReadings> prevTokens)
public String getDescription(String details)
public RuleMatch[] match(AnalyzedSentence sentence)
Rule
protected boolean isException(String matchedText)
protected boolean isTokenException(AnalyzedTokenReadings atr)
public boolean checkKeyWordsAreKnownToSpeller()
public boolean checkKeyWordsAreUnknownToSpeller()
public boolean separateKeyWordsBySpeller()