public abstract class AbstractStatisticSentenceStyleRule extends TextLevelRule
Constructor and Description |
---|
AbstractStatisticSentenceStyleRule(ResourceBundle messages,
Language lang,
UserConfig userConfig,
int minPercent) |
AbstractStatisticSentenceStyleRule(ResourceBundle messages,
Language lang,
UserConfig userConfig,
int minPercent,
boolean defaultActive) |
Modifier and Type | Method and Description |
---|---|
protected abstract AnalyzedTokenReadings |
conditionFulfilled(List<AnalyzedTokenReadings> tokens)
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() |
int |
getSentenceCount() |
boolean |
hasConfigurableValue()
Overwrite this to return true, if a value may be configured by option panel
|
protected boolean |
isMark(AnalyzedTokenReadings token) |
protected boolean |
isOpeningQuote(AnalyzedTokenReadings token) |
RuleMatch[] |
match(List<AnalyzedSentence> sentences) |
int |
minToCheckParagraph()
Gives back the minimum number of paragraphs to check to give back a correct result.
|
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 AbstractStatisticSentenceStyleRule(ResourceBundle messages, Language lang, UserConfig userConfig, int minPercent, boolean defaultActive)
public AbstractStatisticSentenceStyleRule(ResourceBundle messages, Language lang, UserConfig userConfig, int minPercent)
protected abstract AnalyzedTokenReadings conditionFulfilled(List<AnalyzedTokenReadings> tokens)
protected abstract boolean excludeDirectSpeech()
protected abstract String getLimitMessage(int limit, double percent)
public abstract String getConfigureText()
Rule
getConfigureText
in class Rule
protected boolean isMark(AnalyzedTokenReadings token)
protected boolean isOpeningQuote(AnalyzedTokenReadings token)
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 getSentenceCount()
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