[codex] Fix Chinese name order and splitting#14
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
增友 叶.Junjie Fang-style outputs without splitting ambiguous one-anchor tokens such asYuxuanor protected compound-surname variants.Root Cause
The parser was collapsing whitespace-separated all-Han groups into character-level tokens before deciding order, so
增友 叶lost the original given/surname boundary. Separately, two-token romanized names could be flipped even when the second token was overwhelmingly more likely to be the surname. Finally, the fused-token splitter had a broad surname early-exit, so valid given-name splits likeJun+Jiewere skipped when the full token also appeared as a surname form.Validation
uv run --no-sync --python 3.12 pytest -q tests/test_regression_proposals.py::test_given_context_gold_split_bypasses_surname_guard tests/test_regression_proposals.py::test_given_context_gold_split_keeps_ambiguous_non_gold_tokens_unsplit tests/test_regression_proposals.py::test_guarded_low_frequency_surname_ratio_preserves_given_first_order tests/test_regression_proposals.py::test_guarded_low_frequency_surname_ratio_keeps_compound_and_common_surname_boundaries tests/test_regression_proposals.py::test_spaced_all_chinese_given_first_preserves_group_boundaryuv run --no-sync --python 3.12 python scripts/check_test_status.pySpecial status script result: 44 individual test-case failures, performance tests passed. This improves from the previous expected baseline of 52 failures.