Package org.languagetool.rules.de
Class GermanReadabilityRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.TextLevelRule
org.languagetool.rules.ReadabilityRule
org.languagetool.rules.de.GermanReadabilityRule
A rule that checks the readability of German text (using the Flesch-Reading-Ease Formula)
If tooEasyTest == true, the rule tests if paragraph level > level (readability is too easy)
If tooEasyTest == false, the rule tests if paragraph level < level (readability is too difficult)
- Since:
- 4.4
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGermanReadabilityRule(ResourceBundle messages, Language lang, UserConfig userConfig, boolean tooEasyTest) GermanReadabilityRule(ResourceBundle messages, Language lang, UserConfig userConfig, boolean tooEasyTest, boolean defaultOn) GermanReadabilityRule(ResourceBundle messages, Language lang, UserConfig userConfig, boolean tooEasyTest, int level) GermanReadabilityRule(ResourceBundle messages, Language lang, UserConfig userConfig, boolean tooEasyTest, int level, boolean defaultOn) -
Method Summary
Modifier and TypeMethodDescriptionA short description of the error this rule can detect, usually in the language of the text that is checked.doublegetFleschReadingEase(double asl, double asw) get Flesch-Reading-Ease (Formula for readability) for English the formula dependence on the language and has to be overridden for every supported languagegetId()A string used to identify the rule in e.g.getId(boolean tooEasyTest) protected StringgetMessage(int level, int fre, int als, int asw) printMessageLevel(int level) protected intsimpleSyllablesCount(String word) A simple method to count the Syllables of a word TODO: further improvement of the method A hyphenation service should be used if available (e.g.Methods inherited from class org.languagetool.rules.ReadabilityRule
getAllSentences, getAllSyllables, getAllWords, getRuleOptions, match, minToCheckParagraphMethods inherited from class org.languagetool.rules.TextLevelRule
estimateContextForSureMatch, match, matchMethods inherited from class org.languagetool.rules.Rule
addExamplePair, addTags, addToneTags, cacheAntiPatterns, getAntiPatterns, getCategory, getCorrectExamples, getDistanceTokens, getErrorTriggeringExamples, getFullId, 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, useInOffice
-
Field Details
-
tooEasyTest
private final boolean tooEasyTest
-
-
Constructor Details
-
GermanReadabilityRule
public GermanReadabilityRule(ResourceBundle messages, Language lang, UserConfig userConfig, boolean tooEasyTest) -
GermanReadabilityRule
public GermanReadabilityRule(ResourceBundle messages, Language lang, UserConfig userConfig, boolean tooEasyTest, int level) -
GermanReadabilityRule
public GermanReadabilityRule(ResourceBundle messages, Language lang, UserConfig userConfig, boolean tooEasyTest, boolean defaultOn) -
GermanReadabilityRule
public GermanReadabilityRule(ResourceBundle messages, Language lang, UserConfig userConfig, boolean tooEasyTest, int level, boolean defaultOn)
-
-
Method Details
-
getId
Description copied from class:RuleA string used to identify the rule in e.g. configuration files. This string is supposed to be unique and to stay the same in all upcoming versions of LanguageTool. It's supposed to contain only the charactersA-Zand the underscore.- Overrides:
getIdin classReadabilityRule
-
getId
- Overrides:
getIdin classReadabilityRule
-
getDescription
Description copied from class:RuleA short description of the error this rule can detect, usually in the language of the text that is checked.- Overrides:
getDescriptionin classReadabilityRule
-
printMessageLevel
- Overrides:
printMessageLevelin classReadabilityRule
-
getMessage
- Overrides:
getMessagein classReadabilityRule
-
getConfigureText
- Overrides:
getConfigureTextin classReadabilityRule
-
getFleschReadingEase
public double getFleschReadingEase(double asl, double asw) Description copied from class:ReadabilityRuleget Flesch-Reading-Ease (Formula for readability) for English the formula dependence on the language and has to be overridden for every supported language- Overrides:
getFleschReadingEasein classReadabilityRule
-
simpleSyllablesCount
Description copied from class:ReadabilityRuleA simple method to count the Syllables of a word TODO: further improvement of the method A hyphenation service should be used if available (e.g. from LO extension) Has to be overridden for every language- Overrides:
simpleSyllablesCountin classReadabilityRule
-