Repository navigation
s2t: add STPhrases MaxMatch fixes from issue #886 - #1453
Closed
stantheman0128 wants to merge 1 commit into
Closed
stantheman0128 wants to merge 1 commit into
stantheman0128 wants to merge 1 commit into
Conversation
Longer phrases for dried foods, after-compounds, history vs calendar, gan/visa/tow/system cases, without changing MoE 干云蔽日. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Closes #886.
Problem
Issue #886 and its comments list many STPhrases gaps where shorter MaxMatch entries win over the intended reading. Examples on current packaged dictionaries:
Issue body also proposed
干云蔽日 -> 乾雲蔽日. The cited MoE entry (ID 69701) and the 《後漢書》 quote both use 干雲蔽日, and OpenCC already maps干云蔽日 -> 干雲蔽日. This PR leaves that entry unchanged.Change
Add longer / clearer STPhrases entries for the reproducible cases above (dried foods, after-compounds, history vs calendar, gan/visa/tow/system/sea/name), plus controls so 影后 / 武后 / 球后 / 封后 / 天干 / 干将莫邪 / 年历 / 裁制 stay as they are.
Dictionary sorted with
python data/scripts/sort.py data/dictionary/STPhrases.txt.Test plan
BYVoid_OpenCC_Issue_886_*intest/testcases/testcases.jsonEvidence
Repro before (packaged wheel dictionaries):
After this branch (config JSONs with ocd2 refs switched to text, driving
data/dictionary/*.txton the branch):New
#886cases: 9/9 pass under s2t / s2tw / s2twp / s2hk.A/B of existing
s2texpectations intestcases.json(branch STPhrases vs expectations, excluding the new #886 cases): 93/93 same, 0 diffs.sort.pyidempotence onSTPhrases.txt: no diff.Please treat CI Bazel tests as authoritative; no local C++/Bazel toolchain was available here.
AI assistance
This fix was developed with AI assistance (Cursor / Grok) and verified locally as shown above.