Latinizer v0.4.0 Latinizer.Diacritics View Source

A module responsible for removing diacritical signs in strings.

Link to this section Summary

Functions

Removes specified diacritical signs from a given string. If no diacritics are specified, all of them will be removed

Link to this section Functions

Link to this function remove_diacritics(string, opts \\ []) View Source
remove_diacritics(binary(), list()) :: binary()

Removes specified diacritical signs from a given string. If no diacritics are specified, all of them will be removed.

Examples

Default usage:

iex> Latinizer.Diacritics.remove_diacritics "langue indo-européenne"
"langue indoeuropeenne"

iex> Latinizer.Diacritics.remove_diacritics "żubrówka"
"zubrowka"

Removing only the specified diacritical signs using the :only keyword:

iex> Latinizer.Diacritics.remove_diacritics "latawiec", only: ["ż", "ą"]
"latawiec"

iex> Latinizer.Diacritics.remove_diacritics "żubrówka", only: ["ż"]
"zubrówka"

iex> Latinizer.Diacritics.remove_diacritics "żubrówka", only: ["ż", "ą"]
"zubrówka"