humanparser icon indicating copy to clipboard operation
humanparser copied to clipboard

Parse name from email

Open miiila opened this issue 9 years ago • 3 comments

Do you consider valuable and meaningful feature for parsing name out of an email address? E.g. [email protected] => Mila Votradovec.

I am willing to contribute, but want to discuss the idea first.

miiila avatar Sep 15 '16 09:09 miiila

Yes, I think that's a great idea. You could just split on . and then join on space delimiter and then run the same name matching function on the string.

parser.parseNameFromEmail = function(email){
    var emailFullName = email.replace(/@.*$/g, '').split('.').join(' ');
    return parser.parseName(emailFullName);
};

You'd have to strip off everything after the @ first.

I'm happy to have this addition. Please include a test.

ralyodio avatar Sep 16 '16 00:09 ralyodio

@chovy I realised this is still here after 2 years :-D I'll try to submit a PR by the end of this week.

miiila avatar Sep 25 '18 14:09 miiila

Sounds good!

ralyodio avatar Sep 25 '18 18:09 ralyodio