GeneralCategory enumv0.1.0
The Unicode general category, one per scalar value.
pub enum GeneralCategory: int32 {
Unassigned = 0,
UppercaseLetter = 1,
LowercaseLetter = 2,
TitlecaseLetter = 3,
ModifierLetter = 4,
OtherLetter = 5,
NonspacingMark = 6,
SpacingMark = 7,
EnclosingMark = 8,
DecimalNumber = 9,
LetterNumber = 10,
OtherNumber = 11,
ConnectorPunctuation = 12,
DashPunctuation = 13,
OpenPunctuation = 14,
ClosePunctuation = 15,
InitialPunctuation = 16,
FinalPunctuation = 17,
OtherPunctuation = 18,
MathSymbol = 19,
CurrencySymbol = 20,
ModifierSymbol = 21,
OtherSymbol = 22,
SpaceSeparator = 23,
LineSeparator = 24,
ParagraphSeparator = 25,
Control = 26,
Format = 27,
Surrogate = 28,
PrivateUse = 29
}
Copy.
The ordinals match the generated table and must not be reordered: the table stores them as numbers.
Cases
| Name | Value | Description |
|---|---|---|
Unassigned | 0 | Unassigned, or outside every range. |
UppercaseLetter | 1 | Lu: an uppercase letter. |
LowercaseLetter | 2 | Ll: a lowercase letter. |
TitlecaseLetter | 3 | Lt: a titlecase letter. |
ModifierLetter | 4 | Lm: a modifier letter. |
OtherLetter | 5 | Lo: a letter without case. |
NonspacingMark | 6 | Mn: a nonspacing mark. |
SpacingMark | 7 | Mc: a spacing combining mark. |
EnclosingMark | 8 | Me: an enclosing mark. |
DecimalNumber | 9 | Nd: a decimal digit. |
LetterNumber | 10 | Nl: a letterlike number. |
OtherNumber | 11 | No: some other number. |
ConnectorPunctuation | 12 | Pc: a connector. |
DashPunctuation | 13 | Pd: a dash. |
OpenPunctuation | 14 | Ps: an opening bracket. |
ClosePunctuation | 15 | Pe: a closing bracket. |
InitialPunctuation | 16 | Pi: an initial quote. |
FinalPunctuation | 17 | Pf: a final quote. |
OtherPunctuation | 18 | Po: other punctuation. |
MathSymbol | 19 | Sm: a mathematical symbol. |
CurrencySymbol | 20 | Sc: a currency symbol. |
ModifierSymbol | 21 | Sk: a modifier symbol. |
OtherSymbol | 22 | So: some other symbol. |
SpaceSeparator | 23 | Zs: a space separator. |
LineSeparator | 24 | Zl: the line separator. |
ParagraphSeparator | 25 | Zp: the paragraph separator. |
Control | 26 | Cc: a control character. |
Format | 27 | Cf: an invisible formatting character. |
Surrogate | 28 | Cs: a surrogate half, which no scalar value is. |
PrivateUse | 29 | Co: private use. |
Related
CategoryOf
pub func CategoryOf(scalar: char32) -> GeneralCategory
The general category of scalar.
Runs in a handful of comparisons and allocates nothing.
Parameters
| Name | Type | Description |
|---|---|---|
scalar | char32 | the scalar value to classify |
Returns: its general category