Gendex

Hex.pm

Gendex is an Elixir library that will tell you the most likely gender of a person based on first name. It uses the underlying data from the program “gender” by Jorg Michael (described here).

Inspired by Gender Detector.

Installation

First, add Gendex to your mix.exs dependencies:

def deps do
  [{:gendex, "~> 0.1.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:

sh-session $ 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"

Usage

Gendex.lookup("Bob")
#=> :male

Gendex.lookup("Sally")
#=> :female

Gendex.lookup("Pauley")
#=> :androgynous

TODO

  • [] Country specific gender lookup