petrovich_elixir v0.1.1 Petrovich.Parser View Source
Parser receives the name and case to infect it to.
Then it parses the rules to find the appropriate modifications.
It then calls Applier
to modify the value.
This module should not be used directly. Use Petrovich
module instead.
Link to this section Summary
Link to this section Functions
Parses name and gets modifiers for the given case.
Then it passes the name and modification rules to the Applier
.
Examples
iex> Parser.parse("Николай", :firstname, :dative, :male)
{:ok, "Николаю"}
iex> Parser.parse("Пирогов", :lastname, :instrumental, :male)
{:ok, "Пироговым"}
Pretty much the same as parse/4
, but raises exception instead.
Examples
iex> Parser.parse!("Николай", :firstname, :dative, :male)
"Николаю"
iex> Parser.parse!("Пирогов", :lastname, :instrumental, :male)
"Пироговым"