ucd

    Unicode Character Database lookup and case mapping for MoonBit

    unicode
    ucd
    case-mapping
    general-category
    Download zip
    Version
    0.5.0
    License
    Apache-2.0
    Last updated
    18 days ago
    Downloads
    457

    #ucd

    Unicode Character Database lookup, general categories, identifier properties, and case mapping for MoonBit. This module uses Unicode 16.0.0 data.

    moon add moonbit-community/ucd

    See the repository root README for API documentation and examples.

    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)

    Unicode General_Category values (two-letter categories) See UAX #44: https://www.unicode.org/reports/tr44/#General_Category_Values

    GeneralCategory::group

    Get the major category group (single-letter category) for a GeneralCategory

    GeneralCategoryGroup

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

    Unicode General_Category major class (single-letter categories) See UAX #44: https://www.unicode.org/reports/tr44/#General_Category_Values

    general_category

    fn general_category(c : Char) -> GeneralCategory

    Get the General_Category for a character

    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"