Skip to content

feat(tokenizers): add experimental Korean tokenizer#1018

Open
dayongkr wants to merge 1 commit into
oramasearch:mainfrom
dayongkr:add-korean-tokenizer
Open

feat(tokenizers): add experimental Korean tokenizer#1018
dayongkr wants to merge 1 commit into
oramasearch:mainfrom
dayongkr:add-korean-tokenizer

Conversation

@dayongkr

@dayongkr dayongkr commented Feb 16, 2026

Copy link
Copy Markdown

Why add Korean support?

@orama/tokenizers currently supports experimental CJK tokenizers for Japanese and
Mandarin, but not Korean.
This makes Korean text search inconsistent compared to other CJK languages.

Adding a Korean tokenizer:

  • enables proper Korean word segmentation for indexing/search
  • keeps language support more consistent across CJK
  • provides an official import path for Korean users (@orama/tokenizers/korean)

What changed

New tokenizer

  • Added packages/tokenizers/src/korean.ts
    • Implements Korean tokenization using Intl.Segmenter("ko", { granularity: "word" })
    • Follows the same structure and behavior as existing Japanese/Mandarin tokenizers

Exports and package wiring

  • Updated packages/tokenizers/src/index.ts
    • Added korean tokenizer export
  • Updated packages/tokenizers/package.json
    • Added ./korean export entries (ESM/CJS types + runtime files)
    • Included Korean test in the package test script
    • Added korean keyword

Tests

  • Added packages/tokenizers/tests/korean.test.ts
    • Validates Korean tokenization/search behavior with Korean city and university names
    • Keeps style aligned with existing Japanese/Mandarin tokenizer tests

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