lucene-3.6

Analyzer analyzer = new SimpleAnalyzer(Version.LUCENE_36);

TokenStream ts = analyzer.tokenStream(null, new StringReader(str));

CharTermAttribute termAtt = stream.getAttribute(CharTermAttribute.class);

TypeAttribute typeAtt= ts.getAttribute(TypeAttribute.class);
OffsetAttribute offsetAtt= ts.getAttribute(OffsetAttribute.class);
PositionIncrementAttribute  posAtt= ts.getAttribute(PositionIncrementAttribute.class);

你可能感兴趣的:(Lucene)