I like your brute-force solution, it can be used to preselect a gender-field in many cases.
Do you think it would be useful to have a self-updating array of names, I mean _if_ the user changes the guessed gender, the system will save the name with the user-selected gender?
That way the system would become better at guessing after some time.
Another thread mentioned AI, I have been working with AI a little bit. What you need is a big data-set to train the AI. An AI could identify patterns as you have, I mean it could have a predefined set of patterns to identify "sounds" or common character-combinations.
It could then see that certain patterns or order of patterns always seem to belong to a certain gender.
This would also be a brute-force solution where it assigns a pattern or a set of patterns to a certain gender, but a bit more adaptive.
Example: "Carina" - The ending "a" is a good indicator for Swedish female names. The AI could detect this by purely comparing "facts" from the database of names, that lot's of names ending with 'a' is indeed stored as a female name.
...This is much like you have implemented it already! The difference would be that the AI could detect new patterns by itself. Otherwise, you will need to expand the list of rules you have forever.
Peter Kahl - 2017-07-27 22:59:42 - In reply to message 1 from Jon Lennryd
I like your AI idea and it is definitely something I should be thinking about in the coming months.
The thing about names, these days, that females choose male names and vice versa. I see it all the time. So the system will never be perfect and cannot be 100% relied upon. This library just attempts to guess gender. For situation where gender must be known accurately, it's best to ask the subject.