Functions to introspect the Unicode Hangul_Syllable_Type property for binaries (Strings) and codepoints.
The Hangul_Syllable_Type property classifies Hangul jamo and precomposed syllables. The values are :l (Leading_Jamo), :v (Vowel_Jamo), :t (Trailing_Jamo), :lv (LV_Syllable) and :lvt (LVT_Syllable). Codepoints that are not Hangul have the value :na (Not_Applicable).
The primary API is hangul_syllable_type/1 which returns the type of a codepoint, or the list of types of a string.
Summary
Functions
Returns a map of aliases for Unicode hangul syllable types.
Returns the count of the codepoints with a given hangul syllable type.
Returns the Unicode codepoint ranges for a given hangul syllable type.
Returns the Unicode codepoint ranges for a given hangul syllable type.
Returns the hangul syllable type of the given binary or codepoint.
Returns the map of Unicode hangul syllable types.
Returns a list of known Unicode hangul syllable type names.
Functions
Returns a map of aliases for Unicode hangul syllable types.
Returns
- A map where the alias string is the key and the hangul syllable type is the value.
Examples
iex> Unicode.HangulSyllableType.aliases() |> Map.get("leadingjamo")
:l
Returns the count of the codepoints with a given hangul syllable type.
Aliases are resolved by this function.
Arguments
hangul_syllable_typeis any type name or alias, as an atom or string.
Returns
A non-negative integer count of the codepoints with the hangul syllable type.
:errorif the hangul syllable type is not known.
Examples
iex> Unicode.HangulSyllableType.count(:lv)
399
Returns the Unicode codepoint ranges for a given hangul syllable type.
Aliases are resolved by this function.
Arguments
hangul_syllable_typeis any type name or alias, as an atom or string.
Returns
{:ok, range_list}whererange_listis a list of codepoint ranges as 2-tuples.:errorif the hangul syllable type is not known.
Examples
iex> Unicode.HangulSyllableType.fetch(:lv) |> elem(0)
:ok
iex> Unicode.HangulSyllableType.fetch(:invalid)
:error
Returns the Unicode codepoint ranges for a given hangul syllable type.
Aliases are resolved by this function.
Arguments
hangul_syllable_typeis any type name or alias, as an atom or string.
Returns
A list of codepoint ranges as 2-tuples.
nilif the hangul syllable type is not known.
Examples
iex> Unicode.HangulSyllableType.get(:invalid)
nil
Returns the hangul syllable type 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, a single type atom is returned. Non-Hangul codepoints return
:na.For a binary, a list of the distinct types of the codepoints in the binary is returned.
Examples
iex> Unicode.HangulSyllableType.hangul_syllable_type(0xAC00)
:lv
iex> Unicode.HangulSyllableType.hangul_syllable_type(?A)
:na
Returns the map of Unicode hangul syllable types.
Returns
- A map where the hangul syllable type is the key and a list of codepoint ranges as 2-tuples is the value.
Examples
iex> :lv in Map.keys(Unicode.HangulSyllableType.hangul_syllable_types())
true
Returns a list of known Unicode hangul syllable type names.
Returns
- A list of atom hangul syllable type names.
Examples
iex> :lvt in Unicode.HangulSyllableType.known_hangul_syllable_types()
true