Repository navigation
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
Conversation
…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>
… 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>
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.
Reworks
docs/matching.rstfor a reader who has two lists of people to link and has never seen the feature. Docs only:docs/matching.rstis the one file changed. Every existing title and label is kept, so links fromcustomize.rst,usage.rst,suggest.rstandmodules.rstresolve as before.What changed, by critique item
matching-recipe) closing "Checking a pair": two made-up lists, bucketed bykeys(), the two sides of each bucket paired, pairs collected in a set (two writings ofde la Cruzshare 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 loneSuharto, 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 withitertools.productrather thancombinations, since the reader is linking two files; one sentence givescombinationsfor duplicates inside one list.Slvatore/Salvatore,Igor/Ihor) rather thanJon/John, which conflicts today but is the kind of pair the vocabulary could later list.matching-accepting-less):matcher.accept - {"initial"}with the default first, which default outcomes agree on the least text, thatsameis always accepted, that dropping a default outcome leaves the keys as they are, andweakestwithOutcome.strengthas a post-filter.matching-not-transitive). Its last doctest, which used a matcher defined much later, moved to the across-roles section, where that matcher is bound.matching-reported-outcome).given-one-sideandhyphenated-parteach have a section, linked from the outcome table (matching-given-one-side,matching-hyphenated-part). The reasongiven-one-sideis off is the decisions record's (a bare surname key on every name). The record states no fuller reason forhyphenated-partthan 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.across-rolesandother_readingsthe record gives no reason beyond the default being the writing variants, so those two say that and no more.docs/design/decisions/name-matching.md; what a plain and a strict choice keep is under "Which pairs a language choice keeps", with links tochoosing-languagesandstrict-choice, and the sentence on a short name read as a title is with whatfamiliar-formreads.Bill Smith: one key by default, six with every opt-in).given-one-sidesection and the section on names with no inherited family name._capitals_spelled.Lexiconimport 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-sidealone does not reach a name written as one word (Smith/John Smithstill 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
Parser().matching(...)before it was written.uv run sphinx-build -q -E -b html docs <tmpdir>anduv run sphinx-build -q -b doctest docs <tmpdir>print nothing.docs/*.rst; each sits directly before a heading.grep -rn 'matching.rst' tests/ nameparser/ tools/finds nothing pointing at a moved section.uv run python tools/docs_scan.py matching.rst, before:After: no findings for
matching.rst.Reviews
Two independent
pr-review-toolkit:code-reviewerpasses, each given master's page and the new one, not the author's conclusions, and told to run every stated behaviour.at_least_initialsentence said it sets aside a missing generation where it sets aside every row ranked belowinitial; the list of what moves a name's keys read as complete and left out the lexicon and theother_readingsswitch; theacross-rolesandgiven-one-sidecost cells claimed more than_keysdoes; a title link with no label (nowmatching-comparing-outcomes); thecombinationssentence did not say to collect pairs in a set. Not changed: it called thegiven-one-sidereason 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.Matching._keys; found the filter sentence still left outinitials-agreeand limitedone-sideto a middle name. Fixed in the last commit, which names all four default outcomes ranked belowinitial.🤖 Generated with Claude Code