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 |
getConfigurePercentText() |
abstract String |
getConfigureWithoutDirectSpeachText() |
protected abstract String |
getLimitMessage(int limit,
double percent)
Defines the message for hints which exceed the limit
|
int |
getNumberOfMatches() |
RuleOption[] |
getRuleOptions()
give the user the possibility to configure the function
|
protected abstract String |
getSentenceMessage()
Defines the message for sentence related hints
|
int |
getWordCount() |
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, getPriority, getSentenceWithImmunization, getSourceFile, getSubId, getTags, getToneTags, getUrl, hasTag, hasToneTag, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isGoalSpecific, isIncludedInHiddenMatches, isOfficeDefaultOff, isOfficeDefaultOn, isPremium, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setDistanceTokens, setErrorTriggeringExamples, setExamplePair, setGoalSpecific, setIncludedInHiddenMatches, setIncorrectExamples, setLocQualityIssueType, setMinPrevMatches, setOfficeDefaultOff, setOfficeDefaultOn, setPremium, setPriority, 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 getConfigurePercentText()
public abstract String getConfigureWithoutDirectSpeachText()
public double denominator()
public RuleOption[] getRuleOptions()
getRuleOptions 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