derek73 / python-nameparser

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

Adding ability to use prefixes with first and middle name #150

Open sdwailah opened 8 months ago

sdwailah commented 8 months ago

Hello First of all, thank you for developing such a fantastic project. I'm using it to parse names in a mixed Arabic and English context, and it works great for most cases. However, I've encountered an issue with parsing Arabic names that contain a space

While parsing works seamlessly for names like "abdulsalam ahmed salem," names like "abdul salam ahmed salem" are misinterpreted.

Example:

Input: "abdul salam ahmed salem" Expected Output:

Actual Output:

derek73 commented 8 months ago

This is an issue with any language that has a plural concept of "first" name. For the parser, first name is regarding position only. The parser has no way to know if someone considers the second name to be still part of their "first" name. There is no rule-based way to decide to put the second name in the first name bucket instead of the middle names bucket.

sdwailah commented 8 months ago

Hello @derek73 Thanks for your reply Me as native Arabic speaker, actually the are rule-based for 2 part firist name and middle name like for example Abdul salam or Abdulsalam Abdul allah or Abdullah all above is the same name Any name start with "Abdul" is 2 part name and I can work with you on this case if you would like to and we could come up with many roles regarding this issue