Fork me on GitHub
  • API

    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
    Lucene.Net.Util.AttributeSource
    Lucene.Net.Analysis.TokenStream
    Lucene.Net.Analysis.TokenFilter
    CapitalizationFilter
    Implements
    System.IDisposable
    Inherited Members
    Lucene.Net.Analysis.TokenFilter.m_input
    Lucene.Net.Analysis.TokenFilter.End()
    TokenFilter.Dispose(Boolean)
    Lucene.Net.Analysis.TokenFilter.Reset()
    Lucene.Net.Analysis.TokenStream.Dispose()
    Lucene.Net.Util.AttributeSource.GetAttributeFactory()
    Lucene.Net.Util.AttributeSource.GetAttributeClassesEnumerator()
    Lucene.Net.Util.AttributeSource.GetAttributeImplsEnumerator()
    Lucene.Net.Util.AttributeSource.AddAttributeImpl(Lucene.Net.Util.Attribute)
    Lucene.Net.Util.AttributeSource.AddAttribute<T>()
    Lucene.Net.Util.AttributeSource.HasAttributes
    Lucene.Net.Util.AttributeSource.HasAttribute<T>()
    Lucene.Net.Util.AttributeSource.GetAttribute<T>()
    Lucene.Net.Util.AttributeSource.ClearAttributes()
    Lucene.Net.Util.AttributeSource.CaptureState()
    Lucene.Net.Util.AttributeSource.RestoreState(Lucene.Net.Util.AttributeSource.State)
    Lucene.Net.Util.AttributeSource.GetHashCode()
    AttributeSource.Equals(Object)
    AttributeSource.ReflectAsString(Boolean)
    Lucene.Net.Util.AttributeSource.ReflectWith(Lucene.Net.Util.IAttributeReflector)
    Lucene.Net.Util.AttributeSource.CloneAttributes()
    Lucene.Net.Util.AttributeSource.CopyTo(Lucene.Net.Util.AttributeSource)
    Lucene.Net.Util.AttributeSource.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    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 invariant culture.

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

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

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

    Creates a CapitalizationFilter with the specified parameters using the invariant culture.

    Declaration
    public CapitalizationFilter(TokenStream in, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength)
    Parameters
    Type Name Description
    Lucene.Net.Analysis.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.

    System.Collections.Generic.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
    Lucene.Net.Analysis.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.

    System.Collections.Generic.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.

    System.Globalization.CultureInfo culture

    The culture to use for the casing operation. If null, System.Globalization.CultureInfo.InvariantCulture will be used.

    | 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
    Lucene.Net.Analysis.TokenStream in

    input tokenstream

    System.Globalization.CultureInfo culture

    The culture to use for the casing operation. If null, System.Globalization.CultureInfo.InvariantCulture 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
    Lucene.Net.Analysis.TokenStream.IncrementToken()

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.