Skip to content

Commit 8cd3123

Browse files
committed
add "do" and "md" to titles constant, fix #32
1 parent e72bcec commit 8cd3123

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

nameparser/config/titles.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
'discovery',
153153
'district',
154154
'division',
155+
'do',
155156
'docent',
156157
'docket',
157158
'doctor',
@@ -253,6 +254,7 @@
253254
'mcpo',
254255
'mcpoc',
255256
'mcpon',
257+
'md',
256258
'member',
257259
'metropolitan',
258260
'mg',

nameparser/parser.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,12 @@ def parse_full_name(self):
424424
self.first_list.append(piece)
425425
continue
426426
if self.are_suffixes(pieces[i+1:]) or \
427-
(self.is_roman_numeral(nxt) and i == p_len - 2 \
428-
and not self.is_an_initial(piece)):
429-
# if the next piece is the last piece and a roman numeral
430-
# but this piece is not an initial
427+
(
428+
# if the next piece is the last piece and a roman numeral
429+
# but this piece is not an initial
430+
self.is_roman_numeral(nxt) and i == p_len - 2
431+
and not self.is_an_initial(piece)
432+
):
431433
self.last_list.append(piece)
432434
self.suffix_list += pieces[i+1:]
433435
break
@@ -511,19 +513,6 @@ def parse_full_name(self):
511513
self.post_process()
512514

513515

514-
# def split_periods(self, pieces):
515-
# """
516-
# If there is a period that is not at the end of a piece, split it on periods.
517-
# """
518-
# tmp = []
519-
# for piece in pieces:
520-
# if piece[:-1].find('.') >= 0:
521-
# p = [_f for _f in piece.split('.') if _f]
522-
# tmp += [x+'.' for x in p]
523-
# else:
524-
# tmp += [piece]
525-
# return tmp
526-
527516
def parse_pieces(self, parts, additional_parts_count=0):
528517
"""
529518
Split parts on spaces and remove commas, join on conjunctions and

0 commit comments

Comments
 (0)