Class LongSentenceRule

java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.LongSentenceRule
org.languagetool.rules.de.LongSentenceRule

public class LongSentenceRule extends org.languagetool.rules.LongSentenceRule
A rule that warns on long sentences.
Since:
3.9
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final boolean
     

    Fields inherited from class org.languagetool.rules.LongSentenceRule

    maxWords, RULE_ID

    Fields inherited from class org.languagetool.rules.Rule

    messages
  • Constructor Summary

    Constructors
    Constructor
    Description
    LongSentenceRule(ResourceBundle messages, org.languagetool.UserConfig userConfig)
    Creates a rule with default values can be overwritten by configuration settings
    LongSentenceRule(ResourceBundle messages, org.languagetool.UserConfig userConfig, int defaultWords)
    Creates a rule with default inactive
    LongSentenceRule(ResourceBundle messages, org.languagetool.UserConfig userConfig, int defaultWords, boolean defaultActive)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
    private boolean
    isWordCount(String tokenText)
     
    org.languagetool.rules.RuleMatch[]
    match(org.languagetool.AnalyzedSentence sentence)
     

    Methods inherited from class org.languagetool.rules.LongSentenceRule

    getConfigureText, getDefaultValue, getMaxConfigurableValue, getMinConfigurableValue, hasConfigurableValue

    Methods inherited from class org.languagetool.rules.Rule

    addExamplePair, estimateContextForSureMatch, 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 Details

  • Constructor Details

    • LongSentenceRule

      public LongSentenceRule(ResourceBundle messages, org.languagetool.UserConfig userConfig, int defaultWords, boolean defaultActive)
      Parameters:
      defaultActive - allows default granularity
    • LongSentenceRule

      public LongSentenceRule(ResourceBundle messages, org.languagetool.UserConfig userConfig, int defaultWords)
      Creates a rule with default inactive
      Since:
      4.2
    • LongSentenceRule

      public LongSentenceRule(ResourceBundle messages, org.languagetool.UserConfig userConfig)
      Creates a rule with default values can be overwritten by configuration settings
      Since:
      4.2
  • Method Details

    • getDescription

      public String getDescription()
      Overrides:
      getDescription in class org.languagetool.rules.LongSentenceRule
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class org.languagetool.rules.LongSentenceRule
    • getId

      public String getId()
      Overrides:
      getId in class org.languagetool.rules.LongSentenceRule
    • isWordCount

      private boolean isWordCount(String tokenText)
    • match

      public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence sentence) throws IOException
      Overrides:
      match in class org.languagetool.rules.LongSentenceRule
      Throws:
      IOException