> 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,
StopAnalyzer.ENGLISH_STOP_WORDS_SET);
      setPreviousTokenStream(streams);
} else {
      streams.source.reset(reader);
      streams.result.reset(); // reset the ThaiWordFilter's state
}

-- 
Robert Muir
rcm...@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to