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 ) ; } }
Tags text using the LanguageTool tagger printing results to System . out .