File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1
1
Release Log
2
2
===========
3
+ * 0.3.12 - October 17, 2015
4
+ - Fix first name clash with suffixes (#42)
5
+ - Fix encoding of constants added via the python shell
3
6
* 0.3.11 - October 17, 2015
4
7
- Fix bug capitalization exceptions (#39)
5
8
* 0.3.10 - September 19, 2015
Original file line number Diff line number Diff line change 1
- VERSION = (0 , 3 , 11 )
1
+ VERSION = (0 , 3 , 12 )
2
2
__version__ = '.' .join (map (str , VERSION ))
3
3
__author__ = "Derek Gulbranson"
4
4
__author_email__ = '[email protected] '
Original file line number Diff line number Diff line change @@ -439,10 +439,14 @@ def parse_full_name(self):
439
439
440
440
self .middle_list .append (piece )
441
441
else :
442
- if self .are_suffixes (parts [1 ].split (' ' )):
442
+ # if all the end parts are suffixes and there is more than one piece in
443
+ # the first part. (Suffixes will never appear after last names only, and
444
+ # allows potential first names to be in suffixes, e.g. "Johnson, Bart"
445
+ if self .are_suffixes (parts [1 ].split (' ' )) and len (parts [0 ].split (' ' )) > 1 :
443
446
444
447
# suffix comma: title first middle last [suffix], suffix [suffix] [, suffix]
445
448
# parts[0], parts[1:...]
449
+
446
450
447
451
self .suffix_list += parts [1 :]
448
452
pieces = self .parse_pieces (parts [0 ].split (' ' ))
Original file line number Diff line number Diff line change @@ -1444,6 +1444,18 @@ def test_potential_suffix_that_is_also_last_name_comma(self):
1444
1444
self .m (hn .first , "Jack" , hn )
1445
1445
self .m (hn .last , "Ma" , hn )
1446
1446
1447
+ def test_potential_suffix_that_is_also_first_name_comma (self ):
1448
+ hn = HumanName ("Johnson, Bart" )
1449
+ self .m (hn .first , "Bart" , hn )
1450
+ self .m (hn .last , "Johnson" , hn )
1451
+
1452
+ # TODO: handle conjunctions in last names followed by first names clashing with suffixes
1453
+ @unittest .expectedFailure
1454
+ def test_potential_suffix_that_is_also_first_name_comma_with_conjunction (self ):
1455
+ hn = HumanName ("De la Vina, Bart" )
1456
+ self .m (hn .first , "Bart" , hn )
1457
+ self .m (hn .last , "De la Vina" , hn )
1458
+
1447
1459
def test_potential_suffix_that_is_also_last_name_with_suffix (self ):
1448
1460
hn = HumanName ("Jack Ma Jr" )
1449
1461
self .m (hn .first , "Jack" , hn )
You can’t perform that action at this time.
0 commit comments