C# Class Lucene.Net.Analysis.Miscellaneous.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: TokenFilter
Show file Open project: apache/lucenenet Class Usage Examples

Public Properties

Property Type Description
DEFAULT_MAX_TOKEN_LENGTH int
DEFAULT_MAX_WORD_COUNT int

Public Methods

Method Description
CapitalizationFilter ( TokenStream @in ) : System

Creates a CapitalizationFilter with the default parameters.

Calls {@link #CapitalizationFilter(TokenStream, boolean, CharArraySet, boolean, Collection, int, int, int) CapitalizationFilter(in, true, null, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH)}

CapitalizationFilter ( TokenStream @in, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection okPrefix, int minWordLength, int maxWordCount, int maxTokenLength ) : System

Creates a CapitalizationFilter with the specified parameters.

IncrementToken ( ) : bool

Private Methods

Method Description
ProcessWord ( char buffer, int offset, int length, int wordCount ) : void

Method Details

CapitalizationFilter() public method

Creates a CapitalizationFilter with the default parameters.

Calls {@link #CapitalizationFilter(TokenStream, boolean, CharArraySet, boolean, Collection, int, int, int) CapitalizationFilter(in, true, null, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH)}

public CapitalizationFilter ( TokenStream @in ) : System
@in TokenStream
return System

CapitalizationFilter() public method

Creates a CapitalizationFilter with the specified parameters.
public CapitalizationFilter ( TokenStream @in, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection okPrefix, int minWordLength, int maxWordCount, int maxTokenLength ) : System
@in TokenStream
onlyFirstWord bool should each word be capitalized or all of the words?
keep CharArraySet a keep word list. Each word that should be kept separated by whitespace.
forceFirstLetter bool Force the first letter to be capitalized even if it is in the keep list.
okPrefix ICollection do not change word capitalization if a word begins with something in this list.
minWordLength int how long the word needs to be to get capitalization applied. If the /// minWordLength is 3, "and" > "And" but "or" stays "or".
maxWordCount int if the token contains more then maxWordCount words, the capitalization is /// assumed to be correct.
maxTokenLength int ???
return System

IncrementToken() public method

public IncrementToken ( ) : bool
return bool

Property Details

DEFAULT_MAX_TOKEN_LENGTH public static property

public static int DEFAULT_MAX_TOKEN_LENGTH
return int

DEFAULT_MAX_WORD_COUNT public static property

public static int DEFAULT_MAX_WORD_COUNT
return int