Defines the behaviour required of modules that serve a Unicode property.
A property server maps property values to lists
of codepoint ranges and resolves property value
aliases. Modules implementing this behaviour
include Unicode.Script, Unicode.Block,
Unicode.GeneralCategory and Unicode.Property.
Summary
Callbacks
Returns a map of aliases for the property values served by the implementing module.
Returns the number of codepoints that have the given property value.
Returns {:ok, codepoint_list} for the given property
value or an error indication if the property value is not known.
Returns the list of codepoint ranges for the given
property value or nil if the property value is not known.
Types
@type codepoint_list() :: [codepoint_tuple(), ...]
@type codepoint_tuple() :: {pos_integer(), pos_integer()}
@type property() :: String.t() | atom() | pos_integer()
Callbacks
@callback aliases() :: map()
Returns a map of aliases for the property values served by the implementing module.
@callback count(property()) :: pos_integer()
Returns the number of codepoints that have the given property value.
@callback fetch(property()) :: {:ok, codepoint_list()} | nil
Returns {:ok, codepoint_list} for the given property
value or an error indication if the property value is not known.
Property value aliases are resolved.
@callback get(property()) :: codepoint_list() | nil
Returns the list of codepoint ranges for the given
property value or nil if the property value is not known.
Property value aliases are resolved.