Skip to content

fix: account for CJK text in estimator - #31

Merged
royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
Rayan-and-beyond:fix/26-cjk-estimator
Sep 16, 2026
Merged

royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
Rayan-and-beyond:fix/26-cjk-estimator

Conversation

@Rayan-and-beyond

Copy link
Copy Markdown
Contributor

Fixes #26

Count CJK characters at roughly one token each while retaining the existing chars/word heuristic for other text.

Validation:

  • fail-first 200-character CJK regression reproduced 50 vs reference 200
  • node --test test/basic.test.mjs: 17 passed
  • npm test: 25 passed
  • git diff --check

@royalpinto007
royalpinto007 merged commit 9de2fba into AgentPostmortem:main Sep 16, 2026
1 check passed
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.

Estimator structurally undercounts CJK/no-space scripts

2 participants