Discuss Algorithm to Detect Gender(m/f) from Name in the C Programming forum on Dev Shed. Algorithm to Detect Gender(m/f) from Name C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems.
Time spent in forums: 7 m 21 sec
Reputation Power: 0
Algorithm to Detect Gender(m/f) from Name
Actually I am developing an application in which I want a feature by which the application can detect whether any name is male or female name.
I did Google search on this, but could not find any algorithm/code by which I can do it.
So finally I found a website which is doing the same thing pretty good.
So I was thinking to use their API in my application. But Actually I am looking for an algorithm that can be used to do the same.
But before that just wanted to how they are detecting the gender from name?? Is it really possible to do it algorithmically??If yes please suggest some docs/links.
Time spent in forums: 1 Month 4 Days 3 h 30 m 19 sec
Reputation Power: 1801
No, of course it is not possible - not from the name alone. The only viable method (and the means by which the website you referenced no doubt does it), is by look-up. You need a large database or list of all boys names and all girls names, and you simply look up the name.
The only real "algorithm" to be applied is perhaps one for efficient search. The difficult part is perhaps how to obtain a suitable database or name list. Be aware also that some names are applicable to both genders and may even be a girls name in one language or culture, but a boys in another.
Even then, there is nothing stopping fans of Johnny Cash for example from naming their boy "Sue", so all you can say about any name is that it is "traditionally" or "predominantly" applied to one gender or another.
Also in modern culture many "invented" given names occur, named for example after Cities (e.g. "Brooklyn") or cars (e.g. Mercedes), and whether such names apply to a boy or a girl is entirely the decision of the parent - there's no algorithm for that!
What were you expecting!? Perhaps if you add the ASCII character codes for each letter of the name, odd numbers are girls and even numbers are boys.
Time spent in forums: 3 Days 12 h 33 m 32 sec
Reputation Power: 36
The best I can think of is choosing the gender of the "closest" name you can find in your lookup. Perhaps adding phonetic or audio data for each name and asking for phonetic/audio input could be an approach, and allow you to either find the exact name and its gender (if it isn't gender neutral like a car or a city) or to pick the gender of the nearest match.
Though there are names of opposite genders which "rhyme":
Bonnie (F), Donnie (M), Ronnie (M), Connie (F)
so even that wouldn't really work. All I can really say is good luck.