Class EnglishWordRepeatBeginningRule


public class EnglishWordRepeatBeginningRule extends WordRepeatBeginningRule
Adds a list English adverbs to WordRepeatBeginningRule.
  • Field Details

    • ADD_ADVERBS

      private static final Set<String> ADD_ADVERBS
    • CONTRAST_ADVERBS

      private static final Set<String> CONTRAST_ADVERBS
    • EMPHASIS_ADVERBS

      private static final Set<String> EMPHASIS_ADVERBS
    • EXPLAIN_ADVERBS

      private static final Set<String> EXPLAIN_ADVERBS
    • ADD_EXPRESSIONS

      private static final List<String> ADD_EXPRESSIONS
    • CONTRAST_EXPRESSIONS

      private static final List<String> CONTRAST_EXPRESSIONS
  • Constructor Details

    • EnglishWordRepeatBeginningRule

      public EnglishWordRepeatBeginningRule(ResourceBundle messages, Language language)
  • 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 WordRepeatBeginningRule
    • isException

      public boolean isException(String token)
      Overrides:
      isException in class WordRepeatBeginningRule
    • isAdverb

      protected boolean isAdverb(AnalyzedTokenReadings token)
      Overrides:
      isAdverb in class WordRepeatBeginningRule
    • getSuggestions

      protected List<String> getSuggestions(AnalyzedTokenReadings token)
      Overrides:
      getSuggestions in class WordRepeatBeginningRule
    • getDifferentAdverbsOfSameCategory

      private List<String> getDifferentAdverbsOfSameCategory(String adverb, Set<String> adverbsOfCategory)
      Gives suggestions to replace the given adverb.
      Parameters:
      adverb - to get suggestions for
      adverbsOfCategory - the adverbs of the same category as adverb (adverb is required to be contained in the Set)
      Returns:
      a List of suggested adverbs to replace the given adverb