Unicode-aware tokenizer for the search pipeline.
Splits text into individual tokens using Unicode word boundary rules. Handles:
- Mixed scripts (Latin, CJK, etc.)
- Punctuation stripping
- Contiguous alphanumeric sequences as single tokens
- Emoji filtering
Uses regex patterns that respect Unicode category properties rather than simple whitespace splitting.
Summary
Functions
Tokenizes a text string into a list of word tokens.
Tokenizes text and returns tokens longer than the minimum length.
Tokenizes multiple text fields, returning a flat list of all tokens.
Functions
Tokenizes a text string into a list of word tokens.
Examples
iex> Tokenizer.tokenize("Learning Elixir Phoenix Framework")
["Learning", "Elixir", "Phoenix", "Framework"]
iex> Tokenizer.tokenize("Phoenix,Framework!测试")
["Phoenix", "Framework", "测试"]
iex> Tokenizer.tokenize("hello_world test-case")
["hello_world", "test", "case"]
Tokenizes text and returns tokens longer than the minimum length.
Tokenizes multiple text fields, returning a flat list of all tokens.