Show / Hide Table of Contents

    Class CapitalizationFilter

    A filter to apply normal capitalization rules to Tokens. It will make the first letter capital and the rest lower case.

    This filter is particularly useful to build nice looking facet parameters. This filter is not appropriate if you intend to use a prefix query.

    Inheritance
    System.Object
    AttributeSource
    TokenStream
    TokenFilter
    CapitalizationFilter
    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.Miscellaneous
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public sealed class CapitalizationFilter : TokenFilter, IDisposable

    Constructors

    | Improve this Doc View Source

    CapitalizationFilter(TokenStream)

    Creates a CapitalizationFilter with the default parameters using the culture from the current thread.

    Calls CapitalizationFilter(TokenStream, Boolean, CharArraySet, Boolean, ICollection<Char[]>, Int32, Int32, Int32)

    Declaration
    public CapitalizationFilter(TokenStream in)
    Parameters
    Type Name Description
    TokenStream in
    | Improve this Doc View Source

    CapitalizationFilter(TokenStream, CultureInfo)

    Creates a CapitalizationFilter with the default parameters and the specified culture.

    Calls CapitalizationFilter(TokenStream, Boolean, CharArraySet, Boolean, ICollection<Char[]>, Int32, Int32, Int32)

    Declaration
    public CapitalizationFilter(TokenStream in, CultureInfo culture)
    Parameters
    Type Name Description
    TokenStream in

    input tokenstream

    CultureInfo culture

    The culture to use for the casing operation. If null, the culture of the current thread will be used.

    | Improve this Doc View Source

    CapitalizationFilter(TokenStream, Boolean, CharArraySet, Boolean, ICollection<Char[]>, Int32, Int32, Int32)

    Creates a CapitalizationFilter with the specified parameters using the culture from the current thread.

    Declaration
    public CapitalizationFilter(TokenStream in, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength)
    Parameters
    Type Name Description
    TokenStream in

    input tokenstream

    System.Boolean onlyFirstWord

    should each word be capitalized or all of the words?

    CharArraySet keep

    a keep word list. Each word that should be kept separated by whitespace.

    System.Boolean forceFirstLetter

    Force the first letter to be capitalized even if it is in the keep list.

    ICollection<System.Char[]> okPrefix

    do not change word capitalization if a word begins with something in this list.

    System.Int32 minWordLength

    how long the word needs to be to get capitalization applied. If the minWordLength is 3, "and" > "And" but "or" stays "or".

    System.Int32 maxWordCount

    if the token contains more then maxWordCount words, the capitalization is assumed to be correct.

    System.Int32 maxTokenLength

    The maximum length for an individual token. Tokens that exceed this length will not have the capitalization operation performed.

    | Improve this Doc View Source

    CapitalizationFilter(TokenStream, Boolean, CharArraySet, Boolean, ICollection<Char[]>, Int32, Int32, Int32, CultureInfo)

    Creates a CapitalizationFilter with the specified parameters and the specified culture.

    Declaration
    public CapitalizationFilter(TokenStream in, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength, CultureInfo culture)
    Parameters
    Type Name Description
    TokenStream in

    input tokenstream

    System.Boolean onlyFirstWord

    should each word be capitalized or all of the words?

    CharArraySet keep

    a keep word list. Each word that should be kept separated by whitespace.

    System.Boolean forceFirstLetter

    Force the first letter to be capitalized even if it is in the keep list.

    ICollection<System.Char[]> okPrefix

    do not change word capitalization if a word begins with something in this list.

    System.Int32 minWordLength

    how long the word needs to be to get capitalization applied. If the minWordLength is 3, "and" > "And" but "or" stays "or".

    System.Int32 maxWordCount

    if the token contains more then maxWordCount words, the capitalization is assumed to be correct.

    System.Int32 maxTokenLength

    The maximum length for an individual token. Tokens that exceed this length will not have the capitalization operation performed.

    CultureInfo culture

    The culture to use for the casing operation. If null, the culture of the current thread will be used.

    Fields

    | Improve this Doc View Source

    DEFAULT_MAX_TOKEN_LENGTH

    Declaration
    public static readonly int DEFAULT_MAX_TOKEN_LENGTH
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    DEFAULT_MAX_WORD_COUNT

    Declaration
    public static readonly int DEFAULT_MAX_WORD_COUNT
    Field Value
    Type Description
    System.Int32

    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)