Repository navigation
Add Chinese and Japanese credential and office words as suffixes (#671) - #708
Merged
Merged
Conversation
Adds 議員, 国会議員, 太平紳士, 医学博士, 二世 and the job titles 社長/部長/課長 (with variant spellings) to SUFFIX_WORDS, so they read as suffixes when spaced or after a comma instead of reversing the name or joining the given name. None joins GLUED_HONORIFICS: the glued bar was not measured against real names, and 部長 fails it outright (阿部長). Amends rules.md S2/W2, adds the decisions.md entry, release-log bullet, case rows, and re-records the snapshot and agreement records. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #708 +/- ##
=======================================
Coverage 99.03% 99.03%
=======================================
Files 46 46
Lines 4541 4552 +11
=======================================
+ Hits 4497 4508 +11
Misses 44 44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fix the release-log span (2.1, the first release with locales.ZH), drop the 'reversed the name' claim, say the Chinese pack's surname split exposes the words after a listed surname, move the tolerated comma example out of S2, fix stale case notes and comments, and add a row for 李部長. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
One parametrized test over all twelve words covers the spelling variants and the comma shapes (one-word and empty head) the rows missed, and a second asserts none is a glued honorific; adding two of them to GLUED_HONORIFICS fails it where six of the twelve passed the suite. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ential words Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.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 #671.
What changes
Adds the Chinese and Japanese credential, office and generational words to
SUFFIX_WORDS: 議員/议员, 国会議員/國會議員, 太平紳士/太平绅士, 医学博士/醫學博士, 二世, and the job titles 社長/部長/課長 with their simplified forms 社长/部长/课长. They read as suffixes when spaced or after a comma.ジュニア was already shipped by #661.
Scope decision
None of the words joins
GLUED_HONORIFICS. The glued bar (#308: can the word never end a name?) needs real-name counts I could not get (the Wikidata suffix query timed out; the native-script corpus holds none of these words), and 部長 fails it on argument alone (阿部長). Glued vetting, and aname_usagethat can answer it for CJK words, is #707.The Han segmenter is not a peel and still exposes the words after a listed surname under
locales.ZH:王二世reads family 王, suffix 二世 and李部長family 李, suffix 部長, as王博士already does. Recorded as Accepted in rules.md W2.陳怡君二世and田中社長are unchanged.Review
Three review agents (code, tests, comments/docs) ran; their findings are fixed in
4eda2f10(release-log span is 2.1 through 2.4.2, the tolerated comma example moved out of S2, stale notes, a row for李部長) andccef3d5b(a parametrized test over every word: suffix when spaced and after a comma, including one-word and empty heads, and none a glued honorific; adding two of them toGLUED_HONORIFICSfails it where six of twelve passed the suite before).4fa21e8dadds the simplified job titles and a usage.rst note.Verification
ruff,mypyand thesphinxdoctests pass; the suite also passes with thejaextra installed and uninstalled.corpus_cldr.jsonlrenderings; the CLDR agreement record moved 12 entries in the ZH view, in the expected direction.🤖 Generated with Claude Code