unicode

Branch: main

Switch branches or tags

Branch: main
Go to file t

413 files indexed

History
Code

ucd/properties.mbt
1///|2/// Check whether a character has the Unicode White_Space property.3///4/// White_Space covers the ASCII controls TAB, LF, VT, FF, and CR, the5/// space separators (General_Category Zs), U+0085 NEXT LINE, and the line6/// and paragraph separators U+2028 and U+2029. It does not include7/// U+200B ZERO WIDTH SPACE or U+FEFF ZERO WIDTH NO-BREAK SPACE.8pub fn is_white_space(c : Char) -> Bool {9  @white_space.is_white_space(c)10}1112///|13/// Check whether a character has the Unicode Alphabetic property.14///15/// Alphabetic covers the letters (General_Category L), letter numbers (Nl),16/// and Other_Alphabetic characters such as the vowel signs of Indic scripts.17/// Decimal digits are not Alphabetic.18pub fn is_alphabetic(c : Char) -> Bool {19  @alphabetic.is_alphabetic(c)20}2122///|23/// Check whether a character has the Unicode Lowercase property.24///25/// Lowercase is broader than General_Category Ll: it also covers26/// Other_Lowercase characters such as U+00AA FEMININE ORDINAL INDICATOR,27/// modifier letters like U+02B0, and the small Roman numerals.28/// Titlecase letters (Lt) are neither Lowercase nor Uppercase.29pub fn is_lowercase(c : Char) -> Bool {30  @lowercase.is_lowercase(c)31}3233///|34/// Check whether a character has the Unicode Uppercase property.35///36/// Uppercase is broader than General_Category Lu: it also covers37/// Other_Uppercase characters such as the capital Roman numerals and the38/// circled capital Latin letters. Titlecase letters (Lt) are neither39/// Lowercase nor Uppercase.40pub fn is_uppercase(c : Char) -> Bool {41  @uppercase.is_uppercase(c)42}4344///|45/// Check whether a character has the Unicode Default_Ignorable_Code_Point46/// property.47///48/// Default_Ignorable_Code_Point covers characters that should not be49/// displayed when a font has no glyph for them, such as U+00AD SOFT HYPHEN,50/// the zero width joiners, the bidirectional controls, the variation51/// selectors, and the tag characters. It also covers some unassigned code52/// points reserved for future characters of this kind.53pub fn is_default_ignorable_code_point(c : Char) -> Bool {54  @default_ignorable_code_point.is_default_ignorable_code_point(c)55}5657///|58/// Check whether a character has the Unicode Grapheme_Extend property.59///60/// Grapheme_Extend covers the nonspacing and enclosing marks61/// (General_Category Mn and Me) and Other_Grapheme_Extend characters such as62/// U+200C ZERO WIDTH NON-JOINER and a few spacing marks. U+200D ZERO WIDTH63/// JOINER is not Grapheme_Extend.64pub fn is_grapheme_extend(c : Char) -> Bool {65  @grapheme_extend.is_grapheme_extend(c)66}6768///|69/// Check whether a character has the Unicode Regional_Indicator property.70///71/// Regional_Indicator covers the 26 regional indicator symbols U+1F1E6 to72/// U+1F1FF, which pair up to form emoji flags.73pub fn is_regional_indicator(c : Char) -> Bool {74  @regional_indicator.is_regional_indicator(c)75}7677///|78/// Check whether a character has the Unicode Prepended_Concatenation_Mark79/// property.80///81/// Prepended_Concatenation_Mark covers format characters that enclose or82/// extend under the digits or letters following them, such as U+0600 ARABIC83/// NUMBER SIGN and U+06DD ARABIC END OF AYAH. Unlike most format characters84/// they are visible.85pub fn is_prepended_concatenation_mark(c : Char) -> Bool {86  @prepended_concatenation_mark.is_prepended_concatenation_mark(c)87}88