Gendex is an Elixir library that will tell you the most likely gender of a person based on their first name. It uses a UTF-8 encoded version of the underlying data from the program "gender" by Jorg Michael (described here).
Inspired by Gender Detector.
First, add Gendex to your mix.exs
dependencies:
def deps do
[{:gendex, "~> 0.5.0"}]
end
And start the Gendex application. For most projects (such as
Phoenix apps) this will mean adding :gendex
to the list of applications in
mix.exs
.
def application do
[mod: {MyApp, []},
applications: [:gendex, :other_apps...]]
end
Then, update your dependencies:
$ mix deps.get
Optionally, you can also set the path to your own nam_dict.txt
(utf8 encoded)
by adding this to your config:
config :gendex, dict_path: "/path/to/custom/dict"
Gendex.lookup("Bob")
#=> :male
Gendex.lookup("Sally")
#=> :female
Gendex.lookup("Pauley")
#=> :unisex
- Country specific gender lookup