Expand description
Tokenizer API for text processing
Modules§
- light_
stem - Light (inflection-only) stemmers.
Structs§
- HfTokenizer
- Cached HuggingFace tokenizer
- IdfWeights
- Pre-computed IDF weights indexed by token_id
- IdfWeights
Cache - Global cache for IDF weights, keyed by model name. Caches both successful loads and failures to avoid repeated download attempts.
- Language
Aware Tokenizer - Language-aware tokenizer that can be configured per-field
- LexOptions
- Options of a
LexTokenizer; the parsed and rendered form of alex(...)spec. Only values that differ from the defaults are rendered. - LexTokenizer
- The tokenizer of a
lex(...)field (module docs). - Multi
Language Stemmer - Multi-language stemmer that can select language dynamically
- RawCi
Tokenizer - Raw case-insensitive tokenizer — lowercases the entire input without splitting.
- RawTokenizer
- Raw tokenizer — no tokenization at all.
- Simple
Tokenizer - Simple tokenizer — splits on whitespace, strips non-alphanumeric, and lowercases.
- Stemmer
Tokenizer - Stemming tokenizer - splits on whitespace, lowercases, and applies stemming
- Stop
Word Tokenizer - Stop word filter tokenizer - wraps another tokenizer and filters out stop words
- Token
- A token produced by tokenization
- Tokenizer
Cache - Global tokenizer cache for reuse across queries
- Tokenizer
Registry - Registry for named tokenizers
- Unicode
Word Tokenizer - Unicode word boundaries followed by lowercase, without lexical rewriting. Internal punctuation follows UAX #29. Overlong words retain a position gap.
Enums§
- CjkMode
- Japanese and Korean analysis.
- HanForm
- Treatment of Han characters.
- Language
- Supported stemmer languages
- Purpose
- What a tokenization is for.
- Script
- Writing system of a token, used to route it to a stemmer of the same script.
- Segmenter
- Word segmentation.
- Stem
Mode - Morphological normalisation.
- Tokenizer
Source - Tokenizer source - where to load the tokenizer from
- Tokenizer
Spec - Parsed form of a tokenizer name in the schema: a registered name
(
simple,en_stem, …) or alex(...)spec. The canonical string form is stored inFieldEntry::tokenizer.
Constants§
- DEFAULT_
MAX_ TOKEN_ LENGTH - Default
max_token_length: longer “words” are hashes, sequences and URLs, which no query types and which bloat the dictionary.
Traits§
- Tokenizer
- Trait for tokenizers
- Tokenizer
Clone
Functions§
- cjk_
dictionaries_ available - Whether the dictionaries are compiled in.
- idf_
weights_ cache - Get the global IDF weights cache
- language_
code - ISO 639-1 code of a stemmer language.
- parse_
language - Parse a language string into a Language enum
- parse_
language_ opt - Parse a language string into a Language, returning
Nonefor unknown values. - tokenizer_
cache - Get the global tokenizer cache
- warm_
up_ cjk_ dictionaries - Load the dictionaries now (a server calls this at start-up so the first Japanese or Korean request does not pay the decode).
Type Aliases§
- Boxed
Tokenizer - Boxed tokenizer for dynamic dispatch