Show / Hide Table of Contents

    Class CharFilter

    Subclasses of CharFilter can be chained to filter a They can be used as with additional offset correction. Tokenizers will automatically use CorrectOffset(Int32) if a CharFilter subclass is used.

    This class is abstract: at a minimum you must implement , transforming the input in some way from m_input, and Correct(Int32) to adjust the offsets to match the originals.

    You can optionally provide more efficient implementations of additional methods like , but this is not required.

    For examples and integration with Analyzer, see the Lucene.Net.Analysis namespace documentation.

    Inheritance
    System.Object
    CharFilter
    Namespace: Lucene.Net.Analysis
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class CharFilter : TextReader

    Constructors

    | Improve this Doc View Source

    CharFilter(TextReader)

    Create a new CharFilter wrapping the provided reader.

    Declaration
    public CharFilter(TextReader input)
    Parameters
    Type Name Description
    TextReader input

    a , can also be a CharFilter for chaining.

    Fields

    | Improve this Doc View Source

    m_input

    The underlying character-input stream.

    Declaration
    protected readonly TextReader m_input
    Field Value
    Type Description
    TextReader

    Properties

    | Improve this Doc View Source

    IsMarkSupported

    Tells whether this stream supports the Mark(Int32) operation. The default implementation always returns false. Subclasses should override this method.

    LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.

    Declaration
    public virtual bool IsMarkSupported { get; }
    Property Value
    Type Description
    System.Boolean

    true if and only if this stream supports the mark operation.

    | Improve this Doc View Source

    IsReady

    Tells whether this stream is ready to be read.

    True if the next is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.

    LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.

    Declaration
    public virtual bool IsReady { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    Correct(Int32)

    Subclasses override to correct the current offset.

    Declaration
    protected abstract int Correct(int currentOff)
    Parameters
    Type Name Description
    System.Int32 currentOff

    current offset

    Returns
    Type Description
    System.Int32

    corrected offset

    | Improve this Doc View Source

    CorrectOffset(Int32)

    Chains the corrected offset through the input CharFilter(s).

    Declaration
    public int CorrectOffset(int currentOff)
    Parameters
    Type Name Description
    System.Int32 currentOff
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    Dispose(Boolean)

    Closes the underlying input stream.

    NOTE: The default implementation closes the input , so be sure to call base.Dispose(disposing) when overriding this method.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    | Improve this Doc View Source

    Mark(Int32)

    Marks the present position in the stream. Subsequent calls to Reset() will attempt to reposition the stream to this point. Not all character-input streams support the Mark(Int32) operation.

    LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.

    Declaration
    public virtual void Mark(int readAheadLimit)
    Parameters
    Type Name Description
    System.Int32 readAheadLimit

    Limit on the number of characters that may be read while still preserving the mark. After reading this many characters, attempting to reset the stream may fail.

    | Improve this Doc View Source

    Read()

    Declaration
    public override int Read()
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    Read(Char[], Int32, Int32)

    Declaration
    public abstract override int Read(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    System.Char[] buffer
    System.Int32 index
    System.Int32 count
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    Reset()

    LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.

    Declaration
    public virtual void Reset()
    | Improve this Doc View Source

    Skip(Int32)

    Skips characters. This method will block until some characters are available, an I/O error occurs, or the end of the stream is reached.

    LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.

    Declaration
    public virtual long Skip(int n)
    Parameters
    Type Name Description
    System.Int32 n

    The number of characters to skip

    Returns
    Type Description
    System.Int64

    The number of characters actually skipped

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)