Skip to content

Rework matching.rst for a reader linking two lists: an end-to-end recipe, a pair-to-setting index, one shape for every opt-in section - #1414

Merged
derek73 merged 4 commits into
masterfrom
docs/matching-recipe
Nov 16, 2026
Merged

derek73 merged 4 commits into
masterfrom
docs/matching-recipe

Conversation

@derek73

@derek73 derek73 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Reworks docs/matching.rst for a reader who has two lists of people to link and has never seen the feature. Docs only: docs/matching.rst is the one file changed. Every existing title and label is kept, so links from customize.rst, usage.rst, suggest.rst and modules.rst resolve as before.

What changed, by critique item

  1. End-to-end recipe: new "Linking two lists" (matching-recipe) closing "Checking a pair": two made-up lists, bucketed by keys(), the two sides of each bucket paired, pairs collected in a set (two writings of de la Cruz share two keys), each checked once. It pairs records by row number, not by name text, so two records written alike stay two; it holds a repeated record and a lone Suharto, which has no key and which the prose says the recipe never reaches. Its measured output shows 9 of 36 pairs checked, two of them sharing a key and not consistent. It pairs the two lists with itertools.product rather than combinations, since the reader is linking two files; one sentence gives combinations for duplicates inside one list.
  2. Pair-to-setting index at the head of "Accepting more": Your pair | Accept or switch | Cost | Section, eight rows. The last row uses the page's own conflict examples (Slvatore / Salvatore, Igor / Ihor) rather than Jon / John, which conflicts today but is the kind of pair the vocabulary could later list.
  3. "Accepting less" (matching-accepting-less): matcher.accept - {"initial"} with the default first, which default outcomes agree on the least text, that same is always accepted, that dropping a default outcome leaves the keys as they are, and weakest with Outcome.strength as a post-filter.
  4. "Consistency is not transitive" moved to directly after "Checking a pair" (new label matching-not-transitive). Its last doctest, which used a matcher defined much later, moved to the across-roles section, where that matcher is bound.
  5. The mechanism paragraph above the outcome table moved whole below it as "Which outcome a row reports" (matching-reported-outcome).
  6. given-one-side and hyphenated-part each have a section, linked from the outcome table (matching-given-one-side, matching-hyphenated-part). The reason given-one-side is off is the decisions record's (a bare surname key on every name). The record states no fuller reason for hyphenated-part than that it is one of the opt-ins that "lose letters or a role", so the page says only that it agrees with half of the given name missing, and that it adds no key.
  7. One shape for every opt-in section: when to accept it, what it reads, an example with the default first, why it is off, what it does to the keys. Sections now follow the index table's order. For across-roles and other_readings the record gives no reason beyond the default being the writing variants, so those two say that and no more.
  8. Provenance cut: "each read by two reviewers" and "each called a spelling of one name by both reviewers or by the maintainer, and read again against that test". One sentence on source and scale stays, with a pointer to docs/design/decisions/name-matching.md; what a plain and a strict choice keep is under "Which pairs a language choice keeps", with links to choosing-languages and strict-choice, and the sentence on a short name read as a title is with what familiar-form reads.
  9. "How large the groups get" under "Grouping by key": qualitative, with one doctest (Bill Smith: one key by default, six with every opt-in).
  10. The lone-name reader is linked to the other-readings section, the new given-one-side section and the section on names with no inherited family name.
  11. The 118-word initials sentence is a lead sentence and five conditions, each with its example, each run and checked against _capitals_spelled.
  12. "Store the names, not their keys" has its own heading and is a three-item list; the Lexicon import moved to where it is first used.

Skipped: none.

Claims found false on master

None. Two behaviours a reader could trip on are now stated, both true on master and unstated there: given-one-side alone does not reach a name written as one word (Smith / John Smith still conflicts, the lone word being read as a given name), and a two-part given name written with a space against its hyphenated form (Hong Yi Guo / Hong-Yi Guo) is not consistent by default.

Checks

  • Every example and stated behaviour added, moved or reworded was run through Parser().matching(...) before it was written.
  • Nothing dropped: a script compared master's double-backtick literals, numbers, roles and links, and doctest lines with the new page's; none is missing. Moved passages are byte-identical to master's (the page was assembled from master's line ranges); the reworded ones are those listed above.
  • uv run sphinx-build -q -E -b html docs <tmpdir> and uv run sphinx-build -q -b doctest docs <tmpdir> print nothing.
  • Labels: none duplicated across docs/*.rst; each sits directly before a heading. grep -rn 'matching.rst' tests/ nameparser/ tools/ finds nothing pointing at a moved section.
  • No link target was needed on another page.

uv run python tools/docs_scan.py matching.rst, before:

docs/matching.rst:369: PARA     118 words: A given name of two or three capitals with no middle name beside it, w...

After: no findings for matching.rst.

Reviews

Two independent pr-review-toolkit:code-reviewer passes, each given master's page and the new one, not the author's conclusions, and told to run every stated behaviour.

  • First pass, on 97cbcad. Ran every claim of the new and reworded sections. Found, and c7a5480 fixes: the at_least_initial sentence said it sets aside a missing generation where it sets aside every row ranked below initial; the list of what moves a name's keys read as complete and left out the lexicon and the other_readings switch; the across-roles and given-one-side cost cells claimed more than _keys does; a title link with no label (now matching-comparing-outcomes); the combinations sentence did not say to collect pairs in a set. Not changed: it called the given-one-side reason invented, but the decisions record states it ("A missing given name is opt-in, because under the key guarantee it makes every name with that surname emit a bare surname key"); it also noted that the sentence on a short name read as a title sat under "Which pairs a language choice keeps"; the third pass moved it.
  • Second pass, on the fix commit c7a5480. Confirmed the reworded cells and the key statements against Matching._keys; found the filter sentence still left out initials-agree and limited one-side to a middle name. Fixed in the last commit, which names all four default outcomes ranked below initial.
  • Coordinator's review, on 784c0ac. Three fixes in the last commit: the recipe bucketed name text, so a repeated name collapsed and the one-list advice gave its pair twice (it now pairs row numbers); the capitals rewrite had narrowed "fewer or more names than letters" to "fewer"; and the title sentence moved as above.

🤖 Generated with Claude Code

…ipe, a pair-to-setting index, one shape for every opt-in section

docs/matching.rst only; no code, test or vocabulary change.

Added: "Linking two lists" (the four steps as one doctest, with pairs
that share a key and are not consistent); "How large the groups get";
a pair-to-setting index at the head of "Accepting more"; sections for
given-one-side and hyphenated-part, which had none; "Accepting less"
(narrowing accept, and weakest/Outcome.strength as a post-filter).

Moved: "Consistency is not transitive" to directly after "Checking a
pair", its across-roles example to the across-roles section; the
paragraph on which outcome a row reports to below the outcome table,
under its own heading; "Store the names, not their keys" under its own
heading, as a list; the Lexicon import to where it is first used.

Every opt-in section now runs: when to accept it, what it reads, an
example with the default first, why it is off, what it does to the
keys. The capitals-as-initials sentence is a list of its conditions,
each with its example.

Cut, as contributor provenance (docs/design/decisions/name-matching.md
holds it, and the page now points there): "each read by two reviewers"
(familiar forms), and "each called a spelling of one name by both
reviewers or by the maintainer, and read again against that test"
(alternate spellings).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@derek73 derek73 added docs Documentation fixes and updates matching Name matching: Parser.matching(), check() and keys() labels Nov 16, 2026
@derek73 derek73 self-assigned this Nov 16, 2026
derek73 and others added 3 commits November 15, 2026 21:52
… reach, the list of what moves a key, two index cells

The at_least_initial filter sets aside every pair with a row ranked
below initial (one-side, generation-one-side, noted, initials-agree),
not only a missing generation. The list of what moves a name's keys
names the lexicon and the other_readings switch too. The across-roles
and given-one-side cost cells say what the keys are. Comparing two
outcomes gets a label for the link to it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…and call a key's letter a given letter

Second review of the fix commit: the filter also sets aside
initials-agree, and one-side covers a nickname and a maiden name as
well as a middle name.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… more'; move the title sentence to what a familiar form reads

The recipe bucketed the names' text, so two records written alike
became one, and its advice for one list gave a repeated name's pair in
both orders. It now buckets row numbers, holds a repeated record and a
lone name with no key, and says the recipe never reaches the latter.
J. P. Smith agrees against fewer or more names than letters, as master
said. The sentence on a short name read as a title is back with what
familiar-form reads.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@derek73
derek73 merged commit d0df2e8 into master Nov 16, 2026
14 checks passed
@derek73
derek73 deleted the docs/matching-recipe branch November 16, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation fixes and updates matching Name matching: Parser.matching(), check() and keys()

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant