Skip to content

Count a listed title typed into the given-names box apart from the score (#1501) - #1505

Merged
derek73 merged 4 commits into
masterfrom
fix/issue-1501-title-in-given-box
Nov 21, 2026
Merged

derek73 merged 4 commits into
masterfrom
fix/issue-1501-title-in-given-box

Conversation

@derek73

@derek73 derek73 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Closes #1501

The change

tools/differential/local_agreement.py gets a class of its own, titled. A record joins it where:

  • the filer typed a listed title into the given-names box (Dr. Anna, Dr/ Anna, د. منى, Dr.Ahmed);
  • the parse reads that title as the title and the rest of the box as the box's names;
  • every other field agrees;
  • and no title box is filed.

The parse is right there and the box is what differs. So the record counts as neither agreeing nor missing, and the agreement figure is taken over the records outside the class.

The report prints:

  • the class's size on its own line;
  • a titled column per group;
  • the titles most often read in the given-names box.

--base and a record check report a record entering or leaving the class as titled in or titled out, apart from the regressions and progress, with the titles read. A record that agreed and is now read with a title is titled in, never a regression. So a word newly peeled as a title shows up in those lines under the title it was read as, and a reader checks the words rather than the records.

Where it applies. The rule reads the source's boxes, so it covers every scored source:

  • orcid-researchers and patentsview-inventors, which have no title box;
  • psc-individuals and cz-candidates, where the title box is filed empty.

A filed title box keeps the title scored against it.

config_diff.py. gaps and score share local_agreement.read. They drop a record any configuration reads into the class from every column, as they drop a set-aside record. In ORCID and PatentsView their title-word filter already drops nearly all of these; the slash form and PSC's are what reach the new check.

What stays out of the class:

Shape Example Read as
a title the vocabulary does not list Xyz. Anna the title, by its shape alone
a box holding only a title Dr, with the names in the next box
a title typed into the family box Berg Dr. the title
another field disagreeing Dr Anna / Berg Silva
a box holding more than the title and names Dr (Ann) Anna
a filed title box
a slash glued inside a word Dr/Anna

Each of these has a test row, and the class's six rows have a negative control: with the class off they score 6 misses, and with it on, 0.

How this sits with #1474 and #1477

#1474 (agrees, after initials) and #1477 (after any typed full stop) read a word the parse cuts as agreeing only where the box's letters stay in the box's field. #1477 kept Dr.Ahmed read title Dr., given Ahmed a miss on purpose: the scorer cannot tell a title rightly peeled from a given name wrongly peeled.

This replaces that choice for that shape only. Dr.Ahmed is now in the class, through the same agrees (the box Dr.Ahmed against title-then-names Dr. Ahmed), and still not an agreement. The worry #1477 held is answered by listing the titles read, instead of by counting the record a miss.

The two rules do not overlap:

  • agrees decides whether a field agrees.
  • titled applies only where a title, which no field box holds, was peeled off the given box, and it asks that every other field agree.

Measured

Each source was scored with --base, origin/master's scorer against this one, under the same parser (byte-identical nameparser/, so no reading moves), on 2026-11-20. Every record in the class was a miss before: the agreeing counts are unchanged.

source before after the class
orcid-researchers 1,484,797 of 1,831,533 (81.1%) 1,484,797 of 1,822,388 (81.5%) 9,145
patentsview-inventors 623,183 of 657,991 (94.7%) 623,183 of 657,901 (94.7%) 90
psc-individuals 1,007,010 of 1,039,155 (96.9%) 1,007,010 of 1,039,149 (96.9%) 6
cz-candidates 165,003 of 170,181 (97.0%) same 0
uit-vinames, vn-assembly unchanged unchanged 0

The ORCID countries holding the most of the class:

country before after the class
IN 72.8% of 20,000 77.4% of 18,810 1,190
PK 75.8% 79.1% 835
BD 72.7% 74.9% 595
IQ 77.0% 79.2% 572
SA 91.0% 92.8% 375
AE 88.2% 90.0% 363
NP 88.6% 90.5% 359
JO 92.5% 94.4% 330
US 91.0% 91.1% 22

The titles ORCID records read in the given-names box: Dr. 5,311, Dr 1,807, Prof. 260, د. 211, DR. 205, Prof. Dr. 130, Professor 58, Mr. 56, أ.د. 40, Hon 33, Most. 30, Engr. 27.

PatentsView holds 90 such records: SG 25, IN 11, MY 10. Its titles are led by Hon 39, then Guru 13, Lama 4, Swami 2.

PSC holds 6: Hon 2, Mr., Ms., Sir, St.

What the titles list shows. It surfaces given names that are peeled as titles:

None of this needs this PR to change anything, but it is the reading the class is for.

Docs

  • tools/differential/README.md: the local_agreement.py paragraph describes the class, its dated size, the shapes left out, and how --base reports it. It no longer lists Dr.Ahmed among the misses.
  • Root AGENTS.md: one sentence beside Score joined initials the parse cuts at a full stop as agreeing #1474's, telling a change to title vocabulary to read titled in and titled out beside its regressions.

Unchanged

  • Nothing under nameparser/ changes.
  • The committed snapshot and agreement records are byte-identical (git diff origin/master --stat -- nameparser tools/differential/*.json tools/differential/snapshot.jsonl is empty), and test_snapshot.py passes.
  • The shared agreement.jsonl records are not re-recorded. The scorer's fingerprint changes, so they need re-recording after merge.

Checks

uv run pytest (54,849 passed), uv run pytest -n0 -m serial, uv run mypy and uv run ruff check all pass. The new tests also pass run alone with -n0.

Review

Reviewed with the pr-review-toolkit:

  • code-reviewer: found no bug in the scorer's logic. It found two stale prose claims: the README still listed Dr.Ahmed as a miss, and the docstring's Dean example (the parse reads Dean as a given name) was wrong. Both fixed.
  • pr-test-analyzer: mutated each clause of titled and of config_diff's drops, and found the clauses no row isolated. Fixed with:
    • isolating rows for the other-fields check and for the final comparison (both mutants now fail);
    • cz-candidates rows;
    • a direct pin of the filed-title clause;
    • gaps both ways round, and score_rows with three configurations;
    • titled in the fingerprint test;
    • a record titled on both sides;
    • the glued Dr/Anna recorded as outside the class.
  • code-reviewer, second round (the fix commit): found that the rewritten negative control could not fail, because a record in the class has misses too, and that the README's countries left out India. Both fixed.
  • comment-analyzer: found the AGENTS.md sentence telling a reader to look away from the regressions where a newly peeled given name lands in titled in, the moves docstring's definitions, the report's two descriptions, config_diff's docstrings, and an Arabic test row matching a real person's title and name. All fixed.
  • code-reviewer, third round (that fix commit): confirmed the control now fails with the class on (0 misses) and gives 6 with it off, that every class row is still titled, and that each prose claim holds. Its one wording point, that config_diff's docstring could read as admitting a title only another configuration lists, is fixed in the last commit.

All names in this description and the tests are invented, of the shapes read.

🤖 Generated with Claude Code

derek73 and others added 3 commits November 20, 2026 14:35
…ore (#1501)

Where the filer typed a listed title into the given-names box and the
parse reads it as the title and the rest of the box as the box's names,
every other field agreeing and no title box filed, local_agreement.read
marks the record titled: counted in neither the agreeing records nor the
misses, the agreement figure taken over the records outside it, the
report printing the class's size, its titles and its records per group,
and --base reporting a record entering or leaving it as `titled in` and
`titled out` with the titles read. This replaces #1477's choice that
`Dr.Ahmed` read title `Dr.` stays a miss. config_diff's gaps and score
drop a record any configuration reads into the class from every column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1501)

A row for each clause no other refuses (another field disagreeing, a
box holding more than the title and names), cz-candidates' rows, the
filed-title clause pinned directly, gaps read both ways round, three
configurations in score_rows, a record titled on both sides, glued
`Dr/Anna` recorded as outside the class, and `titled` in the
fingerprint test. The report's groups run by the records they hold, the
class among them, and the module docstring's example is `Hon`, which
the measurement found, not `Dean`, which the parse reads as a given
name. tools/differential/README.md and AGENTS.md describe the class and
its size on 2026-11-20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rose (#1501)

The negative control counted read()'s misses, which a record in the
class has too, so it held with the class on; it now scores the class's
rows with the class off. The class's rows are one tuple, both the
glued-title rows check `titled`, each refusal row has its own comment,
and the Arabic row has an invented surname. The moves docstring says a
record that agreed and is now titled is `titled in`, never a
regression, and AGENTS.md now says to read those lines beside the
regressions rather than instead of them. The report's descriptions,
config_diff's docstrings and the README's countries (India first) are
brought in line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 20, 2026
@derek73 derek73 self-assigned this Nov 20, 2026
…ass (#1501)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 8b9f776 into master Nov 21, 2026
14 checks passed
@derek73
derek73 deleted the fix/issue-1501-title-in-given-box branch November 21, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

local_agreement scores a miss where a filer typed a title into the given-names box (Dr. Anna read title 'Dr.', given 'Anna')

1 participant