Skip to content

Score a word the parse cuts after any typed full stop as agreeing - #1478

Merged
derek73 merged 2 commits into
masterfrom
fix/issue-1477-scorer-cut-at-full-stop
Nov 19, 2026
Merged

derek73 merged 2 commits into
masterfrom
fix/issue-1477-scorer-cut-at-full-stop

Conversation

@derek73

@derek73 derek73 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Closes #1477

The change

#1470 (PR #1474) taught local_agreement.agrees to forgive a cut the parse draws after initials (B.A.S.D. read given B., middle A.S.D.). This widens it to any full stop the filer typed, whatever stands before it. A box Md.Karim read given Md. (Muhammad written short), middle Karim now agrees with ORCID's and PatentsView's given-names box, which holds both fields. _joined accepts a cut after any piece ending in a full stop, in both directions as before. _initials had no other reader and is removed, and _SCORER_CODE drops it.

Each case that must stay a miss has a test row, and each row passes on master's scorer too:

  • a source with a box each for given and middle names (psc-individuals: Md.Karim in the forename box read given Md., middle Karim)
  • a word peeled out of the field (Dr.Ahmed read title Dr., given Ahmed)
  • a run with no full stop (AB against A B)
  • a full stop the reading lost (K.S against K S, Md.Karim against Md Karim)
  • a word left over (Md.Karim against Md. Karim Lee)
  • letters that differ (Md.Karim against Md. Karin)

The rows #1470 refused and this accepts (Md.Karim, Jo.Ann, A.Bc.D., 1.2.) flip to agreeing explicitly. They fail on master's scorer.

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

Before and after

The same parser (this tree), with master's scorer and with this one, over every record of every fielded local corpus (2026-11-19):

corpus records disagree → agree agree → disagree
orcid-researchers 1,831,533 168 0
patentsview-inventors 657,991 1 0
psc-individuals 1,040,708 0 0
cz-candidates 170,181 0 0
uit-vinames 21,090 0 0
vn-assembly 499 0 0

These are exactly the counts #1474 left. Every moved record moved in the given+middle field alone, with no other field or set-aside changing. Every one is this shape: the box with its spaces removed equals the reading, cut after a word of two or more letters and a full stop.

  • The word before the full stop: Md. 125, MD. 33, Ma. 8 (the Filipino short form of María), Moh. 1, Mhd. 1.
  • Countries: BD 146, PH 8, MY 2, CH 2, then one each in SE, AU, ID, NP, LB, AF and a record with no country. PatentsView's one record is BD.

I read 25 drawn orcid-researchers moves and the one PatentsView move by hand. Each is a given box of the shape Md.Karim, MD.KARIM HASAN or Md.Karim Hasan, read with the box's words in order in the given+middle field. None is a record of another shape, so there was nothing to stop and report.

Guard and docs

Unchanged

Nothing under nameparser/ changes. The committed snapshot and agreement records are byte-identical. The shared agreement.jsonl files are not re-recorded: the scorer's fingerprint changes, so they want re-recording after merge.

Checks

uv run pytest (50,613 passed on the final commit), uv run pytest -n0 -m serial, uv run mypy and uv run ruff check all pass.

Review

Reviewed with the pr-review-toolkit:

🤖 Generated with Claude Code

derek73 and others added 2 commits November 19, 2026 10:48
)

#1470 had local_agreement.agrees forgive a cut the parse draws after
initials (`B.A.S.D.` read `B.`, `A.S.D.`). A cut after any other word
ending in a full stop (`Md.Karim` read given `Md.`, middle `Karim`)
still scored a miss, though both words land in the box's own field.
_joined now accepts a cut after any piece ending in a full stop, and
_initials, with no reader left, goes.

A run with no full stop, a full stop the reading lost, a word left
over or peeled to another field (`Dr.Ahmed` read title `Dr.`), other
letters, and a cut across two boxes a source states apart
(psc-individuals' forename and middle name) still score a miss, each
with a test row.

Measured with the same parser, master's scorer against this one: 168
orcid-researchers and 1 patentsview-inventors records move from
disagreeing to agreeing, all in the given+middle field; none moves the
other way and no other corpus moves. The guard test's grid gains
words before a full stop; its control is re-taken (22 -> 25).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard test now also records how many held rows #1470's rule, a cut
forgiven only after initials, still scored a miss (3, the rows #1477
added), so a narrowing back is caught by a stated count. The module
docstring no longer credits the Md. cut to #1296: it is Muhammad
written short. A row holds a word left over after a cut word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 19, 2026
@derek73 derek73 self-assigned this Nov 19, 2026
@derek73
derek73 merged commit a6af868 into master Nov 19, 2026
14 checks passed
@derek73
derek73 deleted the fix/issue-1477-scorer-cut-at-full-stop branch November 19, 2026 19:09
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 for a word cut after any full stop the filer typed (Md.Karimul read given 'Md.', middle 'Karimul')

1 participant