Repository navigation
Add jrc-names, a local corpus of JRC-Names person spellings, with a groups view - #865
Merged
Merged
Conversation
…oups view
JRC-Names (EU Joint Research Centre) lists each person entity with the
spellings of its name harvested from news text in many scripts: the one
local corpus holding several spellings of one person across scripts and
transliterations, and 17,074 Arabic-script spellings.
local_jrc.py downloads entities.gzip into the cache, pinned by sha256
(the file served on 2026-10-24 was last modified 2024-03-15), keeps the
unmarked person rows as {entity, name, script} records and drops the
language-marked rows, which are the JRC's own morphological variants
(inflected forms, Arabic with a glued conjunction or article): 20,819
rows, every one beside an unmarked spelling of the same person. A
download that is not the pinned file replaces nothing. Bad lines,
too few persons and too many marked rows are gated by stated shares;
a cut gzip or a file ending inside a line is refused; a corpus fetched
under another pin or read version is refused on load.
local_corpora.py groups compares the parse structure of each person's
spellings (title, suffix, given, family, family length and position),
counting persons, by pair of scripts, and lists the titles and
suffixes read in some spellings only as vocabulary leads.
The JRC-Names EULA bars redistribution and derivative works, so
nothing read from it is committed; tests use invented names only.
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 #865 +/- ##
=======================================
Coverage 99.05% 99.05%
=======================================
Files 47 47
Lines 4669 4669
=======================================
Hits 4625 4625
Misses 44 44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
From the five-part review (code, tests, comments, silent failures, types) of #865: - Reading is a NamedTuple and GROUP_FIELDS is derived from it, so a reordered field cannot mislabel counts; titles and suffixes are read by name, not by offset. - groups counts the persons across two scripts that read alike in no pair of spellings and apart in no one field ("no one field"), lists title and suffix WORDS (a run "Dr. Prof." gives two), says its floor, takes --top of 1 or more, and catches only the corpus's own refusals (Ungroupable, CorpusDamaged), not a ValueError from the parser. - The fetch refuses a file that would shrink in silence: persons left with only marked spellings (JRC_MAX_LOST) and repeated spellings (JRC_MAX_REPEATED). Ids are ASCII digits kept as written, a name's whitespace runs read as one space, and meta.json records the Unicode version script() read, checked on load. - A refresh of the intact pinned file downloads nothing, and a plain fetch adopts a kept download the pin has moved to. - Docs say what is measured: all 20,819 marked rows are dropped on the JRC's marking, 18,594 of them measured as variants; script()'s "none"; the README's worker-process sentence narrowed; figures re-run after a re-fetch under read version 2. Each new guard and rule has a negative control. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 24, 2026
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.
What
A new local corpus,
jrc-names. It holds the person entities of the EU Joint Research Centre's JRC-Names, each with the spellings of its name harvested from news text, plus a new view that compares those spellings:local_corpora.py groups.It is the one local corpus holding several spellings of one person across scripts and transliterations.
tse-donorspairs two spellings, both Latin. It also holds 17,074 Arabic-script spellings (7,833 persons, 5,347 of them also spelled in Latin). The committed corpora hold 315 distinct names with an Arabic letter, 96 of those CLDR's fictional renderings.Licence. The JRC-Names EULA is personal, non-exclusive and non-transferable, with no redistribution, sublicensing or derivative works. So nothing read from it is committed: not a name, not a per-name reading. The download, corpus, snapshot and views' output all stay under
~/.cache/nameparser-tools/local/jrc-names/. The tests use invented names only. The source docstring, the README row and the credit line every report opens with all say this.The source (
tools/differential/local_jrc.py)entities.gzip(14.8 MB) into the cache and refuses any other sha256.entities.gzip.newto be measured, and adopted once the pin moves to it. This matters because the JRC serves only its current file, so the pinned one could not be fetched again.fetch --refreshdownloads nothing when the cached file is already the pinned one; it reads the cached file again.meta.jsonrecords the pin, a read version and the Unicode versionscript()read. A corpus fetched under another of any of the three is refused on load.P, 1,338,463 of 1,445,013 lines); organisations are counted and read past. A record is one distinct spelling:{entity, name, script}, with+read as spaces.ru,ar,sl,et,pl, …): all 20,819, counted by language in the detail.u) spelling.JRC_UNMARKED.JRC_MAX_BAD; the file's#header is the 1 such line);JRC_MIN_PERSONS);JRC_MAX_MARKED);JRC_MAX_LOST; none in the pinned file);JRC_MAX_REPEATED; 58 in the pinned file);snapshot.py --local jrc-namesneeded no change: it recorded 1,315,051 names in 30s on 12 CPUs (128 MB).The groups view
group_countsparses every spelling of each person with two or more (218,822 persons, 717,199 spellings) and compares the structure of the readings, never the words, so spellings in different scripts can be compared. The fields are: title, suffix, given, family, family word count, and where the family stands (first, last, whole, inner, none).I put it in a view of its own rather than in
pair_shape/pair_counts, because those compare the strings of one filed/reference pair, while this compares N spellings by parse structure.Results on the pinned file (counts only), about 50s:
93.7% of persons read alike in every spelling.
Across scripts read in the same order, nearly all agree:
Hangul against a script read given first is ≤3% alike, because its family stands first: a convention, not an error.
Within a script, the disagreement is mostly writing conventions:
・, and spaced.Leads:
sheikh50,bard33,shaikh27,sir23,executive22, andmahdi17, a common given name;jr62,sa38,iii27,ii27.Possible follow-ups, none filed: whether
Mahdi/Bardbelong inTITLES, and how an Arabic comma inside a harvested name should read.Docs
local_corpora.py's docstring.mechanisms.md#NAME-DATA-JOBS: one sentence.Verification
ruff,mypy, and the full suite on 3.11: 23,398 passed, plus the serial pass. The local-corpus modules on 3.15: 413 passed.git checkout.A code review and a docs-claims review. These found the "alike" definition, the refresh that could overwrite the only pinned copy, the Arabic comma (my first draft said no name held a comma), and several counts over mismatched populations.
A review of the fix commit. This found that the cached records' script labels were stale under the fixed
script(), which is what the read version now catches. All figures were re-measured after a re-fetch.After opening: a five-part review (code, tests, comments, silent failures, types), then a simplification pass. Its main findings:
ValueErrorthat would have been reported as corpus damage;Readingbecame a NamedTuple. Each fix has a control, and every figure was re-run after a re-fetch under read version 2.🤖 Generated with Claude Code