public abstract class AbstractStatisticStyleRule extends TextLevelRule
Constructor and Description |
---|
AbstractStatisticStyleRule(ResourceBundle messages,
Language lang,
UserConfig userConfig,
int minPercent) |
AbstractStatisticStyleRule(ResourceBundle messages,
Language lang,
UserConfig userConfig,
int minPercent,
boolean defaultActive) |
Modifier and Type | Method and Description |
---|---|
protected abstract int |
conditionFulfilled(AnalyzedTokenReadings[] tokens,
int nAnalysedToken)
Condition to generate a hint (possibly including all exceptions)
Returns:
< nAnalysedToken, if condition is not fulfilled
>= nAnalysedToken, if condition is not fulfilled; integer is number of token which is the end hint
|
double |
denominator()
Override, if value should be given in an other unity than percent
|
protected abstract boolean |
excludeDirectSpeech()
Condition to generate a hint related to the sentence (possibly including all exceptions)
|
abstract String |
getConfigureText()
Overwrite this to define the Text in the option panel for the configurable value
|
int |
getDefaultValue()
Overwrite this to get a default Integer value by option panel
|
protected abstract String |
getLimitMessage(int limit,
double percent)
Defines the message for hints which exceed the limit
|
int |
getMaxConfigurableValue()
Overwrite this to define the maximum of a configurable value
|
int |
getMinConfigurableValue()
Overwrite this to define the minimum of a configurable value
|
int |
getNumberOfMatches() |
protected abstract String |
getSentenceMessage()
Defines the message for sentence related hints
|
int |
getWordCount() |
boolean |
hasConfigurableValue()
Overwrite this to return true, if a value may be configured by option panel
|
RuleMatch[] |
match(List<AnalyzedSentence> sentences) |
int |
minToCheckParagraph()
Gives back the minimum number of paragraphs to check to give back a correct result.
|
protected abstract boolean |
sentenceConditionFulfilled(AnalyzedTokenReadings[] tokens,
int nAnalysedToken)
Condition to generate a hint related to the sentence (possibly including all exceptions)
|
void |
setWithoutDirectSpeech(boolean withoutDirectSpeech) |
estimateContextForSureMatch, match, match
addExamplePair, addTags, addToneTags, cacheAntiPatterns, getAntiPatterns, getCategory, getCorrectExamples, getDescription, getDistanceTokens, getErrorTriggeringExamples, getFullId, getId, getIncorrectExamples, getLocQualityIssueType, getMinPrevMatches, getSentenceWithImmunization, getSourceFile, getSubId, getTags, getToneTags, getUrl, 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 AbstractStatisticStyleRule(ResourceBundle messages, Language lang, UserConfig userConfig, int minPercent, boolean defaultActive)
public AbstractStatisticStyleRule(ResourceBundle messages, Language lang, UserConfig userConfig, int minPercent)
protected abstract int conditionFulfilled(AnalyzedTokenReadings[] tokens, int nAnalysedToken)
protected abstract boolean sentenceConditionFulfilled(AnalyzedTokenReadings[] tokens, int nAnalysedToken)
protected abstract boolean excludeDirectSpeech()
protected abstract String getLimitMessage(int limit, double percent)
protected abstract String getSentenceMessage()
public abstract String getConfigureText()
Rule
getConfigureText
in class Rule
public double denominator()
public boolean hasConfigurableValue()
Rule
hasConfigurableValue
in class Rule
public int getDefaultValue()
Rule
getDefaultValue
in class Rule
public int getMinConfigurableValue()
Rule
getMinConfigurableValue
in class Rule
public int getMaxConfigurableValue()
Rule
getMaxConfigurableValue
in class Rule
public int getWordCount()
public int getNumberOfMatches()
public void setWithoutDirectSpeech(boolean withoutDirectSpeech)
public RuleMatch[] match(List<AnalyzedSentence> sentences) throws IOException
match
in class TextLevelRule
IOException
public int minToCheckParagraph()
TextLevelRule
minToCheckParagraph
in class TextLevelRule