python-nameparser icon indicating copy to clipboard operation
python-nameparser copied to clipboard

Van Nguyen capitalizes to van Nguyen

Open denhai opened this issue 8 years ago • 1 comments

h = HumanName('Van Nguyen')
h.capitalize(force=True)
str(h)  # 'van Nguyen'

Do first names ever start with lower case?

denhai avatar Feb 26 '18 12:02 denhai

Thanks for the bug report. The intention is to capitalize first names.

"Van" is not being capitalized because it is also a prefix and, apparently, anything that is a prefix or conjunction will always be made lower case regardless where it appears in the name.

https://github.com/derek73/python-nameparser/blob/master/nameparser/parser.py#L752

I don't think that's the the correct way to capitalize either of those. For example "e" is a conjunction but may also be an initial. Probably need to pass the attribute name or something into that cap_word function and make that if statement a bit more complicated.

derek73 avatar Feb 27 '18 01:02 derek73