Show / Hide Table of Contents

    Class AnalyzerWrapper

    Extension to Analyzer suitable for Analyzers which wrap other Analyzers.

    GetWrappedAnalyzer(String) allows the Analyzer to wrap multiple Analyzers which are selected on a per field basis.

    WrapComponents(String, TokenStreamComponents) allows the TokenStreamComponents of the wrapped Analyzer to then be wrapped (such as adding a new TokenFilter to form new TokenStreamComponents).

    Inheritance
    System.Object
    Analyzer
    AnalyzerWrapper
    Inherited Members
    Analyzer.NewAnonymous(Func<String, TextReader, TokenStreamComponents>)
    Analyzer.NewAnonymous(Func<String, TextReader, TokenStreamComponents>, ReuseStrategy)
    Analyzer.NewAnonymous(Func<String, TextReader, TokenStreamComponents>, Func<String, TextReader, TextReader>)
    Analyzer.NewAnonymous(Func<String, TextReader, TokenStreamComponents>, Func<String, TextReader, TextReader>, ReuseStrategy)
    Analyzer.GetTokenStream(String, TextReader)
    Analyzer.GetTokenStream(String, String)
    Analyzer.Strategy
    Analyzer.Dispose()
    Analyzer.Dispose(Boolean)
    Analyzer.GLOBAL_REUSE_STRATEGY
    Analyzer.PER_FIELD_REUSE_STRATEGY
    Namespace: Lucene.Net.Analysis
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class AnalyzerWrapper : Analyzer

    Constructors

    | Improve this Doc View Source

    AnalyzerWrapper()

    Creates a new AnalyzerWrapper. Since the ReuseStrategy of the wrapped Analyzers are unknown, PER_FIELD_REUSE_STRATEGY is assumed.

    Declaration
    protected AnalyzerWrapper()
    | Improve this Doc View Source

    AnalyzerWrapper(ReuseStrategy)

    Creates a new AnalyzerWrapper with the given reuse strategy.

    If you want to wrap a single delegate Analyzer you can probably reuse its strategy when instantiating this subclass: base(innerAnalyzer.Strategy).

    If you choose different analyzers per field, use PER_FIELD_REUSE_STRATEGY.

    Declaration
    protected AnalyzerWrapper(ReuseStrategy reuseStrategy)
    Parameters
    Type Name Description
    ReuseStrategy reuseStrategy
    See Also
    Strategy

    Methods

    | Improve this Doc View Source

    CreateComponents(String, TextReader)

    Declaration
    protected override sealed TokenStreamComponents CreateComponents(string fieldName, TextReader aReader)
    Parameters
    Type Name Description
    System.String fieldName
    TextReader aReader
    Returns
    Type Description
    TokenStreamComponents
    Overrides
    Analyzer.CreateComponents(String, TextReader)
    | Improve this Doc View Source

    GetOffsetGap(String)

    Declaration
    public override int GetOffsetGap(string fieldName)
    Parameters
    Type Name Description
    System.String fieldName
    Returns
    Type Description
    System.Int32
    Overrides
    Analyzer.GetOffsetGap(String)
    | Improve this Doc View Source

    GetPositionIncrementGap(String)

    Declaration
    public override int GetPositionIncrementGap(string fieldName)
    Parameters
    Type Name Description
    System.String fieldName
    Returns
    Type Description
    System.Int32
    Overrides
    Analyzer.GetPositionIncrementGap(String)
    | Improve this Doc View Source

    GetWrappedAnalyzer(String)

    Retrieves the wrapped Analyzer appropriate for analyzing the field with the given name

    Declaration
    protected abstract Analyzer GetWrappedAnalyzer(string fieldName)
    Parameters
    Type Name Description
    System.String fieldName

    Name of the field which is to be analyzed

    Returns
    Type Description
    Analyzer

    Analyzer for the field with the given name. Assumed to be non-null

    | Improve this Doc View Source

    InitReader(String, TextReader)

    Declaration
    protected override TextReader InitReader(string fieldName, TextReader reader)
    Parameters
    Type Name Description
    System.String fieldName
    TextReader reader
    Returns
    Type Description
    TextReader
    Overrides
    Analyzer.InitReader(String, TextReader)
    | Improve this Doc View Source

    WrapComponents(String, TokenStreamComponents)

    Wraps / alters the given TokenStreamComponents, taken from the wrapped Analyzer, to form new components. It is through this method that new TokenFilters can be added by AnalyzerWrappers. By default, the given components are returned.

    Declaration
    protected virtual TokenStreamComponents WrapComponents(string fieldName, TokenStreamComponents components)
    Parameters
    Type Name Description
    System.String fieldName

    Name of the field which is to be analyzed

    TokenStreamComponents components TokenStreamComponents taken from the wrapped Analyzer
    Returns
    Type Description
    TokenStreamComponents

    Wrapped / altered TokenStreamComponents.

    | Improve this Doc View Source

    WrapReader(String, TextReader)

    Wraps / alters the given . Through this method AnalyzerWrappers can implement InitReader(String, TextReader). By default, the given reader is returned.

    Declaration
    protected virtual TextReader WrapReader(string fieldName, TextReader reader)
    Parameters
    Type Name Description
    System.String fieldName

    name of the field which is to be analyzed

    TextReader reader

    the reader to wrap

    Returns
    Type Description
    TextReader

    the wrapped reader

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