Exflect (exflect v0.3.0)
Summary
Functions
Inflects the input word based on the the integer given.
Pluralizes an English word.
Singlarizes an English word.
Functions
Link to this function
inflect(word, n, opts \\ [match_style: false])
@spec inflect(String.t(), pos_integer(), keyword()) :: String.t()
Inflects the input word based on the the integer given.
iex> Exflect.inflect("leaf", 0)
"leaves"
iex> Exflect.inflect("leaf", 1)
"leaf"
iex> Exflect.inflect("leaf", 2)
"leaves"
Also accepts the match_style
option
Link to this function
pluralize(word, opts \\ [match_style: false])
Pluralizes an English word.
iex> Exflect.pluralize("leaf")
"leaves"
Takes the option match_style
if you want it to maintain the current whitespace/case.
iex> Exflect.pluralize(" LEAF ", match_style: true)
" LEAVES "
Link to this function
singularize(text, opts \\ [match_style: false])
Singlarizes an English word.
iex> Exflect.singularize("leaves")
"leaf"
Takes the option match_style
if you want it to maintain the current whitespace/case.
iex> Exflect.singularize(" LEAVES ", match_style: true)
" LEAF "