Skip to content

Commit f37cc48

Browse files
derek73claude
andcommitted
docs: list the AmbiguityKind and PatronymicRule members in the reference
Enum members without doc comments are skipped by autodoc, so the 'stable vocabulary of kinds' was invisible on the very page that promised it. Each member now carries a #: doc -- honestly marking ORDER and SUFFIX_OR_NICKNAME as reserved (no emitter yet; planned 2.x) and describing the emitter behavior of the three live kinds. PatronymicRule's two members get the same treatment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 28078c7 commit f37cc48

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

nameparser/_policy.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@
1313

1414

1515
class PatronymicRule(StrEnum):
16-
"""Stable rule names (API); implementations live in the pipeline."""
16+
"""Stable rule names (API); implementations live in the pipeline.
17+
Enable via ``Policy(patronymic_rules={...})`` or, more commonly, a
18+
locale pack (:mod:`nameparser.locales`)."""
1719

20+
#: East Slavic formal order: "Sidorov Ivan Petrovich"
21+
#: (family, given, patronymic) is detected by the patronymic
22+
#: ending and reordered. Enabled by locales.RU.
1823
EAST_SLAVIC = "east-slavic"
24+
#: Turkic patronymic markers: a standalone "oglu"/"qizi"/"kyzy"
25+
#: (etc.) binds to the preceding name as a patronymic. Enabled by
26+
#: locales.TR_AZ.
1927
TURKIC = "turkic"
2028

2129

nameparser/_types.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,23 @@ class AmbiguityKind(StrEnum):
218218
compares directly. New kinds may be added in minor releases;
219219
existing values never change meaning."""
220220

221+
#: Reserved: the name's field order itself is uncertain (e.g. a
222+
#: two-word name under a non-default name_order). Not yet emitted;
223+
#: planned for 2.x.
221224
ORDER = "order"
225+
#: Reserved: a trailing word reads plausibly as either a suffix or
226+
#: a nickname. Not yet emitted; planned for 2.x.
222227
SUFFIX_OR_NICKNAME = "suffix-or-nickname"
228+
#: A leading ambiguous particle was read as a given name -- "Van
229+
#: Johnson" parses given="Van", but "Van" is also a family-name
230+
#: particle in other names.
223231
PARTICLE_OR_GIVEN = "particle-or-given"
232+
#: A nickname/maiden delimiter opened without closing (or closed
233+
#: without opening); the text was kept as literal name content.
234+
#: May carry no tokens.
224235
UNBALANCED_DELIMITER = "unbalanced-delimiter"
236+
#: More comma-separated segments than any recognized name shape;
237+
#: the parse is best-effort over the extra segments.
225238
COMMA_STRUCTURE = "comma-structure"
226239

227240

0 commit comments

Comments
 (0)