Class TokenStreamComponents
This class encapsulates the outer components of a token stream. It provides access to the source (Tokenizer) and the outer end (sink), an instance of TokenFilter which also serves as the TokenStream returned by GetTokenStream(string, TextReader).
Inherited Members
Namespace: Lucene.Net.Analysis
Assembly: Lucene.Net.dll
Syntax
public class TokenStreamComponents
Constructors
TokenStreamComponents(Tokenizer)
Creates a new TokenStreamComponents instance.
Declaration
public TokenStreamComponents(Tokenizer source)
Parameters
Type | Name | Description |
---|---|---|
Tokenizer | source | the analyzer's tokenizer |
TokenStreamComponents(Tokenizer, TokenStream)
Creates a new TokenStreamComponents instance.
Declaration
public TokenStreamComponents(Tokenizer source, TokenStream result)
Parameters
Type | Name | Description |
---|---|---|
Tokenizer | source | the analyzer's tokenizer |
TokenStream | result | the analyzer's resulting token stream |
Fields
m_sink
Sink tokenstream, such as the outer tokenfilter decorating the chain. This can be the source if there are no filters.
Declaration
protected readonly TokenStream m_sink
Field Value
Type | Description |
---|---|
TokenStream |
m_source
Original source of the tokens.
Declaration
protected readonly Tokenizer m_source
Field Value
Type | Description |
---|---|
Tokenizer |
Properties
TokenStream
Returns the sink TokenStream
Declaration
public virtual TokenStream TokenStream { get; }
Property Value
Type | Description |
---|---|
TokenStream | the sink TokenStream |
Tokenizer
Returns the component's Tokenizer
Declaration
public virtual Tokenizer Tokenizer { get; }
Property Value
Type | Description |
---|---|
Tokenizer | Component's Tokenizer |
Methods
SetReader(TextReader)
Resets the encapsulated components with the given reader. If the components cannot be reset, an Exception should be thrown.
Declaration
protected virtual void SetReader(TextReader reader)
Parameters
Type | Name | Description |
---|---|---|
TextReader | reader | a reader to reset the source component |
Exceptions
Type | Condition |
---|---|
IOException | if the component's reset method throws an IOException |