Comments on: Splitting names https://onlineaspect.com/2009/08/17/splitting-names/ building stuff on the web with Josh Fraser Thu, 14 May 2015 16:38:07 +0000 hourly 1 By: Jim https://onlineaspect.com/2009/08/17/splitting-names/comment-page-1/#comment-44301 Tue, 10 Jun 2014 20:16:25 +0000 https://onlineaspect.com/?p=431#comment-44301 Josh,

By any chance has the Name Parser been ported to C#?

Sorry to ask but I can't find anything close to what this does and I need it for .Net.

Any help is greatly appreciated,

Jim

]]>
By: Michael Scott McGinn https://onlineaspect.com/2009/08/17/splitting-names/comment-page-1/#comment-20041 Sun, 27 Apr 2014 21:50:33 +0000 https://onlineaspect.com/?p=431#comment-20041 How to solve this one in javascript.
Sort the given array of names by last name and then by first name so they return the array as the result target.

//beginning
var= aNames = ['Gabriel Ba','John Adams','Kieth Richards','Prince','John Adams McKensie'];
//result target
var= aNames = ['John Adams','Gabriel Ba','John Adams McKensie','Prince','Kieth Richards'];

]]>
By: Josh Fraser https://onlineaspect.com/2009/08/17/splitting-names/comment-page-1/#comment-1226 Fri, 10 Sep 2010 22:25:08 +0000 https://onlineaspect.com/?p=431#comment-1226 In reply to Jason Priem.

Nice! Thanks for sharing. One thing I've realized is that proper parsing varies a lot on the context of where the names came from and how they are being used. For example, in my use-case, anything in parenthesis should be ignored — in yours, it's a nickname. I guess, ideally we should write a class where people can change that behavior w/ a single variable to customize it for their own purposes. Let me know if you're interested. Perhaps we could combine forces to see what we could come up with.

]]>
By: Jason Priem https://onlineaspect.com/2009/08/17/splitting-names/comment-page-1/#comment-1223 Tue, 07 Sep 2010 18:44:07 +0000 https://onlineaspect.com/?p=431#comment-1223 Hey Josh, nice work. I just finished writing something similar, along with a test suite of names. It does pretty much what yours does, although it's object-oriented and captures nicknames and first-initials separately. Here are a few names your lib misses that HumanNameParser.php parses correctly:
George (gob) bluth // gets "gob" as a nickname (not part of first name)
smith, john // reverses around the comma
carlos garcia y luz // gets "garcia y luz" as a last name
e.e. cummings // keeps original capitalization

I like your idea of matching all middle names as part of the first name; that way you never miss names like 'Billie Jo'. However, I'd argue that this is less of a problem than always treating middle names as parts of first names, since it's far more common to have a single-word first name. My lib is at GitHub, and of course it's open, so take or fork anything you like.

]]>
By: Josh Fraser https://onlineaspect.com/2009/08/17/splitting-names/comment-page-1/#comment-640 Tue, 18 Aug 2009 20:06:11 +0000 https://onlineaspect.com/?p=431#comment-640 In reply to Pete Warden.

Glad you found this useful and good catch on the parentheses issue. Perhaps you can merge in your code for handling last name, first name? That's definitely a common use-case that I missed. I've set up Google Code and given you commit access at http://code.google.com/p/php-name-parser/.

]]>
By: Pete Warden https://onlineaspect.com/2009/08/17/splitting-names/comment-page-1/#comment-638 Tue, 18 Aug 2009 15:16:39 +0000 https://onlineaspect.com/?p=431#comment-638 That rocks, thanks Josh! I have very similar problems, but nowhere near so comprehensive a solution.

In my case I'm trying to canonicalize display names from email address headers. One common case is that the name will appear as "Warden, Pete" – I try to detect and flip those, but I'm guessing that's not an issue for your data set? Also there's sometimes multiple words inside the parentheses, eg "Pete Warden (Mailana Inc)", but from inspection it looks like you're only catching the first word with your parentheses check?

I'd love to see this on Google Code, there's some other functionality I'm working on that might fit here, like gender guessing from first names:
http://search.cpan.org/~edaly/Text-GenderFromName

]]>