python-nameparser
python-nameparser copied to clipboard
Van Nguyen capitalizes to van Nguyen
h = HumanName('Van Nguyen')
h.capitalize(force=True)
str(h) # 'van Nguyen'
Do first names ever start with lower case?
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.