Skip to content

feat(indexes): add configurable Bigram/Trigram tokenizer for CJK search - #37

Open
harehare wants to merge 1 commit into
mainfrom
feat/configurable-tokenizer
Open

feat(indexes): add configurable Bigram/Trigram tokenizer for CJK search#37
harehare wants to merge 1 commit into
mainfrom
feat/configurable-tokenizer

Conversation

@harehare

@harehare harehare commented Sep 9, 2026

Copy link
Copy Markdown
Owner

The Word tokenizer lumps a punctuation-free CJK run (e.g. Japanese text) into a single token, so match()/score()/bm25() were effectively unusable on Japanese content. Add TokenizerKind::{Word,Bigram,Trigram}, fixed per store at creation time and persisted in the catalog (additive trailing section, no file-format bump), with Bigram/Trigram splitting CJK runs into overlapping n-grams while leaving ASCII word tokenization unchanged.

Exposed via mq-db index --tokenizer <word|bigram|trigram>.

The Word tokenizer lumps a punctuation-free CJK run (e.g. Japanese text)
into a single token, so match()/score()/bm25() were effectively unusable
on Japanese content. Add TokenizerKind::{Word,Bigram,Trigram}, fixed per
store at creation time and persisted in the catalog (additive trailing
section, no file-format bump), with Bigram/Trigram splitting CJK runs
into overlapping n-grams while leaving ASCII word tokenization unchanged.

Exposed via `mq-db index --tokenizer <word|bigram|trigram>`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant