Skip to content

Commit f21e7be

Browse files
committed
v0.5.0, update docs
1 parent 67a07d5 commit f21e7be

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

docs/release_log.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Release Log
22
===========
3+
* 0.5.0 - August 4, 2016
4+
- Refactor join_on_conjunctions(), fix #53
35
* 0.4.1 - July 25, 2016
46
- Remove "bishop" from titles because it also could be a first name
57
- Fix handling of lastname prefixes with periods, e.g. "Jane St. John" (#50)

nameparser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = (0, 4, 1)
1+
VERSION = (0, 5, 0)
22
__version__ = '.'.join(map(str, VERSION))
33
__author__ = "Derek Gulbranson"
44
__author_email__ = '[email protected]'

nameparser/parser.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -580,16 +580,18 @@ def parse_pieces(self, parts, additional_parts_count=0):
580580

581581
def join_on_conjunctions(self, pieces, additional_parts_count=0):
582582
"""
583-
Join conjunctions to surrounding pieces, e.g.:
583+
Join conjunctions to surrounding pieces. Title- and prefix-aware. e.g.:
584584
585-
['Mr.', 'and'. 'Mrs.', 'John', 'Doe']
586-
v
587-
['Mr. and Mrs.', 'John', 'Doe']
585+
['Mr.', 'and'. 'Mrs.', 'John', 'Doe'] ==>
586+
['Mr. and Mrs.', 'John', 'Doe']
588587
589-
590-
['The', 'Secretary', 'of', 'State', 'Hillary', 'Clinton']
591-
v
592-
['The Secretary of State', 'Hillary', 'Clinton']
588+
['The', 'Secretary', 'of', 'State', 'Hillary', 'Clinton'] ==>
589+
['The Secretary of State', 'Hillary', 'Clinton']
590+
591+
When joining titles, saves newly formed piece to the instance's titles
592+
constant so they will be parsed correctly later. E.g. after parsing the
593+
example names above, 'The Secretary of State' and 'Mr. and Mrs.' would
594+
be present in the titles constant set.
593595
594596
:param list pieces: name pieces strings after split on spaces
595597
:param int additional_parts_count:

0 commit comments

Comments
 (0)