# `Unicode.GeneralCategory`
[🔗](https://github.com/elixir-unicode/unicode/blob/v1.21.1/lib/unicode/category.ex#L1)

Functions to introspect Unicode
general categories for binaries
(Strings) and codepoints.

# `aliases`

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.

# `categories`

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.

# `category`

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.

# `count`

Return the count of characters in a given
category.

## Example

    iex> Unicode.GeneralCategory.count(:Ll)
    2283

    iex> Unicode.GeneralCategory.count(:Nd)
    770

# `fetch`

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`.

# `get`

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`.

# `known_categories`

Returns a list of known Unicode
category names.

This function does not return the
names of any category aliases.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
