Elixir library to inflect Russian first, last, and middle names
Russian language is hard. Inflecting names in Russian is even harder.
Make it simple with: https://github.com/petrovich/petrovich_elixir
Here’s a brief example:
Petrovich.firstname!("Александр", :accusative)
# => Александра
Petrovich.middlename!("Сергеевич", :accusative)
# => Сергеевича
Petrovich.lastname!("Пушкин", :accusative, :male)
# => Пушкина
Petrovich
can also detect gender by person’s name. It is very simple too:
alias Petrovich.Detector
Detector.detect_gender("Александр", :firstname)
# => {:ok, "male"}
Detector.detect_gender("Александра", :firstname)
# => {:ok, "female"}
Check it out! And learn Russian if don’t know it yet.
Read next Screencast: TDD Elixir command-line application with ExUnit