Repository navigation
README: show 3.0's two family names, views and packs in the examples - #1106
Merged
Merged
Conversation
The lead example now parses a Spanish name both ways: the default reading and parser_for(locales.ES)'s two family names, with the surname1/surname2 and generation views and the two_given_names switch. More shapes: a title run, a listing form with generation and credentials split, an ambiguity report, Reading.languages, the honorifics and patronymic views, and the RU pack's patronymic beside the default reading. The announcement links "by reading" to customize.html#configuring-by-reading. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name what Reading.languages holds, show the Arabic family keeps the patronymic's words, and describe the default as positional rather than English. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hoice Lady reads as a title by default and a given name under ES; a strict vi choice keeps Dutch van out of Nguyen Van Anh. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eeps Per review: es holds a default-off given reading of lady rather than dropping the title, and a strict choice keeps non-Latin-script words. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Figures from the 2026-11-05 agreement measurement against filed name boxes (PatentsView, UK PSC, Czech candidates, ORCID per country). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…3-0-examples-76a6a9
The VI pack (#1112) reads Nguyen Van Anh family-first and removes the Dutch particle reading, so the hand-built strict vi Locale goes. The strict choice keeps an example: ES strict drops the English title phrase Lady Justice. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e named Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
README.rst is the PyPI project page, and its Quick Start still led with a 2.x-era example. This reworks the examples to show what 3.0 reads. The 3.0 announcement block is unchanged except for one new link.
Lead example.
Dr. Juan Carlos García de la Vega III (Juanca)is parsed twice:Juan, middleCarlos García, familyde la Vega.parser_for(locales.ES), which reads two family names (rules/O6, two family names): middleCarlos, familyGarcía de la Vega. Thesurname1,surname2andgenerationviews giveGarcía,de la VegaandIII.two_given_names(rules/O7, two given names), the given name readsJuan Carlos. The switch is aPolicyfield and not part of the ES pack, so the example passes it throughbase=.Choosing languages. Two short blocks show what a pack's choice of languages does:
Lady Heidenreichreads titleLadyby default, and givenLadyunderlocales.ES.Lady Justice Jane Smithkeeps titleLady Justiceunder it.strict=True) keeps only the chosen languages' words, the words every language shares, and words in other scripts.parser_for(locales.ES, strict=True)reads no title inLady Justice Jane Smith. The README links to locales.html#reading-one-language-only.FAMILY_FIRST_GIVEN_LAST,Nguyen Van Anhreads givenVan Anhbecause the Dutchvanchains on.parser_for(locales.VI)(Add locales.VI, a Vietnamese pack (#1108) #1112) reads familyNguyen, middleVan, givenAnh: the pack reads family-first and removesvan's particle reading. This replaces an earlier hand-built strictviLocale, written before the pack existed.More shapes, each showing something the others don't:
The Rt Hon Sir John Smith KCB MP)Dean Smithgives givenDean, andAssociate Dean Jane Smithgives titleAssociate Deangenerationandcredentialsviews split (Smith, John V., Jr., MD, PhD)Berg, Jan van dergives familyvan der Berg)Van Johnson)Reading.languages(thevaninLudwig van Beethovengives('nl',))Views in the CJK and Arabic lines. The Korean honorific line now reads
.honorifics. The Arabic line showsfamilyandpatronymicside by side, both'بن سلمان'(rules/R9, the patronymic view). A following pair shows rules/P12 (a bound given name and the word that completes it):طارق عبد العزيزreads familyعبد العزيز, becauseعبدbefore a name of God is one name.نوال عبد هاشمreads familyهاشم, becauseهاشمis not on that list.Russian. The old example showed only the family, so it never showed the patronymic. It now shows the default reading (given
Сидоров) besidelocales.RU's reading: givenИван, patronymicПетрович, familyСидоров.Link. "configures a
Lexiconby reading" in the announcement now links to https://nameparser.readthedocs.io/en/latest/customize.html#configuring-by-reading. The link is absolute so it works on PyPI too.Jane Smith, PhD MAwas cut, since the listing form covers credentials. No example has the nickname + one word + suffix shape that #815 is changing.Adjusting readings. A new section, "When a reading is wrong for your data", comes before Learn more and uses the recipes from customize.rst:
readings_of("dean")shows what a word may be read as.remove("dean", kind="given")makes Dean always a title, the other side of theDean Smithexample above.add("leed", "ap", kind="credential")adds a credential.Policy(name_order=FAMILY_FIRST)parser readsNagy Ádámas givenÁdám, familyNagy.Accuracy section. A new "How well it reads names" section after Learn more gives the figures that a 2026-11-05 measurement marked publishable. Each figure states its population and what it was compared with, and is dated, since nothing in the repository re-runs it:
locales.CS.locales.ES, and Mexico from 33.6% to 96.9%. The cost for Argentine patent inventors (93.8% by default, 86.2% under ES, 92.7% under ES_AR) is given beside it.ORCID's overall figure and the CLDR, GND and Wikidata rates are left out. The CLDR names are fictional, and the other sources were sampled by shape rather than by frequency. The ES and Argentina figures come from the per-country score, which uses each group's first 20,000 records. The other figures come from
local_agreement.py.The old lead name is still in the user docs.
Dr. Juan Q. Xavier de la Vega IIIalso appears indocs/usage.rst:12,docs/index.rst:20,docs/concepts.rst,docs/customize.rstanddocs/migrate.rst. It is still a correct default reading in each, so those are left unchanged.Verification
python -W error -m doctest README.rst: 60 passed at 8007cc5 on 3.11; 59 passed after merging master (withlocales.VI), on 3.11 and 3.15, before the VI line was split in two.available()comes from master and listsvi. It also passes underPYTHONHASHSEED0, 1 and 12345, and without thejaextra installed.python -m readme_renderer README.rst(PyPI's renderer): renders with no warnings beyond the usual one about the Markdown extra.#configuring-by-readinganchor exists in the local Sphinx build and on the live Read the Docs page.Reviews
vanexample says whatReading.languagesis, the Arabic example shows the family keeps the patronymic's words, and the Russian default line says it is read given-first.jaextra, checked for the Should'Smitty' Jones Jr.read family 'Jones', as'Smitty' Jonesdoes? (N3 counts a suffix; H1 and M4 set it aside) #815 shape, and confirmed that theAmbiguityandReading.languagesreprs come out the same every run. All checks passed.Ladyit turns on a default-off given reading. It also left out that strict keeps words in other scripts. Both were fixed in b851c3b, which also adds theLady Justiceline.🤖 Generated with Claude Code