Skip to content

Add the Ukrainian conjunction й (#267 comment, #269 follow-up) - #306

Merged
derek73 merged 1 commit into
masterfrom
fix/ukrainian-conjunction
Jul 31, 2026
Merged

Add the Ukrainian conjunction й (#267 comment, #269 follow-up)#306
derek73 merged 1 commit into
masterfrom
fix/ukrainian-conjunction

Conversation

@derek73

@derek73 derek73 commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Where this came from

A reply on #267 noted, while confirming that a bare Cyrillic letter should read as the conjunction rather than an initial:

In Russian, it is и and in Ukrainian, it is either і or й.

We ship и, і and та — not й. #269's candidate list read "Cyrillic conjunctions: и; Ukrainian і/та", so й was never considered and rejected; it just never made the list.

й is the euphonic alternate of і. Ukrainian picks between them by the surrounding vowel and consonant, not by meaning — "Олесь і Олена" but "Марія й Петро" — so real data carries both spellings and recognizing one of the two mis-parses the other:

'Олесь і Олена Коваленки'  ->  given: 'Олесь і Олена'   family: 'Коваленки'          ✓
'Олесь й Олена Коваленки'  ->  given: 'Олесь'  middle: 'й Олена'  family: 'Коваленки'  ✗

The change

One entry in nameparser/config/conjunctions.py. Pure data — no code path changes — and it inherits both guards the existing single-letter conjunctions rely on:

  • The single-letter carve-out (Google Code issue 11, the "john e smith" bug) still holds it back until the segment has enough rootname pieces, so 3-piece Іван й Олена stays split exactly as і and y do.
  • The dotted branch of the initial regex is Unicode-aware, so a punctuated Й. remains an initial and is untouched.

That second one seemed worth a standing test rather than a comment: и/і/й each open real given names (Игорь, Ірина, Йосип), so the shipped entries would be a trap if membership could outrank a punctuated initial. test_267_dotted_cyrillic_initial_wins_over_conjunction pins all three dotted forms.

Tests

Two rows added to the #269 non-Latin parametrization — the title-chain shape the и/і/та rows use, and the given-name join from the issue comment — plus the dotted-initial guard. Both new rows were watched failing on the old data before the entry landed.

2699 passed, 32 skipped, 11 xfailed; mypy and ruff clean.

Notes

  • Differential harness needs nothing. No name in any corpus*.jsonl contains й, so there is no new diff; and had one appeared, the existing feat(#269) non-Latin titles/conjunctions recognized rule in expected_changes.toml already classifies exactly this shape (Cyrillic, fields title/first/middle).
  • Release-log entry added under 2.1.0 → Behavior Changes.

Also checked, no action needed

The rest of that comment holds up against current behavior:

  • И. Иванов, І. Франко, И. С. Петров all parse as initials — the typography point Should a bare 'И' parse as an initial or the conjunction 'and'? (e.g. 'Хосе И Мария Сантос') #267 already settled.
  • А. П. и Е. Н. Ивановы gives first: 'А.', middle: 'П. и Е. Н.', last: 'Ивановы'. Lossy-looking, but identical to the Latin analogues A. P. and E. N. Ivanovs and A. P. y E. N. Santos — the general multi-person-string limitation, not a Cyrillic bug.
  • Plural family names (ИвановыИванов/Иванова) are morphological normalization; nothing analogous exists for any language here.
  • Cyrillic conjunction coverage is otherwise complete after this: и serves ru/bg/sr/mk, і/й/та serve uk/be.

🤖 Generated with Claude Code

Ukrainian writes і and й for the same conjunction, alternating on the
surrounding vowel and consonant for euphony ("Олесь і Олена" but
"Марія й Петро"), so real data carries both spellings. #269's candidate
list read "Ukrainian і/та" and й was never considered; it therefore
shipped recognizing one of the two and reading the other as a name
piece -- 'Олесь й Олена Коваленки' put the й in middle.

Pure data: no code path changes, and the entry inherits both existing
guards. The single-letter carve-out (Google Code issue 11) still holds
it back until the segment has enough rootname pieces, so a 3-piece
'Іван й Олена' stays split exactly as 'і' and 'y' do; and the initial
regex's dotted branch is Unicode-aware, so a punctuated 'Й.' remains an
initial. The second is worth a standing test rather than a comment --
и/і/й each open real given names (Игорь, Ірина, Йосип) -- so pin all
three dotted forms.

The differential harness needs nothing: no corpus name contains й, and
the #269 rule in expected_changes.toml already classifies this diff
shape (Cyrillic, fields title/first/middle) had one appeared.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@derek73 derek73 self-assigned this Jul 31, 2026
@derek73 derek73 added this to the v2.1 milestone Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.45%. Comparing base (d09ac7f) to head (60943ed).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #306   +/-   ##
=======================================
  Coverage   98.45%   98.45%           
=======================================
  Files          41       41           
  Lines        2776     2776           
=======================================
  Hits         2733     2733           
  Misses         43       43           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@derek73
derek73 merged commit 75b3c9c into master Jul 31, 2026
11 checks passed
@derek73
derek73 deleted the fix/ukrainian-conjunction branch July 31, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant