How to get a Token from a Lucene TokenStream?

Posted by FarmBoy on Stack Overflow See other posts from Stack Overflow or by FarmBoy
Published on 2010-04-14T14:30:34Z Indexed on 2010/04/14 14:33 UTC
Read the original article Hit count: 495

Filed under:
|
|
|
|

I'm trying to use Apache Lucene for tokenizing, and I am baffled at the process to obtain Tokens from a TokenStream.

The worst part is that I'm looking at the comments in the JavaDocs that address my question.

http://lucene.apache.org/java/3_0_1/api/core/org/apache/lucene/analysis/TokenStream.html#incrementToken%28%29

Somehow, an AttributeSource is supposed to be used, rather than Tokens. I'm totally at a loss.

Can anyone explain how to get token-like information from a TokenStream?

© Stack Overflow or respective owner

Related posts about java

Related posts about lucene