apache/lucene-solr — pull request #53 by PaulElschot (2014-05-18 22:10:34+00:00)
Title: Add PrefillTokenStream in analysis common module

This class is taken from the proposed label module, the tests there also pass when using this.

It is a token stream that can be prefilled by adding token states, much like CachingTokenFilter and TeeSinkTokenFilter.SinkTokenStream, but the addState method here is public.
It is used in the label module to build token streams.

Some questions:

Is this a good way to build multiple streams from a single input stream?
When not, I'll need to use another way to build token streams in the label module.

This duplicates some code in CachingTokenFilter and TeeSinkTokenFilter.SinkTokenStream.
Should this rather be a superclass of TeeSinkTokenFilter.SinkTokenStream? In that case an extra non final class would also be needed to allow the inheritance, because an instantiated TokenStream subclass must be final.