Thank you guys for suggestions
I've changed the diff to include them:
1. Implemented MorfologikFilter.reset that resets the stemsAcc, and added a test case that would fail in the absence of that implementation, which exhibits the behaviour mentioned by Robert.
2. Updated modules/analysis/NOTICE.txt and modules/analysis/LICENSE.txt - Robert, is that what you meant, or do they need to include more information ?
3. MorfologikFilter now uses an explicit pointer to not modify the stemsAcc on each pass - Dawid, do you think it's reasonable to optimize further and use directly a list returned by IStemmer.lookup (instead of copying with addAll) ? My concern is that (at least in current DictionaryLookup implementation) that list seems to be shared by distinct invocations of the lookup method, which would make the use of a specific IStemmer not applicable in thread-safe code.
4. Removed explicit call to getStem().toString().
As for the new Morfologik version, I've been thinking it would be better to alter the constructors of MorfologikAnalyzer and MorfologikFilter to accept concrete IStemmer implementations, instead of a languageCode String as they do now. This way, org.apache.lucene.analysis.morfologik package wouldn't depend on current implementations of IStemmer (only on the interface), and also allowed future ones to be used without changing the package. What do you think ?
That could also solve the case of a custom attribute for POS tags (MorfologikPOSAttribute ?) : since a client would instantiate their IStemmer explicitly, they would know the meaning of the attribute's value. That doesn't take into account the DICTIONARY.COMBINED stemmer, but the same seems to apply to the Morfologik library itself (I mean, for a specific WordData from IStemmer.lookup there is no information on which of the internal concrete DictionaryLookup it comes from). Dawid - what do you think of that issue ?