Compiled lookup tables, and the accessors the engine matches through.
A table is %{max_key_len: n, rules: %{key_graphemes => branches}, classes: %{...}}
where branches is an ordered list of {conditions, output} and the last entry has
conditions == [] (the required default).
Keys are stored as grapheme lists, not binaries, so matching never has to
re-segment. That is also how match_at/2 stays a plain prefix comparison instead of
a byte-level match that would need to re-verify cluster boundaries afterwards.
The data comes from LocaleSlug.GeneratedTables, which is produced from the YAML in
priv/ by mix locale_slug.gen and committed. Consumers of the package therefore
need no YAML parser and no dependencies at all.
Summary
Functions
The L0 base table.
Members of a named character class in table, as a MapSet of graphemes.
Metadata (status, source, reviewers) for a locale or schema id.
An L2 locale table by tag, or nil.
Every locale tag that ships.
Every rule in table whose key matches at the head of graphemes.
Every schema id that ships.
An L1 script table by schema id, or nil.
Types
Functions
@spec base() :: t()
The L0 base table.
Members of a named character class in table, as a MapSet of graphemes.
@spec info(String.t()) :: LocaleSlug.table_info() | nil
Metadata (status, source, reviewers) for a locale or schema id.
An L2 locale table by tag, or nil.
@spec locales() :: [String.t()]
Every locale tag that ships.
@spec match_at(t() | nil, [String.t()]) :: [{pos_integer(), [{list(), String.t()}]}]
Every rule in table whose key matches at the head of graphemes.
Returns [{key_length, branches}], unordered — the engine ranks them.
@spec schemas() :: [String.t()]
Every schema id that ships.
An L1 script table by schema id, or nil.