public abstract class ConfusionProbabilityRule extends Rule
confusion_sets.txt) suits best.| Modifier and Type | Field and Description |
|---|---|
static float |
MIN_COVERAGE |
| Constructor and Description |
|---|
ConfusionProbabilityRule(ResourceBundle messages,
LanguageModel languageModel,
Language language) |
ConfusionProbabilityRule(ResourceBundle messages,
LanguageModel languageModel,
Language language,
int grams) |
| Modifier and Type | Method and Description |
|---|---|
String |
getId()
A string used to identify the rule in e.g. configuration files.
|
abstract String |
getMessage(String suggestion,
String description) |
protected abstract WordTokenizer |
getTokenizer() |
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 |
setConfusionSet(ConfusionSet set)
Deprecated.
used only for tests
|
addExamplePair, getCategory, getCorrectExamples, getDescription, getIncorrectExamples, getLocQualityIssueType, getUrl, isDefaultOff, isDictionaryBasedSpellingRule, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setIncorrectExamples, setLocQualityIssueType, setUrl, supportsLanguage, toRuleMatchArray, useInOfficepublic static final float MIN_COVERAGE
public ConfusionProbabilityRule(ResourceBundle messages, LanguageModel languageModel, Language language)
public ConfusionProbabilityRule(ResourceBundle messages, LanguageModel languageModel, Language language, int grams)
protected abstract WordTokenizer getTokenizer()
public String getId()
RuleA-Z
and the underscore.public RuleMatch[] match(AnalyzedSentence sentence)
Rulepublic void reset()
Rulepublic void setConfusionSet(ConfusionSet set)