Latinizer v0.1.0 Latinizer View Source

A string-translating module for replacing the regional characters with their closest latin equivalents.

Link to this section Summary

Functions

Replaces specified regional characters with their closest latin equivalent

Link to this section Functions

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

Replaces specified regional characters with their closest latin equivalent.

Returns a string with replaced letters. If the chars argument is specified, only the letters provided in this argument will be replaced.

Examples

Translating with no characters specified:

iex> Latinizer.latinize "gżegżółka"
"gzegzolka"

Translating with specified characters:

iex> Latinizer.latinize "łódeczka", ["ł"]
"lódeczka"

iex> Latinizer.latinize "łódeczka", ["ł", "ó"]
"lodeczka"

iex> Latinizer.latinize "łódeczka", ["ł", "ó", "Ą", "a"]
"lodeczka"