lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <>
Subject Re: pieces missing in reusable analyzers?
Date Mon, 10 Aug 2009 22:36:15 GMT
> Then how do you notify the other filters that they should reset their state?
> TokenStream.reset()?  The javadoc specifies that it's actually used
> for something else - but perhaps it can be reused for this purpose?

Yonik, I did exactly this with several in lucene contrib.
For these i had to explicitly reset the filtered stream, and implement
reset() , or they would not do the right thing.

for example ThaiWordFilter inside ThaiAnalyzer...

      streams.source = new StandardTokenizer(reader);
      streams.result = new StandardFilter(streams.source);
      streams.result = new ThaiWordFilter(streams.result);
      streams.result = new StopFilter(streams.result,
} else {
      streams.result.reset(); // reset the ThaiWordFilter's state

Robert Muir

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message