Package org.apache.lucene.analysis
Class Analyzer.TokenStreamComponents
java.lang.Object
org.apache.lucene.analysis.Analyzer.TokenStreamComponents
- Enclosing class:
Analyzer
This class encapsulates the outer components of a token stream. It provides access to the
source (a
Reader Consumer and the outer end (sink), an instance of TokenFilter which also serves as the TokenStream returned by Analyzer.tokenStream(String, Reader).-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TokenStreamSink tokenstream, such as the outer tokenfilter decorating the chain.Original source of the tokens. -
Constructor Summary
ConstructorsConstructorDescriptionTokenStreamComponents(Consumer<Reader> source, TokenStream result) Creates a newAnalyzer.TokenStreamComponentsinstance.TokenStreamComponents(Tokenizer tokenizer) Creates a newAnalyzer.TokenStreamComponentsfrom a TokenizerTokenStreamComponents(Tokenizer tokenizer, TokenStream result) Creates a newAnalyzer.TokenStreamComponentsinstance -
Method Summary
-
Field Details
-
source
Original source of the tokens. -
sink
Sink tokenstream, such as the outer tokenfilter decorating the chain. This can be the source if there are no filters.
-
-
Constructor Details
-
TokenStreamComponents
Creates a newAnalyzer.TokenStreamComponentsinstance.- Parameters:
source- the source to set the reader onresult- the analyzer's resulting token stream
-
TokenStreamComponents
Creates a newAnalyzer.TokenStreamComponentsinstance- Parameters:
tokenizer- the analyzer's Tokenizerresult- the analyzer's resulting token stream
-
TokenStreamComponents
Creates a newAnalyzer.TokenStreamComponentsfrom a Tokenizer
-
-
Method Details
-
getTokenStream
Returns the sinkTokenStream- Returns:
- the sink
TokenStream
-
getSource
Returns the component's source
-