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.
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Miscellaneous
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class CapitalizationFilter : TokenFilter, IDisposable
Constructors
| Improve this Doc View SourceCapitalizationFilter(TokenStream)
Creates a CapitalizationFilter with the default parameters using the culture from the current thread.
Declaration
public CapitalizationFilter(TokenStream in)
Parameters
Type | Name | Description |
---|---|---|
TokenStream | in |
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. |
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. |
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. |
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, the culture of the current thread will be used. |
CapitalizationFilter(TokenStream, CultureInfo)
Creates a CapitalizationFilter with the default parameters and the specified culture
.
Declaration
public CapitalizationFilter(TokenStream in, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
TokenStream | in | input tokenstream |
System.Globalization.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 SourceDEFAULT_MAX_TOKEN_LENGTH
Declaration
public static readonly int DEFAULT_MAX_TOKEN_LENGTH
Field Value
Type | Description |
---|---|
System.Int32 |
DEFAULT_MAX_WORD_COUNT
Declaration
public static readonly int DEFAULT_MAX_WORD_COUNT
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceIncrementToken()
Declaration
public override bool IncrementToken()
Returns
Type | Description |
---|---|
System.Boolean |