Unicode character database for MoonBit: general category, bidi class, numeric type, binary properties, full case mapping and folding, generated from the UCD.
@moonucd.category('Dž') // Lt
@moonucd.has('中', Alphabetic) // true
@moonucd.numeric('٣') // Some(Decimal)
@moonucd.upper("straße") // "STRASSE"
@moonucd.lower("ΟΔΟΣ") // "οδος"
@moonucd.fold("Straße") == @moonucd.fold("STRASSE") // truemoon add moonbitstack/moonucd| Call | Answers |
|---|---|
| category(ch) | its General_Category, one of 30 two-letter values; unassigned code points are Cn |
| bidi(ch) | its Bidi_Class, with the defaults Unicode gives unassigned code points |
| numeric(ch) | Decimal, Digit or Numeric for characters with a numeric value, else None |
| has(ch, property) | whether it has one of 44 binary properties: Alphabetic, Uppercase, Lowercase, Cased, CaseIgnorable, WhiteSpace, XidStart, XidContinue, Math, Dash, Ideographic, RegionalIndicator… |
| Call | Does |
|---|---|
| upper(text) | full uppercase mapping: ß becomes SS, ffi becomes FFI |
| lower(text) | full lowercase mapping; a capital sigma ending a word becomes ς |
| title(text) | each character to its titlecase form: dž becomes Dž; which characters start a word is the caller's call |
| fold(text) | full case folding, for comparing text without regard to case |
pub(all) enum Bidi {
L
R
AL
EN
ES
ET
AN
CS
NSM
BN
B
S
WS
ON
LRE
LRO
RLE
RLO
PDF
LRI
RLI
FSI
PDI
} derive(Eq)pub(all) enum Category {
Lu
Ll
Lt
Lm
Lo
Mn
Mc
Me
Nd
Nl
No
Pc
Pd
Ps
Pe
Pi
Pf
Po
Sm
Sc
Sk
So
Zs
Zl
Zp
Cc
Cf
Cs
Co
Cn
} derive(Eq)pub(all) enum Property {
Alphabetic
Lowercase
Uppercase
Cased
CaseIgnorable
ChangesWhenLowercased
ChangesWhenUppercased
ChangesWhenTitlecased
ChangesWhenCasefolded
ChangesWhenCasemapped
IdStart
IdContinue
XidStart
XidContinue
DefaultIgnorableCodePoint
GraphemeExtend
GraphemeBase
Math
WhiteSpace
BidiControl
JoinControl
Dash
Hyphen
QuotationMark
TerminalPunctuation
HexDigit
AsciiHexDigit
Ideographic
Diacritic
Extender
NoncharacterCodePoint
IdsBinaryOperator
IdsTrinaryOperator
Radical
UnifiedIdeograph
Deprecated
SoftDotted
LogicalOrderException
SentenceTerminal
VariationSelector
PatternWhiteSpace
PatternSyntax
PrependedConcatenationMark
RegionalIndicator
} derive(Eq)fn fold(text : StringView) -> Stringfn lower(text : StringView) -> Stringfn title(text : StringView) -> Stringfn upper(text : StringView) -> Stringfn version() -> StringInstall
Download zipUnicode character database for MoonBit: general category, bidi class, numeric type, binary properties, full case mapping and folding, generated from the UCD.