Skip to content

Commit 1a29c38

Browse files
committed
docs: mention Turkic patronymic detection in patronymic_name_order docstring
The Constants class-attribute docstring (the canonical Sphinx-linked API doc, referenced via :py:obj: from docs/customize.rst) only described the East-Slavic behavior, drifting from the customize.rst prose already updated for Turkic support. Adds the missing sentence and a second doctest example (#185).
1 parent 774487e commit 1a29c38

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

nameparser/config/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,12 @@ class Constants:
370370
token in each of first, middle, and last; names with multi-part given names or
371371
multiple middle names are left unchanged.
372372
373+
Also detects reversed-order Azerbaijani/Central-Asian Turkic patronymics
374+
(``Surname GivenName PatronymicRoot Marker``, e.g. ``oglu``/``qizi``), a
375+
structurally different, standalone-marker-word patronymic family. Detection
376+
requires exactly one token in each of first and last, exactly two tokens in
377+
middle, and the last token a recognised Turkic marker.
378+
373379
Opt-in because a Western person whose surname happens to end in a patronymic
374380
suffix (e.g. ``"David Michael Abramovich"``) will be reordered incorrectly
375381
when the flag is on. Enable only when your data is predominantly Russian
@@ -386,6 +392,9 @@ class Constants:
386392
>>> hn = HumanName("Ivanov Ivan Ivanovich", constants=C)
387393
>>> hn.first, hn.middle, hn.last
388394
('Ivan', 'Ivanovich', 'Ivanov')
395+
>>> hn2 = HumanName("Aliyev Vusal Said oglu", constants=C)
396+
>>> hn2.first, hn2.middle, hn2.last
397+
('Vusal', 'Said oglu', 'Aliyev')
389398
390399
"""
391400

0 commit comments

Comments
 (0)