Wado

core:icu

Unicode character properties, from the ICU4X component bundled with the toolchain. A name it does not answer is null, never an approximate set: Block, Decomposition_Type and the contributory Other_* are withheld.

Synopsis

assert has(BinaryProperty::Uppercase, 'À');
assert value_contains("sc", "Hiragana", 'あ') == Option::Some(true);

Functions

pub fn has(property: BinaryProperty, ch: char) -> bool

Whether ch has the property. Total, and the name costs nothing at run time: an enum case is a number, and ICU4X bakes each property as a static.

pub fn set(property: BinaryProperty) -> List<[u32, u32]>

The property's inclusive code point ranges, lowest first.

pub fn ranges(property: String) -> Option<List<[u32, u32]>>

Inclusive code point ranges of a binary property named at run time, lowest first. Prefer [set] for a name written into the source.

pub fn value_ranges(property: String, value: String) -> Option<List<[u32, u32]>>

Inclusive code point ranges of an enumerated property's value, lowest first. A gc value may name a group (L) as well as a category (Lu).

pub fn contains(property: String, ch: char) -> Option<bool>

Whether ch has the binary property named at run time. Prefer [has] for a name written into the source.

pub fn value_contains(property: String, value: String, ch: char) -> Option<bool>

Whether ch has that enumerated property value, without building the ranges.

Effects

pub interface Properties

fn has(property: BinaryProperty, ch: char) -> bool

#[cm] #[cm_params("property", "ch")]

fn set(property: BinaryProperty) -> List<[u32, u32]>

#[cm] #[cm_params("property")]

fn ranges(property: String, value: Option<String>) -> Option<List<[u32, u32]>>

#[cm] #[cm_params("property", "value")]

fn contains(property: String, value: Option<String>, ch: char) -> Option<bool>

#[cm] #[cm_params("property", "value", "ch")]

Enums

pub enum BinaryProperty

Alnum

Alphabetic

AsciiHexDigit

BidiControl

BidiMirrored

Blank

CaseIgnorable

Cased

ChangesWhenCasefolded

ChangesWhenCasemapped

ChangesWhenLowercased

ChangesWhenNfkcCasefolded

ChangesWhenTitlecased

ChangesWhenUppercased

Dash

DefaultIgnorableCodePoint

Deprecated

Diacritic

Emoji

EmojiComponent

EmojiModifier

EmojiModifierBase

EmojiPresentation

ExtendedPictographic

Extender

FullCompositionExclusion

Graph

GraphemeBase

GraphemeExtend

HexDigit

Hyphen

IdCompatMathContinue

IdCompatMathStart

IdContinue

IdStart

Ideographic

IdsBinaryOperator

IdsTrinaryOperator

IdsUnaryOperator

JoinControl

LogicalOrderException

Lowercase

Math

ModifierCombiningMark

NoncharacterCodePoint

PatternSyntax

PatternWhiteSpace

PrependedConcatenationMark

Print

QuotationMark

Radical

RegionalIndicator

SentenceTerminal

SoftDotted

TerminalPunctuation

UnifiedIdeograph

Uppercase

VariationSelector

WhiteSpace

Xdigit

XidContinue

XidStart