Unicode.GeneralCategory (Unicode v1.12.0) View Source
Functions to introspect Unicode general categories for binaries (Strings) and codepoints.
Link to this section Summary
Functions
Returns a map of aliases for Unicode categories.
Returns the map of Unicode character categories.
Returns the category name(s) for the given binary or codepoint.
Return the count of characters in a given category.
Returns the Unicode ranges for a given category as a list of ranges as 2-tuples.
Returns the Unicode ranges for a given category as a list of ranges as 2-tuples.
Returns a list of known Unicode category names.
Link to this section Functions
Returns a map of aliases for Unicode categories.
An alias is an alternative name
for referring to a category. Aliases
are resolved by the fetch/1
and
get/1
functions.
Returns the map of Unicode character categories.
The category name is the map key and a list of codepoint ranges as tuples as the value.
Returns the category name(s) for the given binary or codepoint.
In the case of a codepoint, a single category name is returned.
For a binary a list of distinct category names represented by the graphemes in the binary is returned.
Only concrete general categories are considered, derived categories (:all, :ascii, :assigned etc) are not considered.
Return the count of characters in a given category.
Example
iex> Unicode.GeneralCategory.count(:Ll)
2227
iex> Unicode.GeneralCategory.count(:Nd)
660
Returns the Unicode ranges for a given category as a list of ranges as 2-tuples.
Aliases are resolved by this function.
Returns either {:ok, range_list}
or
:error
.
Returns the Unicode ranges for a given category as a list of ranges as 2-tuples.
Aliases are resolved by this function.
Returns either range_list
or
nil
.
Returns a list of known Unicode category names.
This function does not return the names of any category aliases.