public abstract class AbstractCompoundRule extends Rule
| Modifier and Type | Field and Description |
|---|---|
protected Language |
lang |
protected LinguServices |
linguServices |
protected boolean |
sentenceStartsWithUpperCase |
protected boolean |
subRuleSpecificIds |
| Constructor and Description |
|---|
AbstractCompoundRule(ResourceBundle messages,
Language lang,
UserConfig userConfig,
String withHyphenMessage,
String withoutHyphenMessage,
String withOrWithoutHyphenMessage) |
AbstractCompoundRule(ResourceBundle messages,
Language lang,
UserConfig userConfig,
String withHyphenMessage,
String withoutHyphenMessage,
String withOrWithoutHyphenMessage,
String shortMessage) |
| Modifier and Type | Method and Description |
|---|---|
int |
estimateContextForSureMatch()
A number that estimates how many words there must be after a match before we
can be (relatively) sure the match is valid.
|
protected List<String> |
filterReplacements(List<String> replacements,
String original) |
abstract CompoundRuleData |
getCompoundRuleData() |
abstract String |
getDescription()
A short description of the error this rule can detect, usually in the language of the text
that is checked.
|
abstract String |
getId()
A string used to identify the rule in e.g. configuration files.
|
boolean |
isMisspelled(String word) |
RuleMatch[] |
match(AnalyzedSentence sentence)
Check whether the given sentence matches this error rule, i.e. whether it
contains the error detected by this rule.
|
String |
mergeCompound(String str,
boolean uncapitalizeMidWords) |
void |
useSubRuleSpecificIds() |
addExamplePair, addTags, addToneTags, cacheAntiPatterns, 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, useInOfficeprotected final LinguServices linguServices
protected final Language lang
protected boolean sentenceStartsWithUpperCase
protected boolean subRuleSpecificIds
public AbstractCompoundRule(ResourceBundle messages, Language lang, UserConfig userConfig, String withHyphenMessage, String withoutHyphenMessage, String withOrWithoutHyphenMessage) throws IOException
IOExceptionpublic AbstractCompoundRule(ResourceBundle messages, Language lang, UserConfig userConfig, String withHyphenMessage, String withoutHyphenMessage, String withOrWithoutHyphenMessage, String shortMessage) throws IOException
IOExceptionpublic abstract String getId()
RuleA-Z
and the underscore.public abstract String getDescription()
RulegetDescription in class Rulepublic int estimateContextForSureMatch()
Rule-1 when the sentence needs to end to be sure there's a match.estimateContextForSureMatch in class Rulepublic void useSubRuleSpecificIds()
public abstract CompoundRuleData getCompoundRuleData()
public RuleMatch[] match(AnalyzedSentence sentence) throws IOException
Rulematch in class Rulesentence - a pre-analyzed sentenceRuleMatch objectsIOExceptionprotected List<String> filterReplacements(List<String> replacements, String original) throws IOException
IOExceptionpublic boolean isMisspelled(String word) throws IOException
IOException