Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Public Member Functions | Protected Member Functions | List of all members
Lucene.Net.Analysis.CharTokenizer Class Referenceabstract

An abstract base class for simple, character-oriented tokenizers. More...

Inherits Lucene.Net.Analysis.Tokenizer.

Inherited by Lucene.Net.Analysis.Ext.LetterOrDigitTokenizer, Lucene.Net.Analysis.LetterTokenizer, Lucene.Net.Analysis.Ru.RussianLetterTokenizer, and Lucene.Net.Analysis.WhitespaceTokenizer.

Public Member Functions

override bool IncrementToken ()
 Consumers (i.e., IndexWriter) use this method to advance the stream to the next token. Implementing classes must implement this method and update the appropriate Util.Attributes with the attributes of the next token.
 
override void End ()
 This method is called by the consumer after the last token has been consumed, after IncrementToken returned false (using the new TokenStream API). Streams implementing the old API should upgrade to use this feature. This method can be used to perform any end-of-stream operations, such as setting the final offset of a stream. The final offset of a stream might differ from the offset of the last token eg in case one or more whitespaces followed after the last token, but a WhitespaceTokenizer was used.
 
override void Reset (System.IO.TextReader input)
 Expert: Reset the tokenizer to a new reader. Typically, an analyzer (in its reusableTokenStream method) will use this to re-use a previously created tokenizer.
 

Protected Member Functions

 CharTokenizer (System.IO.TextReader input)
 
 CharTokenizer (AttributeSource source, System.IO.TextReader input)
 
 CharTokenizer (AttributeFactory factory, System.IO.TextReader input)
 
- Protected Member Functions inherited from Lucene.Net.Analysis.Tokenizer
override void Dispose (bool disposing)
 

Additional Inherited Members

- Properties inherited from Lucene.Net.Util.AttributeSource
virtual AttributeFactory Factory [get]
 Returns the used AttributeFactory.
 
virtual bool HasAttributes [get]
 Returns true, iff this AttributeSource has any attributes
 

Detailed Description

An abstract base class for simple, character-oriented tokenizers.

Definition at line 25 of file CharTokenizer.cs.

Constructor & Destructor Documentation

Lucene.Net.Analysis.CharTokenizer.CharTokenizer ( System.IO.TextReader  input)
protected

Definition at line 27 of file CharTokenizer.cs.

Lucene.Net.Analysis.CharTokenizer.CharTokenizer ( AttributeSource  source,
System.IO.TextReader  input 
)
protected

Definition at line 33 of file CharTokenizer.cs.

Lucene.Net.Analysis.CharTokenizer.CharTokenizer ( AttributeFactory  factory,
System.IO.TextReader  input 
)
protected

Definition at line 39 of file CharTokenizer.cs.

Member Function Documentation

override void Lucene.Net.Analysis.CharTokenizer.End ( )
virtual

This method is called by the consumer after the last token has been consumed, after IncrementToken returned false (using the new TokenStream API). Streams implementing the old API should upgrade to use this feature. This method can be used to perform any end-of-stream operations, such as setting the final offset of a stream. The final offset of a stream might differ from the offset of the last token eg in case one or more whitespaces followed after the last token, but a WhitespaceTokenizer was used.

<throws> IOException </throws>

Reimplemented from Lucene.Net.Analysis.TokenStream.

Definition at line 120 of file CharTokenizer.cs.

override bool Lucene.Net.Analysis.CharTokenizer.IncrementToken ( )
virtual

Consumers (i.e., IndexWriter) use this method to advance the stream to the next token. Implementing classes must implement this method and update the appropriate Util.Attributes with the attributes of the next token.

The producer must make no assumptions about the attributes after the method has been returned: the caller may arbitrarily change it. If the producer needs to preserve the state for subsequent calls, it can use AttributeSource.CaptureState to create a copy of the current attribute state.

This method is called for every token of a document, so an efficient implementation is crucial for good performance. To avoid calls to AttributeSource.AddAttribute{T}() and AttributeSource.GetAttribute{T}(), references to all Util.Attributes that this stream uses should be retrieved during instantiation.

To ensure that filters and consumers know which attributes are available, the attributes must be added during instantiation. Filters and consumers are not required to check for availability of attributes in IncrementToken().

Returns
false for end of stream; true otherwise

Implements Lucene.Net.Analysis.TokenStream.

Definition at line 69 of file CharTokenizer.cs.

override void Lucene.Net.Analysis.CharTokenizer.Reset ( System.IO.TextReader  input)
virtual

Expert: Reset the tokenizer to a new reader. Typically, an analyzer (in its reusableTokenStream method) will use this to re-use a previously created tokenizer.

Reimplemented from Lucene.Net.Analysis.Tokenizer.

Definition at line 127 of file CharTokenizer.cs.


The documentation for this class was generated from the following file: