We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4f7dcd commit 71d91a2Copy full SHA for 71d91a2
2 files changed
nameparser/parser.py
@@ -992,7 +992,7 @@ def parse_full_name(self) -> None:
992
993
if not self.first \
994
and (nxt or len(pieces) == 1) \
995
- and self.is_title(piece):
+ and self.is_leading_title(piece):
996
self.title_list.append(piece)
997
continue
998
if not self.first:
tests/test_titles.py
@@ -278,3 +278,10 @@ def test_herr_title_with_first_name(self) -> None:
278
self.m(hn.title, "Herr", hn)
279
self.m(hn.first, "Klaus", hn)
280
self.m(hn.last, "Schmidt", hn)
281
+
282
+ def test_leading_period_abbreviation_suffix_comma(self) -> None:
283
+ hn = HumanName("Major. John Smith, Jr.")
284
+ self.m(hn.title, "Major.", hn)
285
+ self.m(hn.first, "John", hn)
286
+ self.m(hn.last, "Smith", hn)
287
+ self.m(hn.suffix, "Jr.", hn)
0 commit comments