Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange parsing of name w lastname prefix and title before and after #100

Open
kaspersorensen opened this issue Dec 10, 2019 · 2 comments
Open
Labels

Comments

@kaspersorensen
Copy link

The combination of having lastname prefixes and repeated titles before and after a name seems to break the parsers logic around middle name handling.

Here's a test that fails:

        hn = HumanName("dr Vincent van Gogh dr")
        self.assertEqual("Vincent", hn.first)
        self.assertEqual("van", hn.middle)
        self.assertEqual("Gogh", hn.last)

For some reason, the middle name comes out as dr Vincent van instead of the expected van.

@derek73 derek73 added the bug label Dec 12, 2019
@derek73
Copy link
Owner

derek73 commented Dec 12, 2019

Current master does this:

% python tests.py "dr Vincent van Gogh dr"
<HumanName : [
	title: 'dr' 
	first: 'Vincent' 
	middle: ' dr Vincent van' 
	last: 'Gogh' 
	suffix: 'dr'
	nickname: ''
]>

Actually this is what I would expect because "van" is a prefix and should attach itself to the following piece.

% python tests.py "dr Vincent van Gogh dr"
<HumanName : [
	title: 'dr' 
	first: 'Vincent' 
	middle: '' 
	last: 'van Gogh' 
	suffix: 'dr'
	nickname: ''
]>

I think this is a valid bug but I'm not sure what the issue is.

@derek73
Copy link
Owner

derek73 commented Dec 12, 2019

actually, "van" is not a prefix because it is sometimes a first name. So you're right, this should be the expected output:

% python tests.py "dr Vincent van Gogh dr"
<HumanName : [
	title: 'dr' 
	first: 'Vincent' 
	middle: 'van' 
	last: 'Gogh' 
	suffix: 'dr'
	nickname: ''
]>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants