Java 类org.apache.lucene.analysis.shingle.ShingleAnalyzerWrapper 实例源码

项目:crawl-eval    文件:ExtractThis.java   
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();

}