Class MockCharFilter
The purpose of this charfilter is to send offsets out of bounds if the analyzer doesn't use CorrectOffset(int) or does incorrect offset math.
Implements
Inherited Members
Namespace: Lucene.Net.Analysis
Assembly: Lucene.Net.TestFramework.dll
Syntax
public class MockCharFilter : CharFilter, IDisposable
Constructors
MockCharFilter(TextReader)
The purpose of this charfilter is to send offsets out of bounds if the analyzer doesn't use CorrectOffset(int) or does incorrect offset math.
Declaration
public MockCharFilter(TextReader @in)
Parameters
Type | Name | Description |
---|---|---|
TextReader | in |
MockCharFilter(TextReader, int)
The purpose of this charfilter is to send offsets out of bounds if the analyzer doesn't use CorrectOffset(int) or does incorrect offset math.
Declaration
public MockCharFilter(TextReader @in, int remainder)
Parameters
Type | Name | Description |
---|---|---|
TextReader | in | |
int | remainder |
Methods
AddOffCorrectMap(int, int)
The purpose of this charfilter is to send offsets out of bounds if the analyzer doesn't use CorrectOffset(int) or does incorrect offset math.
Declaration
protected virtual void AddOffCorrectMap(int off, int cumulativeDiff)
Parameters
Type | Name | Description |
---|---|---|
int | off | |
int | cumulativeDiff |
Correct(int)
Subclasses override to correct the current offset.
Declaration
protected override int Correct(int currentOff)
Parameters
Type | Name | Description |
---|---|---|
int | currentOff | current offset |
Returns
Type | Description |
---|---|
int | corrected offset |
Overrides
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. |