concept TokenFilters in category lucene

appears as: TokenFilters, TokenFilters
Lucene in Action, Second Edition

This is an excerpt from Manning's book Lucene in Action, Second Edition.

When an analyzer returns a TokenStream from its tokenStream or reusableTokenStream method, it typically starts with a single Tokenizer, which creates the initial sequence of tokens, then chains together any number of TokenFilters to modify these tokens. This is referred to as the analyzer chain. Figure 4.4 shows an analyzer chain that has three TokenFilters.

Table 8.1. Contrib analyzers

Analyzer

TokenStream and TokenFilter chain

ar.ArabicAnalyzer ArabicLetterTokenizer > LowerCaseFilter > StopFilter > ArabicNormalizationFilter > ArabicStemFilter.
br.BrazilianAnalyzer StandardTokenizer > StandardFilter >StopFilter (custom stop table) > BrazilianStemFilter > LowerCaseFilter.
cjk.CJKAnalyzer CJKTokenizer > StopFilter (custom English stop words ironically). Indexes Chinese text using bigrams of adjacent Chinese characters as tokens.
cn.ChineseAnalyzer ChineseTokenizer > ChineseFilter. Indexes Chinese text by mapping each Chinese character to its own token.
cn.smart.SmartChineseAnalyzer An alternative Chinese analyzer that attempts to segment Chinese text into words using a dictionary-based approach.
compound.* Two different TokenFilters that decompose compound words you find in many Germanic languages to the word parts. There are two approaches (one using hyphenation-based grammar to detect word parts, the other using a word-based dictionary).
cz.CzechAnalyzer StandardTokenizer > StandardFilter > LowerCaseFilter > StopFilter (custom stop list).
de.GermanAnalyzer StandardTokenizer > StandardFilter > LowerCaseFilter > StopFilter (custom stop list) > GermanStemFilter.
el.GreekAnalyzer StandardTokenizer > GreekLowerCaseFilter > StopFilter (custom stop list).
fa.PersianAnalyzer ArabicLetterTokenizer > LowerCaseFilter > ArabicNormalizationFilter > PersianNormalizationFilter > StopFilter.
fr.FrenchAnalyzer StandardTokenizer > StandardFilter > StopFilter (custom stop table) > FrenchStemFilter > LowerCaseFilter.
miscellaneous.* Collection of miscellaneous TokenStreams and TokenFilters.
ngram.* Breaks characters of a single word into a series of character ngrams. This can be useful for spell correction and live autocompletion.
nl.DutchAnalyzer StandardTokenizer > StandardFilter > StopFilter (custom stop table)> DutchStemFilter.
ru.RussianAnalyzer RussianLetterTokenizer > RussianLowerCaseFilter > StopFilter (custom stop list) > RussianStemFilter.
th.ThaiAnalyzer StandardFilter > ThaiWordFilter > StopFilter (English stop words).
analysis.WikipediaTokenizer Similar to StandardTokenizer, except it adds further specialization to process the Wikipedia-specific markup that appears in the XML export of the Wikipedia corpus. This produces additional Wikipedia-specific token types.
shingle.* Tokenizers that create shingles (ngrams from multiple tokens) from another TokenStream.
sinks.DateRecognizerSinkTokenizer A SinkTokenizer (see section 4.2.3) that only accepts tokens that are valid dates (using java.text.DateFormat).
sinks.TokenRangeSinkTokenizer A SinkTokenizer (see section 4.2.3) that only accepts tokens within a certain range.
sinks.TokenTypeSinkTokenizer A SinkTokenizer (see section 4.2.3) that only accepts tokens of a specific type as returned by Token.type().
payloads.* TokenFilters that carry over token attributes as payloads; these are described in section 6.5.
position.PositionFilter Filter to set the position increment for all tokens.
query.QueryAutoStopWordAnalyzer An analyzer that adds a StopFilter to any other analyzer.
snowball.SnowballAnalyzer StandardTokenizer > StandardFilter > LowerCaseFilter [> StopFilter ] > SnowballFilter
ReverseStringFilter Reverses the text of each token that passes through it. For example, country becomes yrtnuoc. This is useful for doing efficient leading wildcard searches.