Class EnglishWordRepeatRule


public class EnglishWordRepeatRule extends WordRepeatRule
Word repeat rule for English, to avoid false alarms in the generic word repetition rule.
  • Field Details

    • SINGLE_CHAR

      private static final Pattern SINGLE_CHAR
  • 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 WordRepeatRule
    • ignore

      public boolean ignore(AnalyzedTokenReadings[] tokens, int position)
      Description copied from class: WordRepeatRule
      Implement this method to return true if there's a potential word repetition at the current position that should be ignored, i.e. if no error should be created.
      Overrides:
      ignore in class WordRepeatRule
      Parameters:
      tokens - the tokens of the sentence currently being checked
      position - the current position in the tokens
      Returns:
      this implementation always returns false
    • posIsIn

      private boolean posIsIn(AnalyzedTokenReadings[] tokens, int position, String... posTags)
    • repetitionOf

      private boolean repetitionOf(String word, AnalyzedTokenReadings[] tokens, int position)