Show / Hide Table of Contents

    Class PatternReplaceFilter

    A TokenFilter which applies a to each token in the stream, replacing match occurances with the specified replacement string.

    Note: Depending on the input and the pattern used and the input TokenStream, this TokenFilter may produce Tokens whose text is the empty string.

    Inheritance
    System.Object
    AttributeSource
    TokenStream
    TokenFilter
    PatternReplaceFilter
    Implements
    IDisposable
    Inherited Members
    TokenFilter.m_input
    TokenFilter.End()
    TokenFilter.Dispose(Boolean)
    TokenFilter.Reset()
    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.Pattern
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public sealed class PatternReplaceFilter : TokenFilter, IDisposable

    Constructors

    | Improve this Doc View Source

    PatternReplaceFilter(TokenStream, Regex, String, Boolean)

    Constructs an instance to replace either the first, or all occurances

    Declaration
    public PatternReplaceFilter(TokenStream in, Regex pattern, string replacement, bool all)
    Parameters
    Type Name Description
    TokenStream in

    the TokenStream to process

    Regex pattern

    the pattern (a object) to apply to each Token

    System.String replacement

    the "replacement string" to substitute, if null a blank string will be used. Note that this is not the literal string that will be used, '$' and '&apos; have special meaning.

    System.Boolean all

    if true, all matches will be replaced otherwise just the first match.

    Methods

    | Improve this Doc View Source

    IncrementToken()

    Declaration
    public override bool IncrementToken()
    Returns
    Type Description
    System.Boolean
    Overrides
    TokenStream.IncrementToken()

    Implements

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