Cldr.Number.System.generate_transliteration_map
You're seeing just the function
generate_transliteration_map
, go back to Cldr.Number.System module for more information.
Generate a transliteration map between two character classes
Arguments
from
is anyString.t()
intended to represent the digits of a number system but thats not a requirement.to
is anyString.t()
that is the same length asfrom
intended to represent the digits of a number system.
Returns
A map where the keys are the graphemes in
from
and the values are the graphemes into
or{:error, {exception, reason}}
Examples
iex> Cldr.Number.System.generate_transliteration_map "0123456789", "9876543210"
%{
"0" => "9",
"1" => "8",
"2" => "7",
"3" => "6",
"4" => "5",
"5" => "4",
"6" => "3",
"7" => "2",
"8" => "1",
"9" => "0"
}
iex> Cldr.Number.System.generate_transliteration_map "0123456789", "987654321"
{:error,
{ArgumentError, "\"0123456789\" and \"987654321\" aren't the same length"}}