You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/customize.rst
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ Other editable attributes
87
87
* :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.
88
88
* :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).
89
89
* :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.
91
91
* :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.
92
92
93
93
@@ -118,6 +118,41 @@ patronymic-form surnames such as ``"David Michael Abramovich"``. Enable this
118
118
flag only when your data is predominantly Russian formal-order names.
119
119
120
120
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) — matching the
144
+
East-Slavic guard's token-count strictness above. Unlike that guard, there's
145
+
no additional check on the given-name token, since Turkic markers are a
146
+
small, closed set unlikely to coincide with an ordinary given name (whereas
147
+
East-Slavic patronymic suffixes can coincide with real Western surnames).
148
+
Recognised markers cover common transliterations and native orthographies:
149
+
Latin ``oglu``, ``oğlu``, ``ogly``, ``ogli``, ``o'g'li`` (and its Uzbek
150
+
modifier-apostrophe and right-single-quote variants), ``qizi``, ``qızı``,
151
+
``kizi``, ``kyzy``, ``gyzy``, ``uly``, ``uulu``; and Cyrillic ``оглу``,
Copy file name to clipboardExpand all lines: docs/release_log.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ Release Log
23
23
- Fix ``'apn aprn'`` split into separate ``suffix_acronyms`` entries so each is recognized independently (closes #155)
24
24
- 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)
25
25
- 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)
26
27
- Add ``first_name_prefixes`` set to ``Constants``; bound Arabic given-name
27
28
prefixes (``abdul``, ``abu``, etc.) now join forward to form a single first
28
29
name (e.g. ``"abdul salam ahmed salem"`` → ``first="abdul salam"``,
0 commit comments