Class MappingCharFilter
Simplistic Lucene.Net.Analysis.CharFilter that applies the mappings contained in a NormalizeCharMap to the character stream, and correcting the resulting changes to the offsets. Matching is greedy (longest pattern matching at a given point wins). Replacement is allowed to be the empty string.
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.CharFilters
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public class MappingCharFilter : BaseCharFilter, IDisposable
Constructors
MappingCharFilter(NormalizeCharMap, TextReader)
Default constructor that takes a TextReader.
Declaration
public MappingCharFilter(NormalizeCharMap normMap, TextReader @in)
Parameters
Type | Name | Description |
---|---|---|
NormalizeCharMap | normMap | |
TextReader | in |
Methods
Read()
Reads the next character from the text reader and advances the character position by one character.
Declaration
public override int Read()
Returns
Type | Description |
---|---|
int | The next character from the text reader, or -1 if no more characters are available. The default implementation returns -1. |
Overrides
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The TextReader is closed. |
IOException | An I/O error occurs. |
Read(char[], int, int)
Reads a specified maximum number of characters from the current reader and writes the data to a buffer, beginning at the specified index.
Declaration
public override int Read(char[] cbuf, int off, int len)
Parameters
Type | Name | Description |
---|---|---|
char[] | cbuf | |
int | off | |
int | len |
Returns
Type | Description |
---|---|
int | The number of characters that have been read. The number will be less than or equal to |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | The buffer length minus |
ArgumentOutOfRangeException |
|
ObjectDisposedException | The TextReader is closed. |
IOException | An I/O error occurs. |
Reset()
LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.
Declaration
public override void Reset()