petrovich_elixir v1.0.0 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
Link to this function
parse(data, type, case_, gender) View Source
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, "Пироговым"}
Link to this function
parse!(data, type, case_, gender) View Source
Pretty much the same as parse/4
, but raises exception instead.
Examples
iex> Parser.parse!("Николай", :firstname, :dative, :male)
"Николаю"
iex> Parser.parse!("Пирогов", :lastname, :instrumental, :male)
"Пироговым"