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

error on two joiner words #53

Closed
daryanypl opened this issue Aug 3, 2016 · 7 comments
Closed

error on two joiner words #53

daryanypl opened this issue Aug 3, 2016 · 7 comments
Labels
Milestone

Comments

@daryanypl
Copy link

If a name contains two joiner words one after another, s.a. "John of the Doe", get:
HumanName:ERROR:parser.py:Couldn't find 'The' in pieces.
error.

@derek73
Copy link
Owner

derek73 commented Aug 3, 2016

I cannot replicate this. Could you provide more information to help me replicate?

$ python tests.py "John of the Doe"
<HumanName : [
    title: '' 
    first: 'John of the Doe' 
    middle: '' 
    last: '' 
    suffix: ''
    nickname: ''
]>
$ python tests.py "John of The Doe"
<HumanName : [
    title: '' 
    first: 'John of The Doe' 
    middle: '' 
    last: '' 
    suffix: ''
    nickname: ''
]>

@daryanypl
Copy link
Author

Sure.

from nameparser import HumanName

def test_name(name):
HumanName('Bob, Author of The book of the allies')

I've played around a bit, and it's not all "of the" combinations. For
example,

HumanName('Bob, Author of the book of the allies')
and
HumanName('Bob, Author of The book on allies')
are both fine.

Darya

On Wed, Aug 3, 2016 at 3:58 PM, derek73 notifications@github.com wrote:

I cannot replicate this. Could you provide more information to help me
replicate?

$ python tests.py "John of the Doe"
title: ''
first: 'John of the Doe'
middle: ''
last: ''
suffix: ''
nickname: ''
]>
$ python tests.py "John of The Doe"
title: ''
first: 'John of The Doe'
middle: ''
last: ''
suffix: ''
nickname: ''
]>


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#53 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARcioqvk2I-s9evLOAItsFtAA1yePI3Iks5qcPLygaJpZM4Jb0Zl
.

@derek73 derek73 added the bug label Aug 3, 2016
@derek73 derek73 added this to the v0.4.2 milestone Aug 3, 2016
@derek73
Copy link
Owner

derek73 commented Aug 3, 2016

'Bob, Author of the book of the allies' doesn't give the error, so I think it's related to capitalization of multiple conjunctions when combined with titles. Should be parsed as a title though. That join_on_conjunctions() part of the parse code makes my head melt but I'll poke around and see if I can figure it out.

$ python tests.py "Bob, Author of the book of the allies"
<HumanName : [
    title: '' 
    first: 'Author of the book of the allies' 
    middle: '' 
    last: 'Bob' 
    suffix: ''
    nickname: ''
]>

@daryanypl
Copy link
Author

Happy to help test.

Darya

On Wed, Aug 3, 2016 at 7:45 PM, derek73 notifications@github.com wrote:

'Bob, Author of the book of the allies' doesn't give the error, so I think
it's related to capitalization of multiple conjunctions when combined with
titles. Should be parsed as a title though. That join_on_conjunctions()
part of the parse code makes my head melt but I'll poke around and see if I
can figure it out.

$ python tests.py "Bob, Author of the book of the allies"
<HumanName : [
title: ''
first: 'Author of the book of the allies'
middle: ''
last: 'Bob'
suffix: ''
nickname: ''
]>


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#53 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARciouwdP9JqKWFWEucfHcl-6Lqm0kDmks5qcSgDgaJpZM4Jb0Zl
.

@derek73
Copy link
Owner

derek73 commented Aug 5, 2016

I ended up refactoring that join_on_conjunctions() method entirely because, even though I wrote it, I couldn't understand it. It was one of those "I guess it works so don't fix it" things. But now I think I've got it fixed, all the test are passing.

It's in master now. I think you can install it with pip install -e git+git://github.com/derek73/python-nameparser.git@v0.5.0-beta#egg=nameparser. I also made pre-release v0.5.0-beta if that's easier. Give a try and let me know if you run into any issues.

@derek73
Copy link
Owner

derek73 commented Aug 10, 2016

I'm going to go ahead and close this ticket and make a new release. Let me know if you have any problems with it.

@derek73 derek73 closed this as completed Aug 10, 2016
@daryanypl
Copy link
Author

daryanypl commented Feb 14, 2017 via email

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