Repository navigation
Add a getting-started page, and lead README and the docs index with it - #1353
Merged
Merged
Conversation
Add docs/getting-started.rst: parse one name, let Parser.suggest() choose the settings for a list (choosing a language pack first where the list's language is known, and where it declines), and compare names with Parser.matching(), then a table of tasks linking the nine pages. README leads with the 3.1 features and the same three steps, keeps the one-liner block, and points to the pack pages instead of the Spanish, Vietnamese and strict-choice tour; its East Asian link points at east-asian.html. index.rst links the three steps and puts getting-started first under Start here. The rewrites PR #1343 left: usage.rst retitled "Working with a parsed name" with a new lead and Where next; its two passages duplicated in customize.rst cut to the report, the rules left in customize; customize's intro gives the order to try things in; locales' "East Asian names need no pack" cut to a pointer; "Contributing a pack to nameparser" moved to contributing.rst; shapes.rst's cross-page "below" fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eading README taught in a locales doctest Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- usage: a Title-case surname-or-credential (Jack Ma) reports suffix-or-name; only capitals and periods settle it silently. Doctest added. customize's parenthetical names the Title-case lean too. - locales, README: a name only in katakana keeps the default order. - getting-started: suggest's shares stated against the names they count (order: names whose order votes agree; patronymic: names that cast any vote; trailing initials: names left after commas and titles-only); the given-name evidence is names rarely surnames (Mary, not John); initials_as_family only on a given-first base keeping middles apart; consistent defined by the accepted outcomes, with the opt-in ones and a name with no family name; as_dict shown; pass a list, not a reader; suggestion.base for the disagreeing names; set the order yourself wherever you know it. Trimmed back to its word target. - README: the report covers every setting considered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…indings - getting-started and README: Smith Mary / Mary Smith in place of the earlier example name, which may be a real person's; outputs re-run. - getting-started: an order needs two NAMES voting for it; the trailing-initial count is of initials nothing else in the name contradicts, and a name with only post-nominals after its comma counts; initials_as_family conditioned on a given-first base only (the code decides it under middle_as_family too); the disagreeing names MAY be misread; Python 3.11 and no other package restored. - usage: capitals settle an acronym such as MA, not a credential written as a word (KC, PC, DL), which the count decides and reports; doctest. 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.
The second of the two PRs restructuring the user docs (the first, #1343, moved text only). This one writes the entry path: a getting-started page, the README and index leads that point to it, and the rewrites #1343 left for it.
Pages
wc -w)getting-started(new)suggest(what it decides, choosing a language pack first, where it declines);matching(keys,check, each source parsed with its own parser); a task table linking the nine pages. First in the toctree, under "Start here".indexusageJack Ma,John Smith KC); "Where next" rewritten for the new pages.shapescustomizesuggest, a pack, aPolicyfield, aLexiconedit. Absorbs one doctest from usage.localescontributingcontributing-a-packlabel.east-asian,matching,languagesREADME.rstsuggest,matching) and the three getting-started steps; keeps the one-liner block; the Spanish, Vietnamese and strict-choice tour replaced by one sentence linking locales and languages; "Learn more" lists the new pages.suggest's claims on getting-started were checked againstnameparser/_suggest.pyandParser.suggest's docstring: it decidesname_order,patronymic_rulesandinitials_as_family, never a language, and keeps every other setting at the base's value. No accuracy figure is quoted on the page; it points tosuggest.rst, which holds the measured table.Removed doctests and claims
Doctests (
>>>statements):usage.rst"Credentials that are also surnames":parse("Jack MA").suffixandparse("Jack Ma").family. Duplicated in customize.rst's section of the same title, which keeps both.usage.rstsame section:parse("John Smith Ma").family. Moved to customize.rst's doctest beside the other two, where the prose already stated it.usage.rst"Titles that are also given names":parse("Dean of Students Jane Smith").title. Duplicated in customize.rst'stitles-also-given-namesdoctest; usage keeps the phrase in prose and thetitle-or-namereport.README.rsttour, each still shown elsewhere:surname1/surname2/generationandrenderonJuan Carlos García de la Vega: usage'ssurname1/surname2doctests and languages.rst.two_given_namesreadingJuan Carlos: policy.rst's two-given-names doctests.Lady Heidenreichtitle by default, given under ES: locales.rst's doctest.Lady Justice Jane Smithkeeps the title: was prose only in locales.rst; added there as a doctest in this PR.Lady Justice Jane Smithwith no title: not shown elsewhere with that name; locales.rst'sstrict-choicesection shows a strict choice dropping English words with its own examples.FAMILY_FIRST_GIVEN_LASTchainingVan Anh, and VI keepingVana middle name: locales.rst and languages.rst (Nguyen Van Anh).Claims (prose):
pip install nameparser): now on getting-started.concepts,localesandmigratelines and "HumanName, which 3.0 removes"; getting-started's table and index.rst carry both links, and migrate.rst the fact.Lexiconconfigured by reading, a name rendered in the order written, packs that choose languages): the release log's 3.0 entry holds each. Its list of what 3.0 removed (Constants,CONSTANTS,nameparser.util, the 1.x names of the word lists) and "2.8 is the last release that has them, and it warns at each use": README's "Coming from 1.x or 2.x" keepsConstants,CONSTANTSand the 2.8.2 warning;nameparser.utiland the word-list names are in migrate.rst.Smith Mary/Mary Smithinstead of the earlier example name, with the outputs re-run (the vote counts and the report are the same).From #1343's "For the rewrite PR" list and the plan
Done: getting-started and its toctree entry; index.rst's lead links; README's 3.1 lead, quick start and East Asian link (now
east-asian.html;usage.html#east-asian-namesstill resolves for released READMEs); both merges; the East Asian pointer; usage's "Where next" and retitle; customize's intro; "Contributing a pack" moved to contributing.rst; shapes.rst's "below".Not done, and why:
east-asian,matching,languagestoward their targets: see the table.policy.rst's "see Vocabulary: Lexicon above" (policy.rst:667): policy.rst is being edited by another session this cycle. Reported to the coordinator.
Found outside this PR's files (not changed here)
Parser.suggestturnsinitials_as_familyon under amiddle_as_familybase, where its docstring (nameparser/_parser.py, "nor turns it on under a base reading names family first or folding every middle into the family") anddocs/suggest.rstsay it does not:Parser(policy=Policy(middle_as_family=True)).suggest(["Ram Bahadur B K", "Sita Kumari B K", "Hari K C", "Gita Devi B K"]).patchisPolicyPatch(initials_as_family=True), inert there. getting-started states what the code does (given-first base only).docs/suggest.rst,docs/release_log.rst, theTypeErrormessage innameparser/_suggest.py(~line 1046, offered as code to paste) and the suggest tests.parse("金 민준")(mixed Han and Hangul) reads given金, family준: an odd reading the docs' "wholly in Han or Hangul" correctly leaves out, possibly worth an issue.:doc:links to labels: the release log is out of this PR's scope.Anchors
New:
getting-started(label and page),contributing-a-pack. Moved: "Contributing a pack to nameparser" fromlocales.htmltocontributing.html(its one in-page link is now a:ref:); usage's page-title anchor is nowworking-with-a-parsed-name.git grepforusing-the-parser,Using the parser,contributing-a-pack,Contributing a packandneed no packacrossdocs/,README.rst,nameparser/,tests/,tools/and everyAGENTS.mdfinds no other reference (dated decisions entries excepted, as history). RootAGENTS.md's release-checklist docs line anddocs/AGENTS.md's page list namegetting-started.rst.Proof
uv run sphinx-build -b doctest docs <dir>: 822 tests, 0 failures (origin/master at 670b349: 788, 0 failures).uv run sphinx-build -W -b html docs <dir>: exits 0, prints nothing.python -m doctest README.rstpasses;uv run --with readme_renderer python -m readme_renderer README.rstrenders; everyreadthedocs.io/en/latest/<page>[#anchor]link in README resolves in the built HTML, andusage.htmlstill holdsid="east-asian-names"once.uv run pytest: 45,962 passed, 38 skipped, 3 xfailed;uv run pytest -n0 -m serial: 35 passed;uv run mypy: no issues;uv run ruff check: clean.tests/v2/test_es_given_names.py,test_doc_citations.pyandtest_doc_spellings.pypass.Reviews
Jack Mareports nothing (it reportssuffix-or-name); locales' and README's family-first sentence dropped the katakana-alone exception; "consistent" defined wider thancheck(opt-in outcomes, a name with no family); "a common given name" overstated (Johncasts no vote); the trailing-initial share's denominator; three omissions from the removed list; new-user gaps (noas_dict,suggestreads its iterable once, what to do with the disagreeing names, a one-word name matching nothing). All fixed.initials_as_familybullet with no numbers, "the one optional extra" as a standing count. All fixed; thresholds confirmed equal to the tested constants in_suggest.py.initials_as_familycondition followed the docstring, not the code (above); a comma name with only post-nominals does count toward the trailing-initial share; "two votes" should be two names; the disagreeing names may be misread, not are; usage's new "capitals settle it" is false of credentials written as words (KC,PC,DL); "and nothing else" (no dependencies) lost. All fixed in the last commit, each checked by running it.🤖 Generated with Claude Code