fix: split CJK from Latin regex tokens - #479
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
|
Your branch is 3 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
|
Friendly follow-up: CI is green (unit + plugin + ollama integration). Happy to address any review feedback or rebase if needed. |
|
Your branch is 1 commits behind git fetch origin main
git merge origin/main
git pushNote: Enable "Allow edits by maintainers" to allow automatic updates. |
Description
The default regex tokenizer merged CJK characters with adjacent Latin words into a single token, producing token boundaries that did not align with the source character intervals. This change splits CJK runs from Latin runs so each is emitted as its own word token while preserving exact source-character offsets.
Fixes #334
Bug fix
How Has This Been Tested?
Also ran
python -m pytest -q. Collection is blocked in this local environment becausegoogle.genaiis not importable for the Gemini provider tests (tests/annotation_test.py,tests/gemini_retry_test.py,tests/inference_test.py,tests/provider_schema_test.py); those are unrelated to this change.Checklist:
pylintover the affected code.