Skip to content

Fix BERT normalization of CJK Extension E boundary characters - #2395

Open
mottopanikeiku wants to merge 1 commit into
huggingface:mainfrom
mottopanikeiku:fix/bert-cjk-extension-e
Open

mottopanikeiku wants to merge 1 commit into
huggingface:mainfrom
mottopanikeiku:fix/bert-cjk-extension-e

Conversation

@mottopanikeiku

@mottopanikeiku mottopanikeiku commented Sep 8, 2026

Copy link
Copy Markdown

Summary

I've corrected BERT's CJK Extension E lower bound from U+2B920 to U+2B820, matching original BERT and Unicode's block definition.

The typo skips 256 ideographs. For example, a\U0002B820b becomes one [UNK] instead of preserving the known neighboring a and b tokens. The regression covers both ends of the omitted interval and keeps the existing common-Chinese case.

Tests

  • Python bindings: 204 passed, 3 skipped, 11 warnings.
  • Rust core: 255 passed, 3 ignored; Rust bindings: 20 passed.
  • Core lint and Python style checks passed. Unrelated generated-stub changes were discarded; final Ruff/format/ty checks passed.
  • Additional checks covered offsets, default options and handle_chinese_chars=False.

Tested on Linux. Other platforms and Node bindings were not tested.

I used AI for this patch; this has been manually reviewed.

Correct the lower bound to U+2B820 and cover the omitted interval
endpoints through the public Python normalizer.

AI assistance was used. The submitting account owner confirmed review
of this exact patch: this has been manually reviewed.
@mottopanikeiku
mottopanikeiku marked this pull request as ready for review September 9, 2026 00:08
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