jasonpriem / HumanNameParser.php

Returns the parts (leading initial, first, middle, last, suffix) of a name from a string.
MIT License
108 stars 41 forks source link

Test suite #8

Closed fulldecent closed 10 years ago

fulldecent commented 10 years ago

Google contacts has EXCELLENT name parsing for all languages.

https://www.google.com/contacts/#contacts

"API" at: https://clients6.google.com/plusi/v2/ozInternal/contactstoremutate?key=AIzaSyBuUpn1wi2-0JpM3S-tq2csYx0z2_m_pqc&alt=json

To illustrate: it knows that 诸葛亮 is last name 诸葛 and first name 亮, but it also knows that 柏夫人 is last name 柏 first name 夫人. This is done without language hinting, and it even recognizes the difference between Chinese and Japanese names, which could even use the same characters.


Although your library does not support it today, I request to add these and other examples to the test suite. The will fail, but it will demonstrate the scope and limits of this library.

jasonpriem commented 10 years ago

I don't have time to do it unfortunately, but if you feel like submitting a PR, go for it! I think if you do, it'll make sense to comment out the test with a note that it doesn't pass...that way users don't have to look at failing tests all the time and think there's a bug (rather than just missing functionality, as is the case...although I get that the difference between the two is often minor...)