Show / Hide Table of Contents

    Class LookaheadTokenFilter<T>

    An abstract to make it easier to build graph token filters requiring some lookahead. This class handles the details of buffering up tokens, recording them by position, restoring them, providing access to them, etc.

    Inheritance
    System.Object
    LookaheadTokenFilter
    LookaheadTokenFilter<T>
    MockGraphTokenFilter
    MockRandomLookaheadTokenFilter
    Inherited Members
    LookaheadTokenFilter.IncrementToken()
    Namespace: Lucene.Net.Analysis
    Assembly: Lucene.Net.TestFramework.dll
    Syntax
    public abstract class LookaheadTokenFilter<T> : LookaheadTokenFilter where T : LookaheadTokenFilter.Position
    Type Parameters
    Name Description
    T

    Constructors

    | Improve this Doc View Source

    LookaheadTokenFilter(TokenStream)

    Declaration
    protected LookaheadTokenFilter(TokenStream input)
    Parameters
    Type Name Description
    TokenStream input

    Fields

    | Improve this Doc View Source

    DEBUG

    Declaration
    protected static readonly bool DEBUG
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    m_end

    Declaration
    protected bool m_end
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    m_inputPos

    Declaration
    protected int m_inputPos
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_offsetAtt

    Declaration
    protected readonly IOffsetAttribute m_offsetAtt
    Field Value
    Type Description
    IOffsetAttribute
    | Improve this Doc View Source

    m_outputPos

    Declaration
    protected int m_outputPos
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_posIncAtt

    Declaration
    protected readonly IPositionIncrementAttribute m_posIncAtt
    Field Value
    Type Description
    IPositionIncrementAttribute
    | Improve this Doc View Source

    m_positions

    Declaration
    protected readonly RollingBuffer<T> m_positions
    Field Value
    Type Description
    RollingBuffer<T>
    | Improve this Doc View Source

    m_posLenAtt

    Declaration
    protected readonly IPositionLengthAttribute m_posLenAtt
    Field Value
    Type Description
    IPositionLengthAttribute

    Methods

    | Improve this Doc View Source

    AfterPosition()

    This is called when all input tokens leaving a given position have been returned. Override this and call insertToken and then set whichever token's attributes you want, if you want to inject a token starting from this position.

    Declaration
    protected virtual void AfterPosition()
    | Improve this Doc View Source

    InsertToken()

    Call this only from within AfterPosition(), to insert a new token. After calling this you should set any necessary token you need.

    Declaration
    protected virtual void InsertToken()
    | Improve this Doc View Source

    NewPosition()

    Declaration
    protected abstract T NewPosition()
    Returns
    Type Description
    T
    | Improve this Doc View Source

    NextToken()

    Call this when you are done looking ahead; it will set the next token to return. Return the boolean back to the caller.

    Declaration
    protected virtual bool NextToken()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    PeekToken()

    Returns true if there is a new token.

    Declaration
    protected virtual bool PeekToken()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Reset()

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