Show / Hide Table of Contents

    Class CachingTokenFilter

    This class can be used if the token attributes of a TokenStream are intended to be consumed more than once. It caches all token attribute states locally in a List.

    CachingTokenFilter implements the optional method Reset(), which repositions the stream to the first Token.

    Inheritance
    System.Object
    AttributeSource
    TokenStream
    TokenFilter
    CachingTokenFilter
    Implements
    IDisposable
    Inherited Members
    TokenFilter.m_input
    TokenFilter.Dispose(Boolean)
    TokenStream.Dispose()
    AttributeSource.GetAttributeFactory()
    AttributeSource.GetAttributeClassesEnumerator()
    AttributeSource.GetAttributeImplsEnumerator()
    AttributeSource.AddAttributeImpl(Attribute)
    AttributeSource.AddAttribute<T>()
    AttributeSource.HasAttributes
    AttributeSource.HasAttribute<T>()
    AttributeSource.GetAttribute<T>()
    AttributeSource.ClearAttributes()
    AttributeSource.CaptureState()
    AttributeSource.RestoreState(AttributeSource.State)
    AttributeSource.GetHashCode()
    AttributeSource.Equals(Object)
    AttributeSource.ReflectAsString(Boolean)
    AttributeSource.ReflectWith(IAttributeReflector)
    AttributeSource.CloneAttributes()
    AttributeSource.CopyTo(AttributeSource)
    AttributeSource.ToString()
    Namespace: Lucene.Net.Analysis
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class CachingTokenFilter : TokenFilter, IDisposable

    Constructors

    | Improve this Doc View Source

    CachingTokenFilter(TokenStream)

    Create a new CachingTokenFilter around input, caching its token attributes, which can be replayed again after a call to Reset().

    Declaration
    public CachingTokenFilter(TokenStream input)
    Parameters
    Type Name Description
    TokenStream input

    Methods

    | Improve this Doc View Source

    End()

    Declaration
    public override void End()
    Overrides
    TokenFilter.End()
    | Improve this Doc View Source

    IncrementToken()

    Declaration
    public override bool IncrementToken()
    Returns
    Type Description
    System.Boolean
    Overrides
    TokenStream.IncrementToken()
    | Improve this Doc View Source

    Reset()

    Rewinds the iterator to the beginning of the cached list.

    Note that this does not call Reset() on the wrapped tokenstream ever, even the first time. You should Reset() the inner tokenstream before wrapping it with CachingTokenFilter.

    Declaration
    public override void Reset()
    Overrides
    TokenFilter.Reset()

    Implements

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