Repository navigation
Read a salutation ending the given part after a family comma as the title (#835) - #876
Merged
Merged
Conversation
…itle (#835) `Doe, Jane Mrs` reads title 'Mrs', given 'Jane', where 1.4.0 through 2.5.0 gave middle 'Mrs'. After a family comma the surname is fixed, so the only reading a bare salutation there competes with is a middle name, and a salutation is a form of address rather than something a person is named after (rules/H8). A new behavioral title property, `after_given`, allowed on a salutation reading only, compiles into AFTER_GIVEN_TITLES and Lexicon.after_given_titles. Salutations borne as given names or surnames are excluded with their counts (goodman, herr, master, ...). H5's trailing title chain admits a flagged bare word in the given part after a family comma, and the group-side predictors of that part do too, so a bare salutation reads exactly as its period-marked twin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review found the docs this change made stale and three gaps in the vetting. - Vetting: exclude बाबू (romanized Babu, a US surname and an element of Indian given names), fru and frú (a Cameroonian surname); record the kept words' counts on the words; state the romanization criterion in decisions/H8. - rules/H8: widen When to the empty head and doubled stops (`Mr..`), and add Accepted clauses for the empty head and for the comma-less writing under a declared family-first order, which keeps the salutation a name word (738 of 738 pairs agreed on master, none now). - Stale text: H5, P5 and the H Background said the given-part predictors read the part "as the comma-less name reads it"; decisions/H5's Standing and its #316 head, vocabulary-exclusions, and four places in AGENTS.md now name the H8 exception. - A shim test pinning the v1 knob (deleting the title), with its negative control; the release note names Parser pickles too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rules/H8: the period-marked `, Jane Mrs.` has read Jane as the family since 2.3.0 (H5), not always (1.4.0 through 2.2.0 gave first 'Jane'); the Signal line and the spelling clause match the widened When. - gospodin's nam_dict given-name band is recorded on the word, and decisions/H8 says why it is kept. - "the comma having fixed the surname" now reads "marked the surname's place", which holds for the empty head too. - The shim test's comment says what pins what: classify holds the parse, the set assertion holds the intersection. 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 #876 +/- ##
=======================================
Coverage 99.07% 99.07%
=======================================
Files 47 47
Lines 4779 4781 +2
=======================================
+ Hits 4735 4737 +2
Misses 44 44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing-salutation # Conflicts: # tests/v2/test_cases.py # tools/differential/corpus_rules.jsonl # tools/differential/snapshot.jsonl
Tests for what three mutations showed the suite could not see: - Lexicon.after_given_titles' API (add, remove, |, normalization, the bare-str TypeError, pickle, repr) and rules/H8's off switch; - the orphan contract classify's `n in lex.titles` guard holds, for an entry removed from titles and one added to the marker only; - a bare-vs-period-marked parity sweep over family-comma heads, given parts and tails under all three orders (2,112 pairs, ~0.5s), which fails on 192 pairs if the salutation flag stops reaching tail_reading's second chain pass, plus the case row 'Doe, abdul Mr Jr Mrs'; - every shipped after_given title reaching H8 at its slot. Comments: the after_given_titles field doc moved off capitalization_exceptions' comments; trailing_titles' docstring, the build's invariant list and its error message, the _group comment, the release-log bullet (period-marked spelling read as the title only since 2.3.0), an undated count in a case note, and AGENTS.md's "always" in the period-abbreviation Gotcha (1.4.0 through 2.2.0 read `Doe, Jane Mrs.` middle). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Date the parity sweep's measurement 2026-10-24, the day it was taken. - The build's after_given refusal reads "allowed on a salutation reading only, not on 'nobility'", fixing the article. - Type the sweep's helper with ParsedName instead of two type ignores, and re-wrap its docstring. - Pin at parse level that a period-marked after_given entry matches the bare word, as the test's comment says. 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 #835.
Doe, Jane Mrsnow gives titleMrs, givenJane, familyDoe, where 1.4.0 through 2.5.0 gave middleMrs(all three wheels checked). It already read that way writtenDoe, Jane Mrs., and so didDoe, John Jr Mr. The FEC's donor file writesFAMILY, GIVEN MIDDLE SALUTATIONand often leaves the period off.The rule: H8, a salutation ending the given part
After a family comma, the surname's place is marked. A bare word ending the given part can then only be a middle name or a title. A salutation is a form of address, not something a person is named after. So a listed salutation there joins H5's trailing title chain, as a period-marked title already does. One consequence: the bare and period-marked spellings read alike in every comma shape and under every name order. That covers the empty head, the nickname head, particle and connective surnames, second commas, suffixes and other titles.
Doe, John King,Doe, Jane Dr), title/suffix duals (Doe, Jane Ms), and the comma-less writing, which stays H5's (Jane Doe Mrskeeps familyMrs).Doe, Jane Miss)., Jane Mrs).Doe Jane Mrskeeps middleMrs. So the family-comma invariant in decisions/two-input-invariants no longer holds for trailing salutations: 738 of 738 pairs agreed on master, none now.Vocabulary
There's a new behavioral title property,
after_given = true. A build check allows it onsalutationreadings only. It compiles intoAFTER_GIVEN_TITLESand a newLexicon.after_given_titles. It has no v1Constantsattribute; the shim intersects it withtitles.88 salutations carry the flag. A middle name may be a given name or a surname, so a salutation borne as either is excluded, with its counts recorded on the word:
A non-Latin word is weighed by its romanization only where its bearers write that script. The line at roughly 200 US bearers is a judgment call. decisions/H8 has the counts and the reasoning.
Parser
trailing_titles(andtail_reading) take asalutationsflag that admits a word taggedvocab:after-given-titleby classify.trailing_run_start) and the bound given-name join's decline. All three therefore read the part the same way.Measured (decisions/H8 records each with its recipe)
fec-individuals: 12,381 of 1,893,964 names move: MR 9,339, MRS 1,908, MISS 1,108, MR.. 24, plus 2 joining a title already there. 385 of them drop aCONJUNCTION_OR_INITIALreport, since the letter no longer has a name word behind it.ukec-individuals: no moves.IorVis left at the end of the given part and reads as a generational suffix (DOE, JANE I MRS).DOE, JANE IandDOE, JANE I MRS.already read that way on master, under Issues with names in the format Last, First Middle Suffix where Suffix is I #144's rule for a trailing letter after a family comma.Compatibility
A
LexiconorParserpickled by an earlier release no longer loads (ValueErrornaming the missing field), as happened in 2.1 and 2.3. The release log says so.Review
Three review rounds, each fixed in its own commit:
बाबू,fru), the unrecorded family-first disagreement, an empty-head row outside H8's When, and small count errors. Round two, on the fix commit, found five, including a false "has always read it" (true only since 2.3.0).Lexiconfield's API, the classify guard, and the flag's hand-off totail_reading's second chain pass. Each now fails a test when broken (a field/API and off-switch test, an orphan test, and a bare-vs-period-marked parity sweep over 2,112 pairs). Eight comment items were fixed, and a final review of that fix commit tidied five more.AGENTS.md gains one lesson: vet a non-Latin word by its romanization. The lone
I/Vthis change leaves ending the given part (59 FEC names) is filed as #877.Checks
uv run pytest: 24,212 passed.-m serial: 39 passed.tools/vocab/build.py --checkreports the compiled vocabulary current.rules_budget.json(H8 is new, H5 and P5 grew),corpus_rules.jsonl,snapshot.jsonl, and the field-sweep claim count (1,400 on master → 1,403).🤖 Generated with Claude Code