StringReader reader = new StringReader(content);
Analyzer analyzer = null;
analyzer = new StandardAnalyzer(Version.LUCENE_30);
TokenStream ts = analyzer.tokenStream(null, reader);
ts.addAttribute(TermAttribute.class);
while (ts.incrementToken()) {
TermAttribute ta = ts.getAttribute(TermAttribute.class);
System.out.println(ta.term());
}
运行结果:
lucene3.0
升
级
后
以
前
的
显
示
分
....
..
...