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
        internal static void AssertCapitalizesTo(Tokenizer tokenizer, string[] expected, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection <char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength)
        {
            CapitalizationFilter filter = new CapitalizationFilter(tokenizer, onlyFirstWord, keep, forceFirstLetter, okPrefix, minWordLength, maxWordCount, maxTokenLength,
                                                                   // LUCENENET specific - pass in the invariant culture to get the same behavior as Lucene,
                                                                   // otherwise the filter is culture-sensitive.
                                                                   CultureInfo.InvariantCulture);

            AssertTokenStreamContents(filter, expected);
        }
 internal static void AssertCapitalizesTo(Tokenizer tokenizer, string[] expected, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength)
 {
     CapitalizationFilter filter = new CapitalizationFilter(tokenizer, onlyFirstWord, keep, forceFirstLetter, okPrefix, minWordLength, maxWordCount, maxTokenLength);
     AssertTokenStreamContents(filter, expected);
 }
Ejemplo n.º 3
0
        internal static void AssertCapitalizesTo(Tokenizer tokenizer, string[] expected, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection <char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength)
        {
            CapitalizationFilter filter = new CapitalizationFilter(tokenizer, onlyFirstWord, keep, forceFirstLetter, okPrefix, minWordLength, maxWordCount, maxTokenLength);

            AssertTokenStreamContents(filter, expected);
        }