Class CaseRule

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

public class CaseRule extends org.languagetool.rules.Rule
Check that adjectives and verbs are not written with an uppercase first letter (except at the start of a sentence) and cases like this: Das laufen fällt mir leicht. (laufen needs to be uppercased).
  • Field Details

    • NUMERALS_EN

      private static final Pattern NUMERALS_EN
    • nounIndicators

      private static final Set<String> nounIndicators
    • UPPERCASE_MESSAGE

      private static final String UPPERCASE_MESSAGE
      See Also:
    • LOWERCASE_MESSAGE

      private static final String LOWERCASE_MESSAGE
      See Also:
    • COLON_MESSAGE

      private static final String COLON_MESSAGE
      See Also:
    • SENT_START

      public static final org.languagetool.rules.patterns.PatternToken SENT_START
    • ANTI_PATTERNS

      private static final List<List<org.languagetool.rules.patterns.PatternToken>> ANTI_PATTERNS
    • sentenceStartExceptions

      private static final String[] sentenceStartExceptions
    • UNDEFINED_QUANTIFIERS

      private static final String[] UNDEFINED_QUANTIFIERS
    • INTERROGATIVE_PARTICLES

      private static final String[] INTERROGATIVE_PARTICLES
    • POSSESSIVE_INDICATORS

      private static final String[] POSSESSIVE_INDICATORS
    • DAS_VERB_EXCEPTIONS

      private static final String[] DAS_VERB_EXCEPTIONS
    • exceptions

      private static final String[] exceptions
    • languages

      private static final Set<String> languages
    • exceptionPatterns

      private static final Set<Pattern[]> exceptionPatterns
    • substVerbenExceptions

      private static final Set<String> substVerbenExceptions
    • tagger

      private final GermanTagger tagger
    • german

      private final German german
  • Constructor Details

  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in class org.languagetool.rules.Rule
    • estimateContextForSureMatch

      public int estimateContextForSureMatch()
      Overrides:
      estimateContextForSureMatch in class org.languagetool.rules.Rule
    • getUrl

      public URL getUrl()
      Overrides:
      getUrl in class org.languagetool.rules.Rule
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class org.languagetool.rules.Rule
    • match

      public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence sentence) throws IOException
      Specified by:
      match in class org.languagetool.rules.Rule
      Throws:
      IOException
    • getTokensWithPosTagStartingWithCount

      private int getTokensWithPosTagStartingWithCount(org.languagetool.AnalyzedTokenReadings[] tokens, String partialPosTag)
    • isPotentialUpperCaseError

      private boolean isPotentialUpperCaseError(int pos, org.languagetool.AnalyzedTokenReadings[] tokens, org.languagetool.AnalyzedTokenReadings lowercaseReadings, boolean isPrecededByModalOrAuxiliary)
    • getAntiPatterns

      public List<org.languagetool.tagging.disambiguation.rules.DisambiguationPatternRule> getAntiPatterns()
      Overrides:
      getAntiPatterns in class org.languagetool.rules.Rule
    • isPrevProbablyRelativePronoun

      private boolean isPrevProbablyRelativePronoun(org.languagetool.AnalyzedTokenReadings[] tokens, int i)
    • isSalutation

      private boolean isSalutation(String token)
    • isCompany

      private boolean isCompany(String token)
    • isDot

      private boolean isDot(String token)
    • hasNounReading

      private boolean hasNounReading(org.languagetool.AnalyzedTokenReadings readings)
    • potentiallyAddLowercaseMatch

      private void potentiallyAddLowercaseMatch(List<org.languagetool.rules.RuleMatch> ruleMatches, org.languagetool.AnalyzedTokenReadings tokenReadings, boolean prevTokenIsDas, String token, boolean nextTokenIsPersonalOrReflexivePronoun, org.languagetool.AnalyzedSentence sentence)
    • potentiallyAddUppercaseMatch

      private void potentiallyAddUppercaseMatch(List<org.languagetool.rules.RuleMatch> ruleMatches, org.languagetool.AnalyzedTokenReadings[] tokens, int i, org.languagetool.AnalyzedTokenReadings analyzedToken, String token, org.languagetool.AnalyzedTokenReadings lowercaseReadings, org.languagetool.AnalyzedSentence sentence)
    • isNounWithVerbReading

      private boolean isNounWithVerbReading(int i, org.languagetool.AnalyzedTokenReadings[] tokens)
    • isVerbFollowing

      private boolean isVerbFollowing(int i, org.languagetool.AnalyzedTokenReadings[] tokens, org.languagetool.AnalyzedTokenReadings lowercaseReadings)
    • addRuleMatch

      private void addRuleMatch(List<org.languagetool.rules.RuleMatch> ruleMatches, org.languagetool.AnalyzedSentence sentence, String msg, org.languagetool.AnalyzedTokenReadings tokenReadings, String fixedWord)
    • isNumbering

      private boolean isNumbering(int i, org.languagetool.AnalyzedTokenReadings[] tokens)
    • isEllipsis

      private boolean isEllipsis(int i, org.languagetool.AnalyzedTokenReadings[] tokens)
    • isNominalization

      private boolean isNominalization(int i, org.languagetool.AnalyzedTokenReadings[] tokens, String token, org.languagetool.AnalyzedTokenReadings lowercaseReadings)
    • isNumber

      private boolean isNumber(String token)
    • isAdverbAndNominalization

      private boolean isAdverbAndNominalization(int i, org.languagetool.AnalyzedTokenReadings[] tokens)
    • hasPartialTag

      private boolean hasPartialTag(org.languagetool.AnalyzedTokenReadings token, String... posTags)
    • isSpecialCase

      private boolean isSpecialCase(int i, org.languagetool.AnalyzedTokenReadings[] tokens)
    • isAdjectiveAsNoun

      private boolean isAdjectiveAsNoun(int i, org.languagetool.AnalyzedTokenReadings[] tokens, org.languagetool.AnalyzedTokenReadings lowercaseReadings)
    • isLanguage

      private boolean isLanguage(int i, org.languagetool.AnalyzedTokenReadings[] tokens, String token)
    • isProbablyCity

      private boolean isProbablyCity(int i, org.languagetool.AnalyzedTokenReadings[] tokens, String token)
    • isFollowedByRelativeOrSubordinateClause

      private boolean isFollowedByRelativeOrSubordinateClause(int i, org.languagetool.AnalyzedTokenReadings[] tokens)
    • isExceptionPhrase

      private boolean isExceptionPhrase(int i, org.languagetool.AnalyzedTokenReadings[] tokens)
    • compareLists

      boolean compareLists(org.languagetool.AnalyzedTokenReadings[] tokens, int startIndex, int endIndex, Pattern[] patterns)
    • lookup

      private org.languagetool.AnalyzedTokenReadings lookup(String word)