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.
Link to this function

generate_transliteration_map(from, to)

View Source

Generate a transliteration map between two character classes

Arguments

  • from is any String.t() intended to represent the digits of a number system but thats not a requirement.

  • to is any String.t() that is the same length as from 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 in to 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"}}