Class GermanReadabilityRule


public class GermanReadabilityRule extends 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 Details

    • tooEasyTest

      private final boolean tooEasyTest
  • Constructor Details

  • Method Details

    • getId

      public String getId()
      Description copied from class: Rule
      A 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 characters A-Z and the underscore.
      Overrides:
      getId in class ReadabilityRule
    • getId

      public String getId(boolean tooEasyTest)
      Overrides:
      getId in class ReadabilityRule
    • getDescription

      public String getDescription()
      Description copied from class: Rule
      A short description of the error this rule can detect, usually in the language of the text that is checked.
      Overrides:
      getDescription in class ReadabilityRule
    • printMessageLevel

      public String printMessageLevel(int level)
      Overrides:
      printMessageLevel in class ReadabilityRule
    • getMessage

      protected String getMessage(int level, int fre, int als, int asw)
      Overrides:
      getMessage in class ReadabilityRule
    • getConfigureText

      public String getConfigureText()
      Overrides:
      getConfigureText in class ReadabilityRule
    • getFleschReadingEase

      public double getFleschReadingEase(double asl, double asw)
      Description copied from class: ReadabilityRule
      get Flesch-Reading-Ease (Formula for readability) for English the formula dependence on the language and has to be overridden for every supported language
      Overrides:
      getFleschReadingEase in class ReadabilityRule
    • simpleSyllablesCount

      protected int simpleSyllablesCount(String word)
      Description copied from class: ReadabilityRule
      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. from LO extension) Has to be overridden for every language
      Overrides:
      simpleSyllablesCount in class ReadabilityRule