Repository navigation
Add a conventions corpus: invented names for naming traditions the corpora miss - #691
Merged
Merged
Conversation
Our corpora cover Western and CJK names well and have almost none from traditions with no family name, religious names, positional patronymics or honorifics written after the name (#686). conventions.py is a hand-written table of 35 invented names patterned on documented conventions, each with its tradition, the convention it exercises, and the reading a reader would expect; build_conventions_corpus.py writes corpus_conventions.jsonl from it, a non-default order as its shapes.py id, and test_corpora.py pins the file to the table. The expectation is a note, not a pin. Derek chose no fields file: many expectations need fields the model lacks (a patronymic, no family name), and the agreement scorer reads an unstated part as an empty role. The snapshot gains 35 names, none moved; all 35 readings match the ones the issue measured on 1a4e8a1. The snapshot check reads 4,941 entries in about 2s, so the issue's runtime question is moot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #691 +/- ##
=======================================
Coverage 99.03% 99.03%
=======================================
Files 46 46
Lines 4541 4541
=======================================
Hits 4497 4497
Misses 44 44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Review of #691: the scorer already handles a patronymic (PENDING_ROLES) and expects an empty family where none is stated, so neither example showed what a fields file could not say. The ones that do are a father's or grandfather's name, an honorific that is not a title and a married form, and some expectations are undecided. The order docstring now names the two orders a shape declares; Kaur is traditional, not universal; Tran Thi Mai's note says Mai is a suffix acronym under either order. The builder loads conventions.py and shapes.py by path, as snapshot.load_shapes does, instead of putting tools/differential/ on sys.path for the rest of a test run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73
added a commit
that referenced
this pull request
Oct 17, 2026
* State the conventions corpus's parts, and score them like CLDR's Follow-up to #686 (#691). 30 of conventions.py's 35 rows now carry `fields` in CLDR's vocabulary, drawn from the UK naming-practices guide and Cultural Atlas research the rows were written from; build_conventions_corpus.py writes them to conventions_fields.jsonl and cldr_agreement.py scores them as a fourth source, recorded in conventions_agreement.json: 5 of 30 agree in every role. Derek's calls: a word of address written after the name (Bey, ssi, san) is a new `honorific` field scored inside `suffix`, as nameparser reads さん; Kaur is given2, Péterné the given name, H. Budi Santoso a title and one personal name, Ma.'s Cruz a surname2 and Vda. de Mora part of the surname. Five rows stay unstated, since a stated field reads an unstated part as an empty role: the kunya, the glued -san, Szabóné's married form, and arap/ole, patronymic or family name by family. The fields file is therefore a subset of its corpus, which test_cldr_agreement now allows for this source alone. The other sources' records do not move; the corpus file is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Guard the hand-written fields: unknown names raise, fields partition the text Review of #692: - A field name no rule reads now raises in expected_roles, for every source: a mistyped honorfic was expected in no role and passed as agreement. CLDR's locale and given-informal are the only names skipped on purpose (KNOWN_FIELDS, IGNORED_FIELDS). - test_the_fields_partition_their_rendering: every word of a non-CLDR rendering is stated by exactly one field, so a left-out part fails. GND, Wikidata and conventions already held it. - Each conventions row carries fields or an unstated reason, and the builder refuses neither or both, so a row's fields cannot drop unseen behind the subset check. - _PARSERS gains shape 5, so a FAMILY_FIRST_GIVEN_LAST row no longer crashes the scorer. - Suzuki-san is stated after all: unspaced text matches by substring, so surname Suzuki + honorific -san partition it. My earlier reason for leaving it out was wrong. 26 of 31 rows now disagree. - Stale docstrings (two sources named of four), the ur note (a word of address, as its fields say), and the record of where today's reading lives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Leave wa unstated beside arap and ole Derek's call: the research groups the three as declining Kenyan parent-name markers whose last word may now be a family name, and its wa example names a mother, so wa is no surer a patronymic than the others. Its row stays in the corpus; 30 rows are stated, 25 disagree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 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 #686.
What.
tools/differential/conventions.pyis a hand-written table of the 35 rows from #686 (body and comment). Each row records the tradition, the convention it exercises, the name, itsname_order, and what a reader who knows the convention would expect.build_conventions_corpus.pywritescorpus_conventions.jsonlfrom the table, giving a non-default order itsshapes.pyid (looked up by order, so a misspelled order fails the build).test_corpora.pypins the file to the table. The README's corpus roster and provenance sections gain the file.The issue's open questions.
H. Budi Santoso), and a fields file must state every part, sincecldr_agreement.pyreads an unstated one as an empty role. A row whose reading is settled can graduate totests/v2/cases.py.Measured. The snapshot gains 35 names and moves none. All 35 recorded readings match the "Today" column the issue measured on
1a4e8a10; no parser commits land between that and this branch's base. Today's reading is deliberately not copied into the table, sincesnapshot.jsonlalready holds it. The new pin fails when a corpus line is dropped and passes once the corpus is regenerated. Full suite: 19,313 passed; mypy and ruff clean.Review round (code, comments, tests;
9d3ee1ed). No bugs found. Fixed: the fields-file reasoning cited a patronymic and a missing family name, which the scorer already handles; theorderdocstring now names the two orders a shape declares; the Kaur note no longer says "every"; the builder loads its siblings by path instead of editingsys.path.Tran Thi Maistays underFAMILY_FIRSTas the issue listed it, and its note now saysMaiis a suffix acronym, which reads as a suffix underFAMILY_FIRST_GIVEN_LASTtoo, so a second row under that order would show nothing new.🤖 Generated with Claude Code