Skip to content

Restore CONTROl_TOKENS_PATTERN, used by words-segmentation - #15

Merged
AmitMY merged 1 commit into
mainfrom
restore-control-pattern
Oct 10, 2026
Merged

AmitMY merged 1 commit into
mainfrom
restore-control-pattern

Conversation

@AmitMY

@AmitMY AmitMY commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Restore CONTROl_TOKENS_PATTERN, used by words-segmentation

#4 removed CONTROl_TOKENS_PATTERN from utf8_tokenizer.control as unused in this repo. But words-segmentation imports it (pretokenizer.py, languages.py), so with v0.8.3 import words_segmentation fails with an ImportError.

The constant is restored byte-identical to v0.8.2. A test now pins it as public API: it matches exactly the non-whitespace control characters.

It was the only top-level name removed between v0.8.2 and v0.8.3.

🤖 Generated with Claude Code

https://claude.ai/code/session_015Xm62qoeaTunFSU5GYCQ1f


Note

Low Risk
Backward-compatibility restore of a documented public constant plus a unit test; no runtime behavior change beyond fixing imports for dependents.

Overview
Re-adds CONTROl_TOKENS_PATTERN to utf8_tokenizer.control with the same value as v0.8.2 (\x01-\x08\x0e-\x1f\x7f), fixing ImportError for downstream words-segmentation after it was dropped in v0.8.3.

A new test treats the constant as public API and asserts its regex range matches all non-whitespace ASCII control characters (excluding tab, LF, VT, FF, CR, and space).

Reviewed by Cursor Bugbot for commit b8314e1. Bugbot is set up for automated code reviews on this repo. Configure here.

#4 removed it as unused here, but words-segmentation imports it: with 0.8.3, importing words_segmentation fails.
A test now keeps it as public API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Xm62qoeaTunFSU5GYCQ1f
@AmitMY
AmitMY merged commit 0f158b2 into main Oct 10, 2026
6 checks passed
@AmitMY
AmitMY deleted the restore-control-pattern branch October 10, 2026 08:28
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