public static void main(String[] args) throws Exception { Analyzer analyzer = new ShingleAnalyzerWrapper(new SimpleAnalyzer(), 9); String content = KeepEverythingExtractor.INSTANCE.getText(new InputStreamReader(System.in)); TokenStream ts = analyzer.tokenStream("extracted_text", content); CharTermAttribute cattr = ts.addAttribute(CharTermAttribute.class); ts.reset(); while (ts.incrementToken()) { System.out.println(cattr.toString()); } ts.close(); }