derek73 / python-nameparser

A simple Python module for parsing human names into their individual components
http://nameparser.readthedocs.org/en/latest/
Other
653 stars 104 forks source link

How to change the order! #135

Closed AmericanY closed 1 year ago

AmericanY commented 2 years ago

I do have a name like the following:

SIMS JEANNETTE MAXINE BISHOP

Last , First , Middle

First: Jeannette Last: Sims Middle: Maxine Bishop

Is there a way to change the order?

derek73 commented 2 years ago

Unfortunately I'm not sure how much the parser can help with this. The parser requires a comma after the last name to parse that format. Without it, you might be better off writing your own logic for your dataset.

The only things that might be helpful are maybe the logic for joining conjunctions. It probably won't recognize titles if they are not in the expected position.

I guess you could try running the parser on the names and at least it would join the conjunctions and put the words together in a bucket. Then maybe you could re-order the name parts so that the first name became the last name? Probably won't work great but, maybe will get the name parts joined together like the parser does. Not sure how useful it would be though.