petrovich_elixir v0.1.0 Petrovich.Detector View Source
Guesses the gender by person’s name.
Link to this section Summary
Functions
Detects a gender by name
Link to this section Functions
Detects a gender by name.
This function receives two arguments:
name
raw person’s name in nomenative casetype
which shows what part of person’s name it is
On success it returns a tuple {:ok, "detected_gender"}
.
Or :error
in cases when it is impossible to detect gender.
Examples
iex> Detector.detect_gender("Игорь", :firstname)
{:ok, "male"}
iex> Detector.detect_gender("Саша", :firstname)
{:ok, "androgynous"}
iex> Detector.detect_gender("123", :firstname)
:error