Class LookaheadTokenFilter<T>
An abstract TokenFilter 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<T>
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Lucene.Net.Analysis
Assembly: Lucene.Net.TestFramework.dll
Syntax
public abstract class LookaheadTokenFilter<T> : LookaheadTokenFilter, IDisposable where T : LookaheadTokenFilter.Position
Type Parameters
Name | Description |
---|---|
T |
Constructors
| Improve this Doc View SourceLookaheadTokenFilter(TokenStream)
Declaration
protected LookaheadTokenFilter(TokenStream input)
Parameters
Type | Name | Description |
---|---|---|
TokenStream | input |
Fields
| Improve this Doc View SourceDEBUG
Declaration
protected static readonly bool DEBUG
Field Value
Type | Description |
---|---|
System.Boolean |
m_end
Declaration
protected bool m_end
Field Value
Type | Description |
---|---|
System.Boolean |
m_inputPos
Declaration
protected int m_inputPos
Field Value
Type | Description |
---|---|
System.Int32 |
m_offsetAtt
Declaration
protected readonly IOffsetAttribute m_offsetAtt
Field Value
Type | Description |
---|---|
IOffsetAttribute |
m_outputPos
Declaration
protected int m_outputPos
Field Value
Type | Description |
---|---|
System.Int32 |
m_posIncAtt
Declaration
protected readonly IPositionIncrementAttribute m_posIncAtt
Field Value
Type | Description |
---|---|
IPositionIncrementAttribute |
m_positions
Declaration
protected readonly RollingBuffer<T> m_positions
Field Value
Type | Description |
---|---|
RollingBuffer<T> |
m_posLenAtt
Declaration
protected readonly IPositionLengthAttribute m_posLenAtt
Field Value
Type | Description |
---|---|
IPositionLengthAttribute |
Methods
| Improve this Doc View SourceAfterPosition()
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()
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()
NewPosition()
Declaration
protected abstract T NewPosition()
Returns
Type | Description |
---|---|
T |
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 |
PeekToken()
Returns true if there is a new token.
Declaration
protected virtual bool PeekToken()
Returns
Type | Description |
---|---|
System.Boolean |
Reset()
Declaration
public override void Reset()
Overrides
Implements
System.IDisposable