unicode

    Unicode in MoonBit

    unicode
    bidi
    idna
    nfc
    nfd
    nfkc
    nfkd
    punycode
    Download zip
    Version
    0.5.2
    License
    Apache-2.0
    Last updated
    6 days ago
    Downloads
    669

    #unicode

    moonbit-community/unicode is the compatibility umbrella for the Unicode library that is split into independently consumable modules. It preserves the original package paths for existing users by forwarding to the feature modules.

    The generated tables target Unicode 16.0.0.

    #Packages

    PackageContents
    moonbit-community/unicodeGeneral_Category, XID_Start/XID_Continue, and case mapping
    moonbit-community/unicode/normalizationNormalization Forms from UAX #15
    moonbit-community/unicode/punycodePunycode from RFC 3492
    moonbit-community/unicode/bidiBidirectional algorithm from UAX #9
    moonbit-community/unicode/idnaIDNA processing from UTS #46

    New code should depend on the feature module it needs directly:

    moon add moonbit-community/ucd moon add moonbit-community/normalization moon add moonbit-community/punycode moon add moonbit-community/bidi moon add moonbit-community/idna

    See the repository README for the full API reference, development commands, and release instructions.

    GeneralCategory

    pub(all) enum GeneralCategory {
    Lu
    Ll
    Lt
    Lm
    Lo
    Mn
    Mc
    Me
    Nd
    Nl
    No
    Zs
    Zl
    Zp
    Pc
    Pd
    Ps
    Pe
    Pi
    Pf
    Po
    Sm
    Sc
    Sk
    So
    Cc
    Cf
    Cs
    Co
    Cn
    } derive(Eq)

    GeneralCategory::equal

    GeneralCategory::group

    GeneralCategory::not_equal

    fn GeneralCategory::not_equal(x : GeneralCategory, y : GeneralCategory) -> Bool

    GeneralCategory::output

    fn GeneralCategory::output(self : GeneralCategory, logger : &Logger) -> Unit

    GeneralCategory::to_string

    fn GeneralCategory::to_string(self : GeneralCategory) -> String

    GeneralCategoryGroup

    pub(all) enum GeneralCategoryGroup {
    L
    M
    N
    Z
    P
    S
    C
    } derive(Eq,
    Debug
    )

    GeneralCategoryGroup::equal

    GeneralCategoryGroup::not_equal

    GeneralCategoryGroup::output

    fn GeneralCategoryGroup::output(self : GeneralCategoryGroup, logger : &Logger) -> Unit

    GeneralCategoryGroup::to_string

    fn GeneralCategoryGroup::to_string(self : GeneralCategoryGroup) -> String

    general_category

    fn general_category(c : Char) -> GeneralCategory

    is_xid_continue

    fn is_xid_continue(c : Char) -> Bool

    Check whether a character has the Unicode XID_Continue property.

    XID_Continue is the recommended continuation class for Unicode default identifiers and includes every XID_Start character.

    is_xid_start

    fn is_xid_start(c : Char) -> Bool

    Check whether a character has the Unicode XID_Start property.

    XID_Start is the recommended start class for Unicode default identifiers.

    to_lowercase

    fn to_lowercase(c : Char) -> String

    Get the full lowercase mapping for a character Returns a String containing one or more lowercase characters For example, 'İ' (U+0130) maps to "i\u{0307}" (i with combining dot above)

    to_simple_lowercase

    fn to_simple_lowercase(c : Char) -> Char

    Get the simple lowercase mapping for a character Returns the character itself if no mapping exists

    to_simple_titlecase

    fn to_simple_titlecase(c : Char) -> Char

    Get the simple titlecase mapping for a character Returns the character itself if no mapping exists

    to_simple_uppercase

    fn to_simple_uppercase(c : Char) -> Char

    Get the simple uppercase mapping for a character Returns the character itself if no mapping exists

    to_titlecase

    fn to_titlecase(c : Char) -> String

    Get the full titlecase mapping for a character Returns a String containing one or more titlecase characters For example, 'ß' (U+00DF) maps to "Ss", and 'ffi' (U+FB03) maps to "Ffi"

    to_uppercase

    fn to_uppercase(c : Char) -> String

    Get the full uppercase mapping for a character Returns a String containing one or more uppercase characters For example, 'ß' (U+00DF) maps to "SS", and 'ffi' (U+FB03) maps to "FFI"

    Source Files