Class GermanStyleRepeatedWordRule


  • public class GermanStyleRepeatedWordRule
    extends org.languagetool.rules.AbstractStyleRepeatedWordRule
    A rule checks the appearance of same words in a sentence or in two consecutive sentences. Only substantive, verbs and adjectives are checked. This rule detects no grammar error but a stylistic problem (default off)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String SYNONYMS_URL  
      • Fields inherited from class org.languagetool.rules.AbstractStyleRepeatedWordRule

        maxDistanceOfSentences
      • Fields inherited from class org.languagetool.rules.Rule

        messages
    • Constructor Summary

      Constructors 
      Constructor Description
      GermanStyleRepeatedWordRule​(java.util.ResourceBundle messages, org.languagetool.Language lang, org.languagetool.UserConfig userConfig)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()  
      java.lang.String getId()  
      protected boolean isPartOfWord​(java.lang.String testTokenText, java.lang.String tokenText)  
      protected boolean isTokenPair​(org.languagetool.AnalyzedTokenReadings[] tokens, int n, boolean before)  
      protected boolean isTokenToCheck​(org.languagetool.AnalyzedTokenReadings token)  
      private static boolean isUnknownWord​(org.languagetool.AnalyzedTokenReadings token)  
      protected java.lang.String messageSameSentence()  
      protected java.lang.String messageSentenceAfter()  
      protected java.lang.String messageSentenceBefore()  
      protected java.net.URL setURL​(org.languagetool.AnalyzedTokenReadings token)  
      • Methods inherited from class org.languagetool.rules.AbstractStyleRepeatedWordRule

        getConfigureText, getDefaultValue, getMaxConfigurableValue, getMinConfigurableValue, getSynonyms, 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
    • Constructor Detail

      • GermanStyleRepeatedWordRule

        public GermanStyleRepeatedWordRule​(java.util.ResourceBundle messages,
                                           org.languagetool.Language lang,
                                           org.languagetool.UserConfig userConfig)
    • Method Detail

      • getId

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

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

        protected java.lang.String messageSameSentence()
        Specified by:
        messageSameSentence in class org.languagetool.rules.AbstractStyleRepeatedWordRule
      • messageSentenceBefore

        protected java.lang.String messageSentenceBefore()
        Specified by:
        messageSentenceBefore in class org.languagetool.rules.AbstractStyleRepeatedWordRule
      • messageSentenceAfter

        protected java.lang.String messageSentenceAfter()
        Specified by:
        messageSentenceAfter in class org.languagetool.rules.AbstractStyleRepeatedWordRule
      • isUnknownWord

        private static boolean isUnknownWord​(org.languagetool.AnalyzedTokenReadings token)
      • isTokenToCheck

        protected boolean isTokenToCheck​(org.languagetool.AnalyzedTokenReadings token)
        Specified by:
        isTokenToCheck in class org.languagetool.rules.AbstractStyleRepeatedWordRule
      • isTokenPair

        protected boolean isTokenPair​(org.languagetool.AnalyzedTokenReadings[] tokens,
                                      int n,
                                      boolean before)
        Specified by:
        isTokenPair in class org.languagetool.rules.AbstractStyleRepeatedWordRule
      • isPartOfWord

        protected boolean isPartOfWord​(java.lang.String testTokenText,
                                       java.lang.String tokenText)
        Overrides:
        isPartOfWord in class org.languagetool.rules.AbstractStyleRepeatedWordRule
      • setURL

        protected java.net.URL setURL​(org.languagetool.AnalyzedTokenReadings token)
                               throws java.net.MalformedURLException
        Overrides:
        setURL in class org.languagetool.rules.AbstractStyleRepeatedWordRule
        Throws:
        java.net.MalformedURLException