Expand description
Zero-unsafe multilingual morphological expander and query normalizer (lexf).
Designed to pair with mcut in CutMode::Search for PostgreSQL-compatible
full-text indexing and querying: every token expands to its lowercased canonical
surface form plus algorithmic morphological roots/variants (for example "Cuting"
-> ["cuting", "cut", "cute"], "Cutting" -> ["cutting", "cut"],
"數據庫" -> ["數據庫", "数据库"], "1,000.50" -> ["1,000.50", "1000.50", "1000.5"]).
Structs§
- LexConfig
- Morphological expansion configuration.
- Scratch
- Reusable working buffers eliminating per-token heap churn on hot paths.
Enums§
- Lang
Hint - Language hint used by
lexfto select morphological and query-folding rules. - Mode
- Expansion depth applied to each token.
Constants§
- DEFAULT_
MAX_ FORM - Maximum number of morphological variants emitted for a single token by default.
Functions§
- detect_
lang - Detects the dominant script or European language of arbitrary input text.
- expand
- Convenience allocating wrapper around
expand_each. - expand_
each - Expands one segmented token into
0..=cfg.max_formdistinct normalized (and stemmed) forms.