Repository navigation
Replace Unihan with Wikidata for locales.ZH's simplified forms and the suggester's pinyin - #1371
Merged
Merged
Conversation
The licence expression read LGPL-2.1-or-later alone while the wheel ships data under five other licences. It now reads LGPL-2.1-or-later AND Apache-2.0 AND GFDL-1.2-no-invariants-or-later AND CC-BY-4.0 AND OGDL-Taiwan-1.0 AND Unicode-3.0. - LICENSE-nam_dict: nam_dict's notices and the GFDL 1.2 text, which its terms ask to travel with the familiar forms and the suggester's common given names and which no file in the tree held. - LICENSE-unicode: the Unicode License v3 notice for the Unihan data, in locales/zh.py's simplified surname forms since 2.5.0 and in the suggester's pinyin surnames; zh.py's docstring now credits it. - README.rst's License section lists every source. - tests/v2/test_licensing.py holds the licence files, license-files, the expression, the README and the crediting modules together. - decisions/shipped-data-licences records the sources, what each licence asks and how it is met; AGENTS.md says what a new source needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Data the project derives by measuring is its own, its sources credited as a courtesy; a curated list copied whole keeps its licence. Under that rule nam_dict's familiar-form pairs are dropped before 3.1 and rebuilt from CC0 data reviewed by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in surnames locales.ZH's simplified surname forms now come from the simplified- Chinese labels of Wikidata's family-name items, and the group suggester's pinyin surnames from those items' Hanyu Pinyin statements, both CC0, so the package ships no Unihan-derived data and Unicode-3.0 and LICENSE-unicode leave its licence metadata. Seven simplified forms no Wikidata item attests (买厐盖篮芈诸谌) leave locales.ZH; over 322,895 corpus names holding a Han character, 9 move, all foreign names the pack had cut after 盖. The pinyin block holds the surname readings (曾 zeng, 单 shan) where Unihan's first reading gave ceng and dan; suggest_measure moved 37 cells, no quoted figure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the review's doc findings Both tools reused a cached answer whenever it covered the forms asked, whatever the query; each now reuses only the answer to the exact queries it writes, asks in batches of 100 (the whole set outran the service's time limit), and refuses an answer holding a row that is not one, which is how the service's error text reads when it cuts a CSV answer short. A form an item writes the same in both scripts now counts as its own simplified form, as Unihan's table listed it, so it leaves the form two candidates; the shipped blocks do not move. The group-suggestion entry counted listing lines, not cells (59 moved, 54 up, 5 down), left out `an` and named two anti-goal rows of three; the #695 and TABLES entries get head notes, AGENTS.md says Unihan has left, and the release-log bullet says what 2.5.0-3.0.1 declared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… batch be empty The order_names tests patched tool.name_usage, but ask() calls the name_usage zh_surnames holds, which another test module's loader can make a different object, sending the tests to Wikidata; they now patch that copy and refuse the network. The pinyin cache test now asks a subset of what it cached, the case the parent answered from the cache, and a changed pinyin query. A batch of 100 items may hold none with a reading, so an empty pinyin batch is an answer. W1's Open line records that #981's mainland ranking would restore the seven dropped forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from
fix/licence-metadata-familiar-data
to
master
November 13, 2026 05:53
…with-wikidata # Conflicts: # AGENTS.md # README.rst # docs/design/decisions/shipped-data-licences.md # docs/release_log.rst # nameparser/locales/zh.py # pyproject.toml # tests/v2/test_licensing.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…with-wikidata # Conflicts: # README.rst # docs/design/decisions/shipped-data-licences.md
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.
Based on master since #1370 merged (master merged in; the tree is unchanged from the reviewed commits).
What
No shipped data derives from Unihan any more, so
Unicode-3.0leaves the licence expression andLICENSE-unicodeleaves the tree. This settles the Open item in #1370's FACTS WE MEASURE entry forUnicode-3.0. It does not settle #981 (a mainland-weighted third ranking). W1's Open line now notes that such a ranking would restore the 7 dropped forms.locales.ZH's simplified surname forms (tools/zh_surnames.py): a ranked traditional form gains the one simplified form given by the simplified-Chinese labels (zh-hans,zh-cn,zh-sg,zh-my) of the Wikidata items labelled with it (CC0). The items are every family name (Q101352) and every Chinese family name (Q1093580): 關, 顏 and 遲 have items of the first class only. It is the rule Unihan's variant table was read by: exactly one form, in the BMP, and not the form itself.tools/vocab/order_names.py): every Hanyu Pinyin reading that Wikidata's family-name items state for eachlocales.ZHsingle-character surname, read from three statements. They are P2440 qualified by P459 = Hanyu Pinyin (Q42222), the P1721 qualifier of P1705, and the P1705 of the Latin-script item that P460 names under P1013 = Q42222. A surname with no reading is left out, and the run names it: 35 of 463.Moves
locales.ZH. The block holds 317 forms, down from 324. 12 of the 19 forms only Unihan supplied are attested by Wikidata: 东云兰关区娄盘练迟阙颜风. The other 7 are not, and they leave: 买厐盖篮芈诸谌.config_diff.py diff --committed --local all --match '[一-鿿㐀-䶿]' --readings <file> default plain:ZH, run in each tree, with the files compared line by line.盖尔哈尔德(Gerhard) and盖达尔 阿利耶夫(Heydar Aliyev). The pack used to cut them after 盖; now they read as the default does.谌龙(Chen Long) now reads undivided, as family谌龙. Written in traditional characters (諶龍), the name still divides.cldr_agreement.py: no record moved, the CLDR and Wikidata-native locale views included.Pinyin. The block holds 200 spellings, down from 206.
zeng,shan,zha,zhai,bu,nian. These are the surname readings of 曾, 单, 查, 翟, 卜, 粘, where Unihan's firstkMandarinreading gaveceng,dan,cha,di,bo,zhan.an,bing,bo,ceng,cha,chou,dan,diao,jie,kou,nong,que.anstays in the table through the Korean list.Suggester.
suggest_measure.py --base <e9cb3520>:Parser.suggest, docs/suggest.rst and decisions/group-suggestion stand.Docs
_order_names.py's provenance, and a release-log bullet.Checks
uv run pytest: 46,827 passed, 38 skipped, 3 xfailed.uv run pytest -n0 -m serial: 38 passed.uv run mypyanduv run ruff check: clean.Reviews
anmissing, three anti-goal rows written as two, superseded entries without head notes, and AGENTS.md. All fixed.name_usageother than the oneaskcalls (in one collection order they reached the network), and that the pinyin cache test passed on the parent code. It also found that an empty pinyin batch was refused. All fixed in the third commit.🤖 Generated with Claude Code