Functions to introspect the Unicode NFKD_Quick_Check property for binaries (Strings) and codepoints.
The NFKD_Quick_Check property is used by the quick check algorithm of UAX #15 to determine whether a string is already in Normalization Form KD. The value is :no; codepoints that are always allowed in NFKD have the default value :yes.
The primary API is nfkd_quick_check/1 which returns the value of a codepoint, or the list of values of a string.
Summary
Functions
Returns a map of aliases for NFKD_Quick_Check values.
Returns the count of the codepoints with a given NFKD_Quick_Check value.
Returns the codepoint ranges for a given NFKD_Quick_Check value.
Returns the codepoint ranges for a given NFKD_Quick_Check value.
Returns a list of known NFKD_Quick_Check values.
Returns the map of NFKD_Quick_Check values to codepoint ranges.
Returns the NFKD_Quick_Check value of the given binary or codepoint.
Functions
Returns a map of aliases for NFKD_Quick_Check values.
Returns
- A map where the alias string is the key and the value is the atom value.
Examples
iex> Unicode.NfkdQuickCheck.aliases() |> Map.get("n")
:no
Returns the count of the codepoints with a given NFKD_Quick_Check value.
Aliases are resolved by this function.
Arguments
valueis any value name or alias, as an atom or string.
Returns
A non-negative integer count of the codepoints with the value.
:errorif the value is not known.
Examples
iex> is_integer(Unicode.NfkdQuickCheck.count(:no))
true
Returns the codepoint ranges for a given NFKD_Quick_Check value.
Aliases are resolved by this function.
Arguments
valueis any value name or alias, as an atom or string.
Returns
{:ok, range_list}whererange_listis a list of codepoint ranges as 2-tuples.:errorif the value is not known.
Examples
iex> Unicode.NfkdQuickCheck.fetch(:no) |> elem(0)
:ok
iex> Unicode.NfkdQuickCheck.fetch(:invalid)
:error
Returns the codepoint ranges for a given NFKD_Quick_Check value.
Aliases are resolved by this function.
Arguments
valueis any value name or alias, as an atom or string.
Returns
A list of codepoint ranges as 2-tuples.
nilif the value is not known.
Examples
iex> Unicode.NfkdQuickCheck.get(:invalid)
nil
Returns a list of known NFKD_Quick_Check values.
Returns
- A list of atom values.
Examples
iex> :no in Unicode.NfkdQuickCheck.known_nfkd_quick_check()
true
Returns the map of NFKD_Quick_Check values to codepoint ranges.
Returns
- A map where the quick check value (
:no) is the key and a list of codepoint ranges as 2-tuples is the value.
Examples
iex> Unicode.NfkdQuickCheck.nfkd_quick_check() |> Map.keys() |> Enum.sort()
[:no]
Returns the NFKD_Quick_Check value of the given binary or codepoint.
Arguments
string_or_codepointis either a binary (String) or a codepoint in the range0..0x10FFFF.
Returns
For a codepoint,
:noor the default:yes.For a binary, a list of the distinct values of the codepoints in the binary is returned.
Examples
iex> Unicode.NfkdQuickCheck.nfkd_quick_check(?A)
:yes
iex> Unicode.NfkdQuickCheck.nfkd_quick_check(0x00C0)
:no