Skip to content

Commit 774487e

Browse files
committed
docs: document Turkic patronymic name order support (#185)
1 parent b6c235a commit 774487e

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

docs/customize.rst

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Other editable attributes
8787
* :py:obj:`~nameparser.config.Constants.force_mixed_case_capitalization` - If set, forces the capitalization of mixed case strings when :py:meth:`~nameparser.parser.HumanName.capitalize` is called.
8888
* :py:obj:`~nameparser.config.Constants.suffix_delimiter` - additional delimiter used to split suffix groups after comma-splitting, e.g. ``" - "`` for names like ``"Jane Smith, RN - CRNA"``. Defaults to ``None`` (disabled).
8989
* :py:obj:`~nameparser.config.Constants.initials_separator` - string placed between consecutive initials within the same name group (after the delimiter). Defaults to ``" "``, so ``"A. K."``; set to ``""`` for compact ``"A.K."``.
90-
* :py:obj:`~nameparser.config.Constants.patronymic_name_order` - If set, detects Russian formal-order names (``Surname GivenName Patronymic``) via a trailing East-Slavic patronymic suffix and rotates the parts to Western order (``first=GivenName``, ``middle=Patronymic``, ``last=Surname``). Opt-in; see subsection below.
90+
* :py:obj:`~nameparser.config.Constants.patronymic_name_order` - If set, detects Russian formal-order names (``Surname GivenName Patronymic``) via a trailing East-Slavic patronymic suffix and rotates the parts to Western order (``first=GivenName``, ``middle=Patronymic``, ``last=Surname``). Also detects reversed-order Azerbaijani/Central-Asian Turkic patronymics (``Surname GivenName PatronymicRoot Marker``, e.g. ``oglu``/``qizi``). Opt-in; see subsections below.
9191
* :py:obj:`~nameparser.config.Constants.middle_name_as_last` - If set, folds middle names into the last name (``.last`` becomes what ``.surnames`` already was, ``.middle`` becomes empty). Opt-in; see subsection below.
9292

9393

@@ -118,6 +118,38 @@ patronymic-form surnames such as ``"David Michael Abramovich"``. Enable this
118118
flag only when your data is predominantly Russian formal-order names.
119119

120120

121+
Turkic Patronymics
122+
~~~~~~~~~~~~~~~~~~
123+
124+
Azerbaijani and Central-Asian formal names follow a different shape: a
125+
4-word ``[Given] [Father's given name] [Marker] [Family]``, where the
126+
marker is a standalone word (``oglu``/``oğlu`` "son of",
127+
``qizi``/``qızı`` "daughter of", and further variants — see below), not a
128+
bound suffix. The same ``patronymic_name_order`` flag also detects and
129+
rotates the reversed, no-comma form of this shape::
130+
131+
>>> from nameparser import HumanName
132+
>>> from nameparser.config import Constants
133+
>>> C = Constants(patronymic_name_order=True)
134+
>>> hn = HumanName("Aliyev Vusal Said oglu", constants=C)
135+
>>> hn.first, hn.middle, hn.last
136+
('Vusal', 'Said oglu', 'Aliyev')
137+
138+
Natural order (``"Vusal Said oglu Aliyev"``) and comma order
139+
(``"Aliyev, Vusal Said oglu"``) already parse correctly without this flag
140+
and are left unchanged.
141+
142+
Detection is scoped strictly to the 4-token shape (single-token first/last,
143+
exactly two middle tokens, last token a recognised marker) — mirroring the
144+
strictness of the East-Slavic guard above. Recognised markers cover common
145+
transliterations and native orthographies: Latin ``oglu``, ``oğlu``,
146+
``ogly``, ``ogli``, ``o'g'li`` (and its Uzbek modifier-apostrophe and
147+
right-single-quote variants), ``qizi``, ``qızı``, ``kizi``, ``kyzy``,
148+
``gyzy``, ``uly``, ``uulu``; and Cyrillic ``оглу``, ``оглы``, ``оғлу``,
149+
``ўғли``, ``угли``, ``кызы``, ``гызы``, ``қызы``, ``қизи``, ``улы``,
150+
``ұлы``, ``уулу``. Matching is case-insensitive.
151+
152+
121153
Suppressing Middle Names
122154
~~~~~~~~~~~~~~~~~~~~~~~~~
123155

docs/release_log.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Release Log
2323
- Fix ``'apn aprn'`` split into separate ``suffix_acronyms`` entries so each is recognized independently (closes #155)
2424
- Add ``last_base``, ``last_prefixes`` (and ``_list`` variants) plus ``family`` / ``family_prefixes`` aliases for splitting last-name prefix particles (tussenvoegsels) from the core surname (#130, #132)
2525
- Add ``patronymic_name_order`` flag to ``Constants`` and ``HumanName`` for opt-in detection and reordering of Russian formal-order names (Surname GivenName Patronymic) (#85)
26+
- Add Turkic (Azerbaijani/Central-Asian) patronymic detection to ``patronymic_name_order``, rotating the reversed 4-token formal shape (``Surname GivenName PatronymicRoot Marker``, e.g. ``oglu``/``qizi``) into Western order (#185)
2627
- Add ``first_name_prefixes`` set to ``Constants``; bound Arabic given-name
2728
prefixes (``abdul``, ``abu``, etc.) now join forward to form a single first
2829
name (e.g. ``"abdul salam ahmed salem"`` → ``first="abdul salam"``,

0 commit comments

Comments
 (0)