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, matchaddExamplePair, 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, useInOfficepublic 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()
RulegetConfigureText in class Rulepublic double denominator()
public boolean hasConfigurableValue()
RulehasConfigurableValue in class Rulepublic int getDefaultValue()
RulegetDefaultValue in class Rulepublic int getMinConfigurableValue()
RulegetMinConfigurableValue in class Rulepublic int getMaxConfigurableValue()
RulegetMaxConfigurableValue in class Rulepublic int getWordCount()
public int getNumberOfMatches()
public void setWithoutDirectSpeech(boolean withoutDirectSpeech)
public RuleMatch[] match(List<AnalyzedSentence> sentences) throws IOException
match in class TextLevelRuleIOExceptionpublic int minToCheckParagraph()
TextLevelRuleminToCheckParagraph in class TextLevelRule