code: public static void tagText(String contents, JLanguageTool lt) throws IOException {
      AnalyzedSentence analyzedText;
      List<String> sentences = lt.sentenceTokenize(contents);
      for (String sentence : sentences) {
        analyzedText = lt.getAnalyzedSentence(sentence);
        System.out.println(analyzedText);
      }
    }
docs: Tags text using the LanguageTool tagger, printing results to System.out.
  
  @param contents Text to tag.
  @param lt LanguageTool instance