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 11Release Log
22===========
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
36* 0.3.11 - October 17, 2015
47 - Fix bug capitalization exceptions (#39)
58* 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 )
22__version__ = '.' .join (map (str , VERSION ))
33__author__ = "Derek Gulbranson"
44__author_email__ = '[email protected] '
Original file line number Diff line number Diff line change @@ -439,10 +439,14 @@ def parse_full_name(self):
439439
440440 self .middle_list .append (piece )
441441 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 :
443446
444447 # suffix comma: title first middle last [suffix], suffix [suffix] [, suffix]
445448 # parts[0], parts[1:...]
449+
446450
447451 self .suffix_list += parts [1 :]
448452 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):
14441444 self .m (hn .first , "Jack" , hn )
14451445 self .m (hn .last , "Ma" , hn )
14461446
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+
14471459 def test_potential_suffix_that_is_also_last_name_with_suffix (self ):
14481460 hn = HumanName ("Jack Ma Jr" )
14491461 self .m (hn .first , "Jack" , hn )
You can’t perform that action at this time.
0 commit comments