Class GermanReadabilityRule


  • public class GermanReadabilityRule
    extends org.languagetool.rules.ReadabilityRule
    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 
      Modifier and Type Field Description
      private boolean tooEasyTest  
      • Fields inherited from class org.languagetool.rules.Rule

        messages
    • Constructor Summary

      Constructors 
      Constructor Description
      GermanReadabilityRule​(java.util.ResourceBundle messages, org.languagetool.Language lang, org.languagetool.UserConfig userConfig, boolean tooEasyTest)  
      GermanReadabilityRule​(java.util.ResourceBundle messages, org.languagetool.Language lang, org.languagetool.UserConfig userConfig, boolean tooEasyTest, boolean defaultOn)  
      GermanReadabilityRule​(java.util.ResourceBundle messages, org.languagetool.Language lang, org.languagetool.UserConfig userConfig, boolean tooEasyTest, int level)  
      GermanReadabilityRule​(java.util.ResourceBundle messages, org.languagetool.Language lang, org.languagetool.UserConfig userConfig, boolean tooEasyTest, int level, boolean defaultOn)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getConfigureText()  
      java.lang.String getDescription()  
      protected double getFleschReadingEase​(double ASL, double ASW)  
      java.lang.String getId()  
      java.lang.String getId​(boolean tooEasyTest)  
      protected java.lang.String getMessage​(int level, int FRE, int ASL, int ASW)  
      private static boolean isVowel​(char c)  
      private static java.lang.String printMessageLevel​(int level)  
      protected int simpleSyllablesCount​(java.lang.String word)  
      • Methods inherited from class org.languagetool.rules.ReadabilityRule

        getDefaultValue, getMaxConfigurableValue, getMinConfigurableValue, hasConfigurableValue, match, minToCheckParagraph
      • Methods inherited from class org.languagetool.rules.TextLevelRule

        estimateContextForSureMatch, match, match
      • Methods inherited from class org.languagetool.rules.Rule

        addExamplePair, getAntiPatterns, getCategory, getCorrectExamples, getErrorTriggeringExamples, getIncorrectExamples, getLocQualityIssueType, getSentenceWithImmunization, getUrl, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isOfficeDefaultOff, isOfficeDefaultOn, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setErrorTriggeringExamples, setIncorrectExamples, setLocQualityIssueType, setOfficeDefaultOff, setOfficeDefaultOn, setUrl, supportsLanguage, toRuleMatchArray, useInOffice
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • tooEasyTest

        private boolean tooEasyTest
    • Constructor Detail

      • GermanReadabilityRule

        public GermanReadabilityRule​(java.util.ResourceBundle messages,
                                     org.languagetool.Language lang,
                                     org.languagetool.UserConfig userConfig,
                                     boolean tooEasyTest)
      • GermanReadabilityRule

        public GermanReadabilityRule​(java.util.ResourceBundle messages,
                                     org.languagetool.Language lang,
                                     org.languagetool.UserConfig userConfig,
                                     boolean tooEasyTest,
                                     int level)
      • GermanReadabilityRule

        public GermanReadabilityRule​(java.util.ResourceBundle messages,
                                     org.languagetool.Language lang,
                                     org.languagetool.UserConfig userConfig,
                                     boolean tooEasyTest,
                                     boolean defaultOn)
      • GermanReadabilityRule

        public GermanReadabilityRule​(java.util.ResourceBundle messages,
                                     org.languagetool.Language lang,
                                     org.languagetool.UserConfig userConfig,
                                     boolean tooEasyTest,
                                     int level,
                                     boolean defaultOn)
    • Method Detail

      • getId

        public java.lang.String getId()
        Overrides:
        getId in class org.languagetool.rules.ReadabilityRule
      • getId

        public java.lang.String getId​(boolean tooEasyTest)
        Overrides:
        getId in class org.languagetool.rules.ReadabilityRule
      • getDescription

        public java.lang.String getDescription()
        Overrides:
        getDescription in class org.languagetool.rules.ReadabilityRule
      • printMessageLevel

        private static java.lang.String printMessageLevel​(int level)
      • getMessage

        protected java.lang.String getMessage​(int level,
                                              int FRE,
                                              int ASL,
                                              int ASW)
        Overrides:
        getMessage in class org.languagetool.rules.ReadabilityRule
      • getConfigureText

        public java.lang.String getConfigureText()
        Overrides:
        getConfigureText in class org.languagetool.rules.ReadabilityRule
      • getFleschReadingEase

        protected double getFleschReadingEase​(double ASL,
                                              double ASW)
        Overrides:
        getFleschReadingEase in class org.languagetool.rules.ReadabilityRule
      • isVowel

        private static boolean isVowel​(char c)
      • simpleSyllablesCount

        protected int simpleSyllablesCount​(java.lang.String word)
        Overrides:
        simpleSyllablesCount in class org.languagetool.rules.ReadabilityRule