Repository navigation
More position titles in capitals, wider test set (v3.1.18) - #85
Merged
Merged
Conversation
Probing more titles found gaps in the 3.1.17 rules: - the block of capitals was counted only from the candidate onwards, so "з посади СТАРШОГО ОПЕРАТОРА РОЗРАХУНКУ" was rejected from the first word and taken again from the second; the block is now counted in both directions (_caps_block_without_patronymic); - a first name in -их/-ів (Авіаційних, Комплексів) must be a known name (Яків), so "Оператора Відділення Безпілотних Авіаційних Комплексів" stays in capitals and in title case; - two words in capitals without a rank and without a patronymic are a name only when the second word is a known first name (КОВАЛЬ ТЕТЯНА, ПЕТРЕНКО ЗИНОВІЙ): ПОМІЧНИКА ГРАНАТОМЕТНИКА, ЗАХИСНИКУ ВІТЧИЗНИ, ЗА ВІЙСЬКОВУ ДОБЛЕСТЬ were surname + first name. Trade-off: ПЕТРЕНКО АЙДЕР (rare first name, capitals, no rank) is no longer masked; Петренко Айдер and рядового ПЕТРЕНКА АЙДЕРА still are; - a line in capitals is a heading only without a known first name next to another word: КОВАЛЬ ТЕТЯНА — ІВАНОВ ПЕТРО is masked, НАКАЗ КОМАНДИРА ВІЙСЬКОВОЇ ЧАСТИНИ and ВІРА НАДІЯ ЛЮБОВ are not. Known limitation: in "ВРУЧИТИ ГРАМОТУ ОЛЕГУ ПЕТРОВИЧУ ПЕТРЕНКУ" the first name and patronymic are masked, the surname after them is not — a word in capitals before a name-first order cannot be told from a surname. tests/test_position_titles.py: 106 cases — titles and unit names in capitals and title case, headings, award names, a whole order, real names in capitals in tables, with tabs, quotes, labels, dates and IDs, initials, name-first order, shifted windows, two-word names, ranks, helper rules. Masks of generated documents unchanged (0 of 150 differ from main); round-trip fuzzer 1500 and leak fuzzer 800 documents clean. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7 Generated-With: Claude Code 2.1.42
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.
Summary
Follow-up to #84 ("position titles in capitals taken for a name"): a wider probe of titles, unit names, headings and real names in capitals found four gaps in the 3.1.17 rules and gives the fix a test set of 106 cases.
з посади СТАРШОГО ОПЕРАТОРА РОЗРАХУНКУСТАРШОГО ОПЕРІЙЧА РОМАНУ(rejected from the 1st word, taken again from the 2nd)на посаду ОПЕРАТОРА ВІДДІЛЕННЯ БЕЗПІЛОТНИХ АВІАЦІЙНИХ КОМПЛЕКСІВ… БЕЗПІЛОТНИХ АВІВІЄНКО КОСТЯНТИНна посаду Оператора Відділення Безпілотних Авіаційних Комплексів… Безипенко Андрій Мироновична посаду ПОМІЧНИКА ГРАНАТОМЕТНИКА,медаллю ЗАХИСНИКУ ВІТЧИЗНИ,відзнакою ЗА ВІЙСЬКОВУ ДОБЛЕСТЬКОВАЛЬ ТЕТЯНА — ІВАНОВ ПЕТРОRules
_caps_block_without_patronymic): any candidate inside a run of three or more words in capitals without a patronymic is a title.-их/-ів(Авіаційних,Комплексів) must be a known name (Яків), otherwise the candidate is not a name.КОВАЛЬ ТЕТЯНА,ПЕТРЕНКО ЗИНОВІЙ,КОВАЛЬ ЯКІВ). Trade-off:ПЕТРЕНКО АЙДЕР(a rare first name, capitals, no rank, no patronymic) is no longer masked;Петренко Айдерandрядового ПЕТРЕНКА АЙДЕРАstill are.НАКАЗ КОМАНДИРА ВІЙСЬКОВОЇ ЧАСТИНИ,ВІРА НАДІЯ ЛЮБОВstay headings,КОВАЛЬ ТЕТЯНА — ІВАНОВ ПЕТРОis a list of people.ВРУЧИТИ ГРАМОТУ ОЛЕГУ ПЕТРОВИЧУ ПЕТРЕНКУthe first name and patronymic are masked, the surname after them is not — a word in capitals before a name-first order cannot be told from a surname.Tests
tests/test_position_titles.py— 106 cases: 22 position titles in capitals, 5 in title case, 9 headings and award names, a whole order (titles plus three real names and a signature), 32 real names in capitals (tables, tabs, quotes,ПІБ:label, dates and IDs, initials, name-first order, shifted window, two-word names, ranks, mixed case), the trade-off and the limitation, and the helper rules.Verification
pytest: 1533 passed, 1 skipped; mypy 0 errors; flake8 clean.mainon 150 generated documents: identical.🤖 Generated with Claude Code
https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7
Generated by Claude Code