code: public List<RuleMatch> check(AnnotatedText annotatedText, boolean tokenizeText, ParagraphHandling paraMode, RuleMatchListener listener, Mode mode) throws IOException {
      List<String> sentences;
      if (tokenizeText) { 
        sentences = sentenceTokenize(annotatedText.getPlainText());
      } else {
        sentences = new ArrayList<>();
        sentences.add(annotatedText.getPlainText());
      }
      List<Rule> allRules = getAllRules();
      if (printStream != null) {
        printIfVerbose(allRules.size() + " rules activated for language " + language);
      }
  
      unknownWords = new HashSet<>();
      List<AnalyzedSentence> analyzedSentences = analyzeSentences(sentences);
      
      List<RuleMatch> ruleMatches = performCheck(analyzedSentences, sentences, allRules, paraMode, annotatedText, listener, mode);
      ruleMatches = new SameRuleGroupFilter().filter(ruleMatches);
      // no sorting: SameRuleGroupFilter sorts rule matches already
      if (cleanOverlappingMatches) {
        ruleMatches = new CleanOverlappingFilter(language).filter(ruleMatches);
      }
      return ruleMatches;
    }
docs: The main check method. Tokenizes the text into sentences and matches these
  sentences against all currently active rules depending on {@code mode}.
  @since 4.3