Repository navigation
Read a bound pair from its listed second word too (#1072) - #1500
Merged
Merged
Conversation
A new vocabulary kind, bound_second, for the word an Arabic-script pair writes second: الدين and الله (Persian الدین and اله, Urdu اللہ) join the plain word before them, at the first name word too, the pair placed by position (under the default order the given name where it opens the name, the family where it ends it); الغنى and الفقار are written `completes = ["ذو"]`, joining behind ذو alone. Lexicon.add accepts the new kind. A pair holding every name word the parse read is split back once roles are settled, as P5's reserve keeps a bound word's, save after a family comma and behind a given-name title, where P5 joins too. The pair is one unit for P1's family-first fold and O6's take and division, before a family comma too. One rule, rules/P12, read from whichever word is listed. Latin spellings and آية الله as a title stay out, recorded as Open lines in decisions/P12 with the counts. Snapshot, rules corpus and the Wikidata native agreement record re-recorded (the three names #1072 named now agree). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The split's own adjacency check could not be reached once the caller had tested the tag, which codecov/patch reported; the caller now tests both, and the split reads the pair it was handed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides added a migrate.rst section and cases.py rows; both kept. The compiled index, rules corpus and snapshot are regenerated. A row pins that #1149's short title, which addresses the given name, keeps a two-word pair joined behind it, as الدكتور does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #1072
As decided on the issue: a bound pair is read from its listed second word too, an amendment to rules/P12 (a bound given name and the word that completes it). In Arabic script,
الدينandاللهjoin the plain word before them: Persianالدینandالهand Urduاللہtoo. The pair is the given name where it opens the name and the family where it ends it, under the default order.ذوjoinsالغنىandالفقار.What it adds
bound_second, for the word a pair writes second.Lexicon.addaccepts it (add("x", kind="bound_second")), with one list property,completes=[...], naming the only first words it joins behind.BOUND_SECONDS,BOUND_SECOND_PHRASESandBOUND_SECONDS_LISTED._reading_index's tables, the build's checks and their mutations,Lexicon.add's docs, the vocabulary README, customize.rst's kind and property tables.عبد اللهtoo. A later word's report then names the field it would take beside two names.أبو نور الدين سامر→ given 'أبو نور').+, so the split-candidate grep sees it.Uddin: PSC 25 fixed / 432 broken, ORCID Bangladesh 15 / 99. Without theu-forms: ORCID 155 / 0, but PSC 16 / 11 and PatentsView 6 / 8.آية اللهas a title. The vocabulary can't express it: a title phrase's partner must be a title word, and a title reading onاللهwould break the pairs read from it. The shape is 16 spaced JRC-Names spellings plus 7 written joined. It is pinned as the accepted reading: given 'آية الله', where 3.1.0 read given 'آية', wrong both ways.د.and the Iraqi academic abbreviations read as titles? (د. أحمد علي حسنgives given 'د.') #1149 (PR Read Arabic titles written short, and give Arabic script no initials (#1149) #1497, merged into this branch): the two share no word. Read Arabic titles written short, and give Arabic script no initials (#1149) #1497 adds Arabic titles (أ.د,د,الاستاذ,اللواء, ...) and does not touchآية الله,الدين,اللهor the join's code. A title of it before a pair is read as a title and the pair joins after it (د. نور الدين سامر حداد→ title 'د.', given 'نور الدين'). Itsد.addresses the given name asالدكتورdoes, so a two-word pair behind it stays joined, P5's exception (د. عز الدين→ given 'عز الدين', a row). The shared files (ar.toml, the compiled vocabulary, the snapshot and rules corpus,cases.py,migrate.rst) merged with both sides kept and the generated ones rebuilt.Measured
The prototype was scored against master
34771e2don three variants; the shipped build reads the 857 corpus names holding a second word as variant A does, save one two-word name the prototype mishandled.اللهbehind listed words onlyالدين/الله, 3+ words, pair kept in one fieldlocal_agreement.py orcid-researchers --base, re-taken against mastere0f698c8after merging Shouldد.and the Iraqi academic abbreviations read as titles? (د. أحمد علي حسنgives given 'د.') #1149, and unchanged against0c4da6caafter ShouldHafiz,HajiandMaulanaopening a name read as titles under a Bengali or Urdu choice? (Hafiz Ahmed Khangives givenHafiz) #1469 and ShouldParser.suggestproposetwo_family_names? A list ofGabriel García Márquez-style names gets no suggestion, and the default reads familyMárquez#1452: 30 progress, 0 regressions, 10 changed (33 / 0 / 6 against34771e2d). Of the 10, the pair is right in its field in all but one, but the record still misses: the given box holds the person's title (د.,م.,أ.م.د), which no reading puts there, or one box holds the whole name. The one exception is a name of two name words behindد.with the second word alone in the family box, the shapeد. سامر الدين. It now reads given 'سامر الدين' and family empty, where master read family 'الدين'. That is P5's exception for a given-name title, as decided forالدكتورand kept for Shouldد.and the Iraqi academic abbreviations read as titles? (د. أحمد علي حسنgives given 'د.') #1149'sد., which addresses the given name the same way (a row pinsد. عز الدين). One record, so left as decided.Alike views, against
e0f698c8: JRC-Names 1 person now alike, 4 now apart; parliaments 7 now apart (9 against34771e2d). Each of them is a member spelled short in one entry and with a longer chain in another: the view compares the family's word count. Not misreadings.Persian population: small. 9 JRC-Names spellings and 11 ORCID records; the join moves 8 of each.
Frames:
Smith, Johnسعيد حسن(no second word)ليلى عز الدين(the pair joins)نور الدين سامر حداد(the pair joins)Changes
_classify.py,_group.py,_vocab.py(unit_ends),_post_rules.py(O6's division),_assemble.py,_state.py,_reading_index.py,_lexicon.py,tools/vocab/build.py.ar.toml,fa.tomlandur.toml; compiled modules rebuilt.nameparser/andnameparser/vocab/AGENTS.md lessons.cases.pyrows across comma shapes, the three orders, titles and particles before the pair, maiden clauses, nicknames, marks, Persian and Urdu spellings, and the guard's edges.parity_check.pyreports 0 of 690 parity rows differing from 1.4.0; thefix(...)notes were checked against the 1.4.0, 2.x and 3.1.0 wheels.add/removeboth ways, the refusals, and the tags kept off published tokens.Reviews
آية الله;measure.py --baseagainste0f698c8: 30 steps, none failed; moves only in the jrc-names, parliaments and orcid steps. Frames re-taken on the merged tree are unchanged from the table.Full suite,
-m serial, mypy, ruff, Sphinx doctest, README doctest,build.py --check,familiar.py --checkandparity_check.pyall pass.🤖 Generated with Claude Code