Unicode.category

You're seeing just the function category, go back to Unicode module for more information.
Link to this function

category(codepoint_or_string)

View Source

Specs

category(codepoint_or_string()) :: atom() | [atom(), ...]

Returns the Unicode category for a codepoint or a list of categories for a string.

Argument

  • codepoint_or_string is a single integer codepoint or a String.t.

Returns

  • in the case of a single codepoint, an atom representing one of the categories listed below

  • in the case of a string, a list representing the category for each codepoint in the string

Notes

THese categories match the names of the Unicode character classes used in various regular expression engines and in Unicode Sets. The full list of categories is:

CategoryMatches
:COther
:CcControl
:CfFormat
:CnUnassigned
:CoPrivate use
:CsSurrogate
:LLetter
:LlLower case letter
:LmModifier letter
:LoOther letter
:LtTitle case letter
:LuUpper case letter
:MMark
:McSpacing mark
:MeEnclosing mark
:MnNon-spacing mark
:NNumber
:NdDecimal number
:NlLetter number
:NoOther number
:PPunctuation
:PcConnector punctuation
:PdDash punctuation
:PeClose punctuation
:PfFinal punctuation
:PiInitial punctuation
:PoOther punctuation
:PsOpen punctuation
:SSymbol
:ScCurrency symbol
:SkModifier symbol
:SmMathematical symbol
:SoOther symbol
:ZSeparator
:ZlLine separator
:ZpParagraph separator
:ZsSpace separator

Note too that the group level categories like :L, :M, :S and so on are not assigned to any codepoint. They can only be identified by combining the results for each of the subsidiary categories.

Examples

iex> Unicode.category 
:Ll

iex> Unicode.category ?A
:Lu

iex> Unicode.category ?🧐
:So

iex> Unicode.category ?+
:Sm

iex> Unicode.category ?1
:Nd

iex> Unicode.category "äA"
[:Ll, :Lu]