unicode

Branch: main

Switch branches or tags

Branch: main
Go to file t

413 files indexed

History
Code

ucd/README.md

unicode-data

Unicode Character Database lookup, general categories, East Asian width, line break classes, joining types and groups, Hangul syllable types, binary properties (White_Space, Alphabetic, Lowercase, Uppercase, XID_Start, XID_Continue, Default_Ignorable_Code_Point, Grapheme_Extend, Regional_Indicator, Prepended_Concatenation_Mark, Emoji_Presentation, Emoji_Modifier, Emoji_Modifier_Base, Extended_Pictographic), emoji variation sequences, and case mapping for MoonBit. This module uses Unicode 18.0.0 data.

moon add moonbit-community/unicode-data

See the repository root README for API documentation and examples.

Low-level data packages

Import the package for the lookup you need. Each package owns its generated tables and exposes lookup functions; the tables themselves remain private.

Package under moonbit-community/unicode-data/ Lookups
decomposition Canonical and compatibility decomposition mappings
composition Composition pairs and composition exclusions
ccc Canonical Combining Class
general_category General Category ordinal and is_mark
punctuation General_Category group P (punctuation)
east_asian_width East_Asian_Width ordinal
case_mapping Simple and full uppercase, lowercase, and titlecase mappings, of characters and of strings
xid XID_Start and XID_Continue
alphabetic Alphabetic
lowercase Lowercase
uppercase Uppercase
white_space White_Space
default_ignorable_code_point Default_Ignorable_Code_Point
grapheme_extend Grapheme_Extend
regional_indicator Regional_Indicator
prepended_concatenation_mark Prepended_Concatenation_Mark
emoji Extended_Pictographic, Emoji_Presentation, Emoji_Modifier, Emoji_Modifier_Base, and the characters starting an emoji variation sequence
joining_type Joining_Type ordinal
joining_group Joining_Group ordinal
hangul_syllable_type Hangul_Syllable_Type ordinal
line_break Line_Break ordinal

moonbit-community/unicode-data/data remains a compatibility package that re-exports the old lookup functions with deprecation notices pointing to these packages. The high-level moonbit-community/unicode-data interface is unchanged: its general_category(c) returns GeneralCategory, with GeneralCategoryGroup available through .group(). These enums remain defined in the root package. The low-level general_category package retains lookup_general_category(c) -> Int, returning the existing 0–29 category ordinals.

1# unicode-data23Unicode Character Database lookup, general categories, East Asian width,4line break classes, joining types and groups, Hangul syllable types, binary5properties (White_Space, Alphabetic, Lowercase, Uppercase, XID_Start,6XID_Continue, Default_Ignorable_Code_Point, Grapheme_Extend,7Regional_Indicator, Prepended_Concatenation_Mark, Emoji_Presentation,8Emoji_Modifier, Emoji_Modifier_Base, Extended_Pictographic), emoji variation sequences, and case9mapping for MoonBit. This module uses Unicode 18.0.0 data.1011```bash12moon add moonbit-community/unicode-data13```1415See the repository root README for API documentation and examples.1617## Low-level data packages1819Import the package for the lookup you need. Each package owns its generated20tables and exposes lookup functions; the tables themselves remain private.2122| Package under `moonbit-community/unicode-data/` | Lookups |23| --- | --- |24| `decomposition` | Canonical and compatibility decomposition mappings |25| `composition` | Composition pairs and composition exclusions |26| `ccc` | Canonical Combining Class |27| `general_category` | General Category ordinal and `is_mark` |28| `punctuation` | General_Category group P (punctuation) |29| `east_asian_width` | East_Asian_Width ordinal |30| `case_mapping` | Simple and full uppercase, lowercase, and titlecase mappings, of characters and of strings |31| `xid` | XID_Start and XID_Continue |32| `alphabetic` | Alphabetic |33| `lowercase` | Lowercase |34| `uppercase` | Uppercase |35| `white_space` | White_Space |36| `default_ignorable_code_point` | Default_Ignorable_Code_Point |37| `grapheme_extend` | Grapheme_Extend |38| `regional_indicator` | Regional_Indicator |39| `prepended_concatenation_mark` | Prepended_Concatenation_Mark |40| `emoji` | Extended_Pictographic, Emoji_Presentation, Emoji_Modifier, Emoji_Modifier_Base, and the characters starting an emoji variation sequence |41| `joining_type` | Joining_Type ordinal |42| `joining_group` | Joining_Group ordinal |43| `hangul_syllable_type` | Hangul_Syllable_Type ordinal |44| `line_break` | Line_Break ordinal |4546`moonbit-community/unicode-data/data` remains a compatibility package that re-exports47the old lookup functions with deprecation notices pointing to these packages.48The high-level `moonbit-community/unicode-data` interface is unchanged: its49`general_category(c)` returns `GeneralCategory`, with `GeneralCategoryGroup`50available through `.group()`. These enums remain defined in the root package.51The low-level `general_category` package retains52`lookup_general_category(c) -> Int`, returning the existing 0–29 category53ordinals.54