Tokenizers
What are tokenizers ?
The part that separates
the text into the tokens that will be kept in the index is called the
tokenizer. Additionally, tokenizers deconstruct words into their most basic
forms. Often, a token is a single word, but you might want to create unusual
tokens such as:
- A full postal address.
- A complete URL or email address.
- Words based on the grammar of a specific language.
There are 13 different
tokenizers to choose from. These tokenizers include:
- classic-
This tokenizer processes text based on grammar for European languages.
- keyword-
This tokenizer emits the entire input as a single token. Use this tokenizer for
fields that should always be indexed as one value.
- lowercase- This
tokenizer divides text at non-letters and then modifies the resulting tokens to
all lower case.
- microsoft_language_tokenizer-
This tokenizer divides text based on the grammar of the language you specify.
- pattern-
This tokenizer divides texts where it matches a regular expression that you
specify.
- whitespace-
This tokenizer divides text wherever there's white space.
Token Filters
You may want to perform
additional processing, such eliminating stopwords or cutting punctuation, once
the tokenizer has separated the incoming text into tokens. This processing can
be carried out by designating a token filter. There are forty one different
token filters available, including:
- Language-specific filters,
such as arabic_normalization. These filters apply language-specific grammar
rules to ensure that forms of words are removed and replaced with roots.
- apostrophe-
This filter removes any apostrophe from a token and any characters after the apostrophe.
- classic-
This filter removes English possessives and dots from acronyms.
- keep-
This filter removes any token that doesn't include one or more words from a
list you specify.
- length-
This filter removes any token that is longer than your specified minimum or
shorter than your specified maximum.
- trim-
This filter removes any leading and trailing white space from tokens.
Conclusion
We have successfully
learnt about Tokenizers.
Comments
Post a Comment