Skip to content

Commit 4a6aa61

Browse files
committed
update release log and documentation
1 parent 85b60e8 commit 4a6aa61

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

docs/customize.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,50 @@
1+
Pre-processing
2+
=================
3+
4+
5+
Name buckets
6+
++++++++++++++
7+
8+
Each attribute has a corresponding ordered list of name pieces.
9+
10+
* o.title_list
11+
* o.first_list
12+
* o.middle_list
13+
* o.last_list
14+
* o.suffix_list
15+
* o.nickname_list
16+
17+
If you're doing pre- or post-processing you may wish to manipulate these lists directly.
18+
The strings returned by the attribute names just join these lists with spaces.
19+
20+
::
21+
22+
>>> hn = HumanName("Juan Q. Xavier Velasquez y Garcia, Jr.")
23+
>>> hn.middle_list
24+
[u'Q.', u'Xavier']
25+
>>> hn.middle_list += ["Ricardo"]
26+
>>> hn.middle_list
27+
[u'Q.', u'Xavier', 'Ricardo']
28+
29+
30+
You can also replace any name bucket's contents by assigning a string or a list
31+
directly to the attribute.
32+
33+
::
34+
35+
>>> hn = HumanName("Dr. John A. Kenneth Doe")
36+
>>> hn.title = ["Associate","Professor"]
37+
>>> hn.suffix = "Md."
38+
<HumanName : [
39+
title: 'Associate Processor'
40+
first: 'John'
41+
middle: 'A. Kenneth'
42+
last: 'Doe'
43+
suffix: 'Md.'
44+
nickname: ''
45+
]>
46+
47+
148
Customizing the Parser with Your Own Configuration
249
==================================================
350

docs/release_log.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
Release Log
22
===========
33

4-
* 0.3.5 - August, 2015
4+
* 0.3.6 - August 6, 2015
5+
- Fix strings that start with conjunctions (#20)
6+
- handle assigning lists of names to a name attribute
7+
* 0.3.5 - August 4, 2015
58
- Fix handling of string encoding in python 2.x (#34)
69
- Add support for dictionary key access, e.g. name['first']
710
- add 'santa' to prefixes, add 'cpa', 'csm', 'phr', 'pmp' to suffixes (#35)

docs/usage.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ Example
4343
suffix: 'Jr.'
4444
nickname: ''
4545
]>
46+
>>> name.suffix = ["custom","values"]
47+
>>> name.suffix
48+
u'custom values'
4649
>>> name.full_name = 'Doe-Ray, Jonathan "John" A. Harris'
4750
>>> name.as_dict()
4851
{u'last': u'Doe-Ray', u'suffix': u'', u'title': u'', u'middle': u'A. Harris', u'nickname': u'John', u'first': u'Jonathan'}

nameparser/config/regexes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
("initial", re.compile(r'^(\w\.|[A-Z])?$', re.U)),
1010
("nickname", re.compile(r'\s*?[\("](.+?)[\)"]', re.U)),
1111
("roman_numeral", re.compile(r'^(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$', re.I | re.U)),
12+
("no_vowels",re.compile(r'^[^aeyiuo]+$', re.I | re.U))
1213
])
1314
"""
1415
All regular expressions used by the parser are precompiled and stored in the config.

0 commit comments

Comments
 (0)