Skip to content

nickname getting output at end of name with no punctuation #40

Description

@jonathanmorgan

When I parse the name Dr. Jason "Jay" Ross:

>>> from nameparser import HumanName
>>> test_name = 'Dr. Jason "Jay" Ross'
>>> test_hn = HumanName( test_name )

It is broken out like this:

>>> test_hn
<HumanName : [
        title: 'Dr.' 
        first: 'Jason' 
        middle: '' 
        last: 'Ross' 
        suffix: ''
        nickname: 'Jay'
]>

When I convert it to a string:

>>> str( test_hn )
'Dr. Jason Ross Jay'

...the nickname is positioned at the end of the string, so it looks like it is the last name and Ross is the middle name. In my code, I use the HumanName class as the canonical way to convert from name parts to name string, and that has worked well up until this. It is wrapped in a method call, and so for now I've just started removing any nickname before I convert to string. Is there another way to specify how you want the nickname to be treated in string output?

Thanks!

Jon Morgan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions