Skip to content

Add familiar forms from Wikidata's people for Central and Eastern European and Balkan languages, holding the spellings (#1387) - #1503

Merged
derek73 merged 11 commits into
masterfrom
feat/wikidata-familiar-forms
Nov 20, 2026
Merged

derek73 merged 11 commits into
masterfrom
feat/wikidata-familiar-forms

Conversation

@derek73

@derek73 derek73 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Closes #1387.

Adds tools/vocab/familiar_wikidata.py, a generator of familiar-form candidates from Wikidata's people (CC0). It runs per language over the three relations decided on the issue (2026-11-19). It also ships the familiar forms two readers agreed on: 231 familiar forms in Central and Eastern European and Balkan languages' files. The 46 alternate spellings the readers also agreed on are held: they are recorded in a new review category and ship nowhere (decided 2026-11-20; see below).

The generator

It fetches each of 21 citizenships through the query service. The queries are simple, one per kind of statement, and joined in Python, because a single query joining the name items' labels to people timed out. Each answer is kept in the tools cache, keyed by the query's digest, written under a temporary name of its own and checked whole when read back. pairs reads the cache alone. The requests carry a generic User-Agent naming no person or project.

In each language the country writes, it reads three relations:

  1. Birth name (P1477) against the label. A pair is kept only where one of its words is the person's given name (P735).
  2. Stated nickname (P1449) against P735, with the shape filter.
  3. Label against P735, where the label holds a family name and one word is left once the family names and any patronymic are set aside.

Other filters:

  • Titles, initials and Hungarian -né words are dropped.
  • A given-name label that is no name word is refused (Сол/Саул).
  • A person is left out of a language where one of their name items has no usable label in it.
  • Spellings the match folds alike are one candidate.

It reads no list of familiar forms; a test holds it to that.

Per language

tag drawn (all) reviewed familiar shipped spellings held nam_dict yardstick, before → after
cs 974 188 92 1 1/2 → 1/2
hu 657 185 70 1 2/50 → 21/50
ru 598 152 17 20 13/70 → 13/70
ro 395 65 18 3 0/23 → 1/23
pl 383 65 11 5 5/9 → 5/9
uk 318 96 7 15 12/78 → 12/78
sk 169 70 34 0 1/1 → 1/1
sl 159 30 15 2 —
sr 119 18 10 0 0/3 → 0/3
hr 98 16 9 0 0/5 → 1/5
be 93 28 3 5 13/80 → 13/80
bg 89 20 4 1 0/12 → 0/12
sq 33 1 0 0 0/1 → 0/1
bs 20 7 3 0 —
mk 3 0 0 0 —
  • Drawn: 3,810 pairs in all, 724 of them at 2 people or more. Every pair at 2 or more is reviewed; the 3,060 at one person are not.
  • Languages: a reviewed pair goes in the languages its readers judged it in.
  • Yardstick: nam_dict's pairs, nothing drawn from them. The Russian, Ukrainian and Belarusian yardstick pairs are Latin transliterations, while this change's pairs are Cyrillic (Match a name across scripts, opt-in (Олег Петренко / Oleg Petrenko) #1385). They cannot meet, so those rows do not move.

The review

The first pass followed #1379's procedure, with mechanisms.md's Field notes applied:

  • Readers: two per pair, Opus and Sonnet, in 17 chunks of 51 rows or fewer. Each chunk held 3 unmarked controls, and each row needed a reason of its own.
  • Controls kept apart: 47 of 51 by the first reader, 45 of 51 by the second.
  • Rows: 750, after removing 5 bad labels, 12 fold-duplicates, and 5 pairs the fixed tool draws for no one.
  • Agreement: the readers agree on 620: translation 257, familiar 231, spelling 64, different-name 57, sibling 10, unclear 1.
  • Splits: 130 split, mostly a Russian against a Ukrainian or Belarusian form in Cyrillic. They are recorded as split and ship nowhere.

The 2026-11-13 spelling test was then applied to the 64 agreed spellings by two more readers:

  • 46 both read as one name.
  • 18 either read as a translation or unclear (Арчил / Арчіл, Вардан / Вартан); they are recorded as split.

Decided 2026-11-20: the 46 are held. The test pass read all 3 of its planted translations as spellings (Julia / Yulia, Joanna / Yoanna, Alia / Aliaa; 0 of 6 kept apart), so its agreement is not evidence. The 46 are recorded as held, a new review category that requires decided and ships nowhere, for a later spelling pass. ALTERNATE_SPELLINGS stays at master's 294.

Measurements

  • Pair counts: FAMILIAR goes from 1,055 to 1,286 pairs, and ALTERNATE_SPELLINGS is unchanged at 294.
  • Snapshot: tools/differential/snapshot.jsonl is byte-identical to master's (35b12d3), and the full suite passes (54,818).
  • match_diff: tools/differential/match_diff.py --base against 35b12d3, run with the spellings held, read 31,392 pairs under 22 settings:
    • The key guarantee holds, and 2,932 of 690,624 rows move.
    • Under the default setting only the table moves: 20 given rows report familiar-form where conflict stood. Under +alternate-spelling the same 20 rows move and nothing else.
    • 64 verdicts go from inconsistent to consistent, each under a setting that accepts familiar-form, and none goes the other way.

Docs

  • decisions/name-matching: a 2026-11-20 Add Wikidata as a source of Central and Eastern European familiar forms (Józsi / József) #1387 entry with the recipe, counts and open questions. Those include the 46 held spellings, the 148 splits (130 from the first review, 18 from the spelling test), and the Ukrainian and Belarusian apostrophe names the name-word test refuses.
  • decisions/shipped-data-licences: a 2026-11-20 entry. Wikidata is CC0, so it adds nothing to the expression.
  • docs/matching.rst, nameparser/vocab/README.md, AGENTS.md and the release log are updated.

Reviews

  • Round 1: pr-review-toolkit code-reviewer, pr-test-analyzer, silent-failure-hunter, comment-analyzer and type-design-analyzer, plus design-docs-reviewer. The findings were fixed in 6ea315b and 31949c1. They covered cache keys and cut answers, column counts, the label relation, fold-duplicate rows, unreproducible counts, docs claims, and the spelling test.

  • Round 2, on those fix commits (code-reviewer, design-docs-reviewer):

    • Merging duplicates lost vlado from cs.toml.
    • An unlabelled family name stopped the birth relation.
    • The retry branches were untested.
    • 5 rows were not reproducible.
    • Fixed in c0d468e.
  • Round 3, on c0d468e (code-reviewer): taking languages from the tool's draw added be to алёна and dropped sk and sl placements. Fixed in the last commit, with a test for each direction.

  • CI: ja-extra (3.15) and source-tree failed on an HTTPError the retry test built and never closed (ResourceWarning). Fixed by building each error only when raised; ask also closes a final HTTPError.

  • Merge: master (35b12d3) was merged in. The release log was resolved by keeping both bullets, and the compiled vocabulary was rebuilt with tools/vocab/build.py, which found it current.

  • Hold commit 39affe5, reviewed by code-reviewer. It confirmed:

    • ALTERNATE_SPELLINGS is byte-identical to master's, and no spelling reading moved.
    • held is refused without decided and is never placed.
    • The widened match test still refuses everything master's refused.

    One stale test comment, and the licence entry's wording, were fixed in the last commit.

  • Not fixed: Ukrainian and Belarusian apostrophe names (Дар'я) are refused by the shared name-word test. This is recorded as open in the decisions entry.

🤖 Generated with Claude Code

derek73 and others added 3 commits November 20, 2026 12:55
)

tools/vocab/familiar_wikidata.py fetches, country by country, the
statements three relations read (birth name against the label, a
stated nickname against the given name, the label against the given
name) and writes candidate pairs by the language they were found in.

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

766 candidate pairs at two people or more, read by two readers, add 235
familiar forms and 64 alternate spellings in fifteen Central and Eastern
European and Balkan languages' files. The generator merges spellings the
name match folds alike, and refuses a given-name label that is no name
word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 20, 2026
@derek73 derek73 added enhancement matching Name matching: Parser.matching(), check() and keys() labels Nov 20, 2026
@derek73 derek73 self-assigned this Nov 20, 2026
derek73 and others added 8 commits November 20, 2026 13:25
…ate rows (#1387)

The generator keys each kept answer by its query, writes it under a
temporary name of its own and checks it whole when read back, refuses an
answer cut inside its last line, reads the cache alone for pairs, counts
each column's people once, leaves out a language whose name items it
cannot read, and wants a family name in a label. The review drops 11 rows
the match reads as another pair, and the spelling test of 2026-11-13
splits 18 agreed spellings, which ship nowhere.

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

A reviewed row's people and languages are the committed tool's, so a
pair merged from two spellings keeps every language it was found in
(cs.toml had lost vlado); an unreadable family name stops only the two
relations that set the family name aside; and the five rows the tool
draws for no one leave the review. The retry arms of ask are tested.

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

The tool's languages added Belarusian to Алёна / Елена through its split
twin and dropped Slovak Zuzka; a row's languages are now its own and its
same-verdict fold-twins' at review time, and a test holds each direction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iar-forms

# Conflicts:
#	docs/release_log.rst
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… alone (#1387)

The spelling test that passed the 46 agreed spellings read all three of
its planted translations as spellings, so its agreement is no evidence:
decided 2026-11-20, they are recorded as a new review category, held,
and ship nowhere. ALTERNATE_SPELLINGS is master's again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 changed the title Add familiar forms from Wikidata's people for Central and Eastern European and Balkan languages (#1387) Add familiar forms from Wikidata's people for Central and Eastern European and Balkan languages, holding the spellings (#1387) Nov 20, 2026
@derek73
derek73 merged commit cb5088a into master Nov 20, 2026
14 checks passed
@derek73
derek73 deleted the feat/wikidata-familiar-forms branch November 20, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement matching Name matching: Parser.matching(), check() and keys()

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Wikidata as a source of Central and Eastern European familiar forms (Józsi / József)

1 participant