//! This module defines all available properties. //! //! Properties may be empty marker types and implement [`BinaryProperty`], or enumerations[^1] //! and implement [`EnumeratedProperty`]. //! //! [`BinaryProperty`]s are queried through a [`CodePointSetData`](crate::CodePointSetData), //! while [`EnumeratedProperty`]s are queried through [`CodePointMapData`](crate::CodePointMapData). //! //! In addition, some [`EnumeratedProperty`]s also implement [`ParseableEnumeratedProperty`] or //! [`NamedEnumeratedProperty`]. For these properties, [`PropertyParser`](crate::PropertyParser), //! [`PropertyNamesLong`](crate::PropertyNamesLong), and [`PropertyNamesShort`](crate::PropertyNamesShort) //! can be constructed. //! //! [^1]: either Rust `enum`s, or Rust `struct`s with associated constants (open enums)
/// All possible values of this enum in the Unicode version /// from this ICU4X release. pubconst ALL_VALUES: &'static [$enum_ty] = &[
$($enum_ty::$i),*
];
}
#[test] fn $consts_test() {
$(
assert_eq!( crate::names::PropertyNamesLong::<$enum_ty>::new().get($enum_ty::$i).unwrap() // Rust identifiers use camel case
.replace('_', "") // We use Ethiopian
.replace("Ethiopic", "Ethiopian") // Nastaliq is missing a long name?
.replace("Aran", "Nastaliq") // We spell these out
.replace("LVSyllable", "LeadingVowelSyllable")
.replace("LVTSyllable", "LeadingVowelTrailingSyllable"),
stringify!($i)
);
)*
}
}
}
create_const_array! { #[allow(non_upper_case_globals)] impl NumericType { /// Characters without numeric value pubconst None: NumericType = NumericType(0); /// (`De`) Characters of positional decimal systems /// /// These are coextensive with [`GeneralCategory::DecimalNumber`]. pubconst Decimal: NumericType = NumericType(1); /// (`Di`) Variants of positional or sequences thereof. /// /// The distinction between [`NumericType::Digit`] and [`NumericType::Numeric`] /// has not proven to be useful, so no further characters will be added to /// this type. pubconst Digit: NumericType = NumericType(2); /// (`Nu`) Other characters with numeric value pubconst Numeric: NumericType = NumericType(3);
} #[test] fn numeric_type_consts();
}
// This exists to encapsulate GeneralCategoryULE so that it can exist in the provider module rather than props pub(crate) mod gc { /// Enumerated property `General_Category`. /// /// `General_Category` specifies the most general classification of a code point, usually /// determined based on the primary characteristic of the assigned character. For example, is the /// character a letter, a mark, a number, punctuation, or a symbol, and if so, of what type? /// /// `GeneralCategory` only supports specific subcategories (eg `UppercaseLetter`). /// It does not support grouped categories (eg `Letter`). For grouped categories, use [`GeneralCategoryGroup`]( /// crate::props::GeneralCategoryGroup). /// /// # Example /// /// ``` /// use icu::properties::{props::GeneralCategory, CodePointMapData}; /// /// assert_eq!( /// CodePointMapData::<GeneralCategory>::new().get('木'), /// GeneralCategory::OtherLetter /// ); // U+6728 /// assert_eq!( /// CodePointMapData::<GeneralCategory>::new().get(''), /// GeneralCategory::OtherSymbol /// ); // U+1F383 JACK-O-LANTERN /// ``` #[derive(Copy, Clone, PartialEq, Eq, Debug, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties::props))] #[allow(clippy::exhaustive_enums)] // this type is stable #[zerovec::make_ule(GeneralCategoryULE)] #[cfg_attr(not(feature = "alloc"), zerovec::skip_derive(ZeroMapKV))] #[repr(u8)] pubenum GeneralCategory { /// (`Cn`) A reserved unassigned code point or a noncharacter
Unassigned = 0,
/// (`Lu`) An uppercase letter
UppercaseLetter = 1, /// (`Ll`) A lowercase letter
LowercaseLetter = 2, /// (`Lt`) A digraphic letter, with first part uppercase
TitlecaseLetter = 3, /// (`Lm`) A modifier letter
ModifierLetter = 4, /// (`Lo`) Other letters, including syllables and ideographs
OtherLetter = 5,
/// (`Mn`) A nonspacing combining mark (zero advance width)
NonspacingMark = 6, /// (`Mc`) A spacing combining mark (positive advance width)
SpacingMark = 8, /// (`Me`) An enclosing combining mark
EnclosingMark = 7,
/// (`Nd`) A decimal digit
DecimalNumber = 9, /// (`Nl`) A letterlike numeric character
LetterNumber = 10, /// (`No`) A numeric character of other type
OtherNumber = 11,
/// (`Zs`) A space character (of various non-zero widths)
SpaceSeparator = 12, /// (`Zl`) U+2028 LINE SEPARATOR only
LineSeparator = 13, /// (`Zp`) U+2029 PARAGRAPH SEPARATOR only
ParagraphSeparator = 14,
/// (`Cc`) A C0 or C1 control code
Control = 15, /// (`Cf`) A format control character
Format = 16, /// (`Co`) A private-use character
PrivateUse = 17, /// (`Cs`) A surrogate code point
Surrogate = 18,
/// (`Pd`) A dash or hyphen punctuation mark
DashPunctuation = 19, /// (`Ps`) An opening punctuation mark (of a pair)
OpenPunctuation = 20, /// (`Pe`) A closing punctuation mark (of a pair)
ClosePunctuation = 21, /// (`Pc`) A connecting punctuation mark, like a tie
ConnectorPunctuation = 22, /// (`Pi`) An initial quotation mark
InitialPunctuation = 28, /// (`Pf`) A final quotation mark
FinalPunctuation = 29, /// (`Po`) A punctuation mark of other type
OtherPunctuation = 23,
/// (`Sm`) A symbol of mathematical use
MathSymbol = 24, /// (`Sc`) A currency sign
CurrencySymbol = 25, /// (`Sk`) A non-letterlike modifier symbol
ModifierSymbol = 26, /// (`So`) A symbol of other type
OtherSymbol = 27,
}
}
#[test] fn gc_variants() { for &variant in GeneralCategory::ALL_VALUES {
assert_eq!( crate::names::PropertyNamesLong::<GeneralCategory>::new()
.get(variant)
.unwrap() // Rust identifiers use camel case
.replace('_', ""),
format!("{variant:?}")
);
}
}
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash, Default)] /// Error value for `impl TryFrom<u8> for GeneralCategory`. #[non_exhaustive] pubstruct GeneralCategoryOutOfBoundsError;
impl TryFrom<u8> for GeneralCategory { type Error = GeneralCategoryOutOfBoundsError; /// Construct this [`GeneralCategory`] from an integer, returning /// an error if it is out of bounds fn try_from(val: u8) -> Result<Self, GeneralCategoryOutOfBoundsError> {
GeneralCategory::new_from_u8(val).ok_or(GeneralCategoryOutOfBoundsError)
}
}
/// Groupings of multiple `General_Category` property values. /// /// Instances of `GeneralCategoryGroup` represent the defined multi-category /// values that are useful for users in certain contexts, such as regex. In /// other words, unlike [`GeneralCategory`], this supports groups of general /// categories: for example, `Letter` /// is the union of `UppercaseLetter`, /// `LowercaseLetter`, etc. /// /// See <https://www.unicode.org/reports/tr44/> . /// /// The discriminants correspond to the `U_GC_XX_MASK` constants in ICU4C. /// Unlike [`GeneralCategory`], this supports groups of general categories: for example, `Letter` /// is the union of `UppercaseLetter`, `LowercaseLetter`, etc. /// /// See `UCharCategory` and `U_GET_GC_MASK` in ICU4C. #[derive(Copy, Clone, PartialEq, Debug, Eq)] #[allow(clippy::exhaustive_structs)] // newtype #[repr(transparent)] pubstruct GeneralCategoryGroup(pub(crate) u32);
implcrate::private::Sealed for GeneralCategoryGroup {}
use GeneralCategory as GC; use GeneralCategoryGroup as GCG;
#[allow(non_upper_case_globals)] impl GeneralCategoryGroup { /// (`Lu`) An uppercase letter pubconst UppercaseLetter: GeneralCategoryGroup = GCG(1 << (GC::UppercaseLetter as u32)); /// (`Ll`) A lowercase letter pubconst LowercaseLetter: GeneralCategoryGroup = GCG(1 << (GC::LowercaseLetter as u32)); /// (`Lt`) A digraphic letter, with first part uppercase pubconst TitlecaseLetter: GeneralCategoryGroup = GCG(1 << (GC::TitlecaseLetter as u32)); /// (`Lm`) A modifier letter pubconst ModifierLetter: GeneralCategoryGroup = GCG(1 << (GC::ModifierLetter as u32)); /// (`Lo`) Other letters, including syllables and ideographs pubconst OtherLetter: GeneralCategoryGroup = GCG(1 << (GC::OtherLetter as u32)); /// (`LC`) The union of `UppercaseLetter`, `LowercaseLetter`, and `TitlecaseLetter` pubconst CasedLetter: GeneralCategoryGroup = GCG((1 << (GC::UppercaseLetter as u32))
| (1 << (GC::LowercaseLetter as u32))
| (1 << (GC::TitlecaseLetter as u32))); /// (`L`) The union of all letter categories pubconst Letter: GeneralCategoryGroup = GCG((1 << (GC::UppercaseLetter as u32))
| (1 << (GC::LowercaseLetter as u32))
| (1 << (GC::TitlecaseLetter as u32))
| (1 << (GC::ModifierLetter as u32))
| (1 << (GC::OtherLetter as u32)));
/// (`Mn`) A nonspacing combining mark (zero advance width) pubconst NonspacingMark: GeneralCategoryGroup = GCG(1 << (GC::NonspacingMark as u32)); /// (`Mc`) A spacing combining mark (positive advance width) pubconst EnclosingMark: GeneralCategoryGroup = GCG(1 << (GC::EnclosingMark as u32)); /// (`Me`) An enclosing combining mark pubconst SpacingMark: GeneralCategoryGroup = GCG(1 << (GC::SpacingMark as u32)); /// (`M`) The union of all mark categories pubconst Mark: GeneralCategoryGroup = GCG((1 << (GC::NonspacingMark as u32))
| (1 << (GC::EnclosingMark as u32))
| (1 << (GC::SpacingMark as u32)));
/// (`Nd`) A decimal digit pubconst DecimalNumber: GeneralCategoryGroup = GCG(1 << (GC::DecimalNumber as u32)); /// (`Nl`) A letterlike numeric character pubconst LetterNumber: GeneralCategoryGroup = GCG(1 << (GC::LetterNumber as u32)); /// (`No`) A numeric character of other type pubconst OtherNumber: GeneralCategoryGroup = GCG(1 << (GC::OtherNumber as u32)); /// (`N`) The union of all number categories pubconst Number: GeneralCategoryGroup = GCG((1 << (GC::DecimalNumber as u32))
| (1 << (GC::LetterNumber as u32))
| (1 << (GC::OtherNumber as u32)));
/// (`Zs`) A space character (of various non-zero widths) pubconst SpaceSeparator: GeneralCategoryGroup = GCG(1 << (GC::SpaceSeparator as u32)); /// (`Zl`) U+2028 LINE SEPARATOR only pubconst LineSeparator: GeneralCategoryGroup = GCG(1 << (GC::LineSeparator as u32)); /// (`Zp`) U+2029 PARAGRAPH SEPARATOR only pubconst ParagraphSeparator: GeneralCategoryGroup = GCG(1 << (GC::ParagraphSeparator as u32)); /// (`Z`) The union of all separator categories pubconst Separator: GeneralCategoryGroup = GCG((1 << (GC::SpaceSeparator as u32))
| (1 << (GC::LineSeparator as u32))
| (1 << (GC::ParagraphSeparator as u32)));
/// (`Cc`) A C0 or C1 control code pubconst Control: GeneralCategoryGroup = GCG(1 << (GC::Control as u32)); /// (`Cf`) A format control character pubconst Format: GeneralCategoryGroup = GCG(1 << (GC::Format as u32)); /// (`Co`) A private-use character pubconst PrivateUse: GeneralCategoryGroup = GCG(1 << (GC::PrivateUse as u32)); /// (`Cs`) A surrogate code point pubconst Surrogate: GeneralCategoryGroup = GCG(1 << (GC::Surrogate as u32)); /// (`Cn`) A reserved unassigned code point or a noncharacter pubconst Unassigned: GeneralCategoryGroup = GCG(1 << (GC::Unassigned as u32)); /// (`C`) The union of all control code, reserved, and unassigned categories pubconst Other: GeneralCategoryGroup = GCG((1 << (GC::Control as u32))
| (1 << (GC::Format as u32))
| (1 << (GC::PrivateUse as u32))
| (1 << (GC::Surrogate as u32))
| (1 << (GC::Unassigned as u32)));
/// (`Pd`) A dash or hyphen punctuation mark pubconst DashPunctuation: GeneralCategoryGroup = GCG(1 << (GC::DashPunctuation as u32)); /// (`Ps`) An opening punctuation mark (of a pair) pubconst OpenPunctuation: GeneralCategoryGroup = GCG(1 << (GC::OpenPunctuation as u32)); /// (`Pe`) A closing punctuation mark (of a pair) pubconst ClosePunctuation: GeneralCategoryGroup = GCG(1 << (GC::ClosePunctuation as u32)); /// (`Pc`) A connecting punctuation mark, like a tie pubconst ConnectorPunctuation: GeneralCategoryGroup =
GCG(1 << (GC::ConnectorPunctuation as u32)); /// (`Pi`) An initial quotation mark pubconst InitialPunctuation: GeneralCategoryGroup = GCG(1 << (GC::InitialPunctuation as u32)); /// (`Pf`) A final quotation mark pubconst FinalPunctuation: GeneralCategoryGroup = GCG(1 << (GC::FinalPunctuation as u32)); /// (`Po`) A punctuation mark of other type pubconst OtherPunctuation: GeneralCategoryGroup = GCG(1 << (GC::OtherPunctuation as u32)); /// (`P`) The union of all punctuation categories pubconst Punctuation: GeneralCategoryGroup = GCG((1 << (GC::DashPunctuation as u32))
| (1 << (GC::OpenPunctuation as u32))
| (1 << (GC::ClosePunctuation as u32))
| (1 << (GC::ConnectorPunctuation as u32))
| (1 << (GC::OtherPunctuation as u32))
| (1 << (GC::InitialPunctuation as u32))
| (1 << (GC::FinalPunctuation as u32)));
/// (`Sm`) A symbol of mathematical use pubconst MathSymbol: GeneralCategoryGroup = GCG(1 << (GC::MathSymbol as u32)); /// (`Sc`) A currency sign pubconst CurrencySymbol: GeneralCategoryGroup = GCG(1 << (GC::CurrencySymbol as u32)); /// (`Sk`) A non-letterlike modifier symbol pubconst ModifierSymbol: GeneralCategoryGroup = GCG(1 << (GC::ModifierSymbol as u32)); /// (`So`) A symbol of other type pubconst OtherSymbol: GeneralCategoryGroup = GCG(1 << (GC::OtherSymbol as u32)); /// (`S`) The union of all symbol categories pubconst Symbol: GeneralCategoryGroup = GCG((1 << (GC::MathSymbol as u32))
| (1 << (GC::CurrencySymbol as u32))
| (1 << (GC::ModifierSymbol as u32))
| (1 << (GC::OtherSymbol as u32)));
/// Produce a `GeneralCategoryGroup` that is the inverse of this one /// /// # Example /// /// ```rust /// use icu::properties::props::{GeneralCategory, GeneralCategoryGroup}; /// /// let letter = GeneralCategoryGroup::Letter; /// let not_letter = letter.complement(); /// /// assert!(not_letter.contains(GeneralCategory::MathSymbol)); /// assert!(!letter.contains(GeneralCategory::MathSymbol)); /// assert!(not_letter.contains(GeneralCategory::OtherPunctuation)); /// assert!(!letter.contains(GeneralCategory::OtherPunctuation)); /// assert!(!not_letter.contains(GeneralCategory::UppercaseLetter)); /// assert!(letter.contains(GeneralCategory::UppercaseLetter)); /// ``` pubconstfn complement(self) -> Self { // Mask off things not in Self::ALL to guarantee the mask // values stay in-range
GeneralCategoryGroup(!self.0 & Self::ALL)
}
/// Return the group representing all `GeneralCategory` values /// /// # Example /// /// ```rust /// use icu::properties::props::{GeneralCategory, GeneralCategoryGroup}; /// /// let all = GeneralCategoryGroup::all(); /// /// assert!(all.contains(GeneralCategory::MathSymbol)); /// assert!(all.contains(GeneralCategory::OtherPunctuation)); /// assert!(all.contains(GeneralCategory::UppercaseLetter)); /// ``` pubconstfn all() -> Self { Self(Self::ALL)
}
/// Return the empty group /// /// # Example /// /// ```rust /// use icu::properties::props::{GeneralCategory, GeneralCategoryGroup}; /// /// let empty = GeneralCategoryGroup::empty(); /// /// assert!(!empty.contains(GeneralCategory::MathSymbol)); /// assert!(!empty.contains(GeneralCategory::OtherPunctuation)); /// assert!(!empty.contains(GeneralCategory::UppercaseLetter)); /// ``` pubconstfn empty() -> Self { Self(0)
}
/// Take the union of two groups /// /// # Example /// /// ```rust /// use icu::properties::props::{GeneralCategory, GeneralCategoryGroup}; /// /// let letter = GeneralCategoryGroup::Letter; /// let symbol = GeneralCategoryGroup::Symbol; /// let union = letter.union(symbol); /// /// assert!(union.contains(GeneralCategory::MathSymbol)); /// assert!(!union.contains(GeneralCategory::OtherPunctuation)); /// assert!(union.contains(GeneralCategory::UppercaseLetter)); /// ``` pubconstfn union(self, other: Self) -> Self { Self(self.0 | other.0)
}
/// Take the intersection of two groups /// /// # Example /// /// ```rust /// use icu::properties::props::{GeneralCategory, GeneralCategoryGroup}; /// /// let letter = GeneralCategoryGroup::Letter; /// let lu = GeneralCategoryGroup::UppercaseLetter; /// let intersection = letter.intersection(lu); /// /// assert!(!intersection.contains(GeneralCategory::MathSymbol)); /// assert!(!intersection.contains(GeneralCategory::OtherPunctuation)); /// assert!(intersection.contains(GeneralCategory::UppercaseLetter)); /// assert!(!intersection.contains(GeneralCategory::LowercaseLetter)); /// ``` pubconstfn intersection(self, other: Self) -> Self { Self(self.0 & other.0)
}
}
impl From<GeneralCategory> for GeneralCategoryGroup { fn from(subcategory: GeneralCategory) -> Self {
GeneralCategoryGroup(1 << (subcategory as u32))
}
} impl From<u32> for GeneralCategoryGroup { fn from(mask: u32) -> Self { // Mask off things not in Self::ALL to guarantee the mask // values stay in-range
GeneralCategoryGroup(mask & Self::ALL)
}
} impl From<GeneralCategoryGroup> for u32 { fn from(group: GeneralCategoryGroup) -> Self {
group.0
}
}
/// Enumerated property Script. /// /// This is used with both the Script and `Script_Extensions` Unicode properties. /// Each character is assigned a single Script, but characters that are used in /// a particular subset of scripts will be in more than one `Script_Extensions` set. /// For example, `DEVANAGARI DIGIT NINE` has `Script=Devanagari`, but is also in the /// `Script_Extensions` set for Dogra, Kaithi, and Mahajani. If you are trying to /// determine whether a code point belongs to a certain script, you should use /// [`ScriptWithExtensionsBorrowed::has_script`]. /// /// For more information, see UAX #24: <https://www.unicode.org/reports/tr24/>. /// See `UScriptCode` in ICU4C. /// /// # Example /// /// ``` /// use icu::properties::{CodePointMapData, props::Script}; /// /// assert_eq!(CodePointMapData::<Script>::new().get('木'), Script::Han); // U+6728 /// assert_eq!(CodePointMapData::<Script>::new().get(''), Script::Common); // U+1F383 JACK-O-LANTERN /// ``` /// [`ScriptWithExtensionsBorrowed::has_script`]: crate::script::ScriptWithExtensionsBorrowed::has_script #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[allow(clippy::exhaustive_structs)] // newtype #[repr(transparent)] pubstruct Script(pub(crate) u16);
impl Script { // Doesn't actually exist! #[doc(hidden)] #[allow(non_upper_case_globals)] #[deprecated] // Some high value that ICU4C will not use anytime soon pubconst Chisoi: Script = Self(60_000);
}
/// ✨ *Enabled with the `compiled_data` Cargo feature.* #[cfg(feature = "compiled_data")] impl From<Script> for icu_locale_core::subtags::Script { fn from(value: Script) -> Self { crate::PropertyNamesShort::new()
.get_locale_script(value)
.unwrap_or(icu_locale_core::subtags::script!("Zzzz"))
}
}
/// ✨ *Enabled with the `compiled_data` Cargo feature.* #[cfg(feature = "compiled_data")] impl From<icu_locale_core::subtags::Script> for Script { fn from(value: icu_locale_core::subtags::Script) -> Self { crate::PropertyParser::new()
.get_strict(value.as_str())
.unwrap_or(Self::Unknown)
}
}
create_const_array! { #[allow(non_upper_case_globals)] impl HangulSyllableType { /// (`NA`) not applicable (e.g. not a Hangul code point). pubconst NotApplicable: HangulSyllableType = HangulSyllableType(0); /// (`L`) a conjoining leading consonant Jamo. pubconst LeadingJamo: HangulSyllableType = HangulSyllableType(1); /// (`V`) a conjoining vowel Jamo. pubconst VowelJamo: HangulSyllableType = HangulSyllableType(2); /// (`T`) a conjoining trailing consonant Jamo. pubconst TrailingJamo: HangulSyllableType = HangulSyllableType(3); /// (`LV`) a precomposed syllable with a leading consonant and a vowel. pubconst LeadingVowelSyllable: HangulSyllableType = HangulSyllableType(4); /// (`LVT`) a precomposed syllable with a leading consonant, a vowel, and a trailing consonant. pubconst LeadingVowelTrailingSyllable: HangulSyllableType = HangulSyllableType(5);
} #[test] fn hangul_syllable_type_consts();
}
/// Property `Canonical_Combining_Class`. /// See UAX #15: /// <https://www.unicode.org/reports/tr15/>. /// /// See `icu::normalizer::properties::CanonicalCombiningClassMap` for the API /// to look up the `Canonical_Combining_Class` property by scalar value. /// /// **Note:** See `icu::normalizer::CanonicalCombiningClassMap` for the preferred API /// to look up the `Canonical_Combining_Class` property by scalar value. /// /// # Example /// /// ``` /// use icu::properties::{props::CanonicalCombiningClass, CodePointMapData}; /// /// assert_eq!( /// CodePointMapData::<CanonicalCombiningClass>::new().get('a'), /// CanonicalCombiningClass::NotReordered /// ); // U+0061: LATIN SMALL LETTER A /// assert_eq!( /// CodePointMapData::<CanonicalCombiningClass>::new().get('\u{0301}'), /// CanonicalCombiningClass::Above /// ); // U+0301: COMBINING ACUTE ACCENT /// ``` // // NOTE: The Pernosco debugger has special knowledge // of this struct. Please do not change the bit layout // or the crate-module-qualified name of this struct // without coordination. #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[allow(clippy::exhaustive_structs)] // newtype #[repr(transparent)] pubstruct CanonicalCombiningClass(pub(crate) u8);
make_binary_property! {
name: "ASCII_Hex_Digit";
short_name: "AHex";
ident: AsciiHexDigit;
data_marker: crate::provider::PropertyBinaryAsciiHexDigitV1;
singleton: SINGLETON_PROPERTY_BINARY_ASCII_HEX_DIGIT_V1; /// ASCII characters commonly used for the representation of hexadecimal numbers. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::AsciiHexDigit; /// /// let ascii_hex_digit = CodePointSetData::new::<AsciiHexDigit>(); /// /// assert!(ascii_hex_digit.contains('3')); /// assert!(!ascii_hex_digit.contains('੩')); // U+0A69 GURMUKHI DIGIT THREE /// assert!(ascii_hex_digit.contains('A')); /// assert!(!ascii_hex_digit.contains('Ä')); // U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS /// ```
}
make_binary_property! {
name: "alnum";
short_name: "alnum";
ident: Alnum;
data_marker: crate::provider::PropertyBinaryAlnumV1;
singleton: SINGLETON_PROPERTY_BINARY_ALNUM_V1; /// Characters with the `Alphabetic` or `Decimal_Number` property. /// /// This is defined for POSIX compatibility.
}
make_binary_property! {
name: "Alphabetic";
short_name: "Alpha";
ident: Alphabetic;
data_marker: crate::provider::PropertyBinaryAlphabeticV1;
singleton: SINGLETON_PROPERTY_BINARY_ALPHABETIC_V1; /// Alphabetic characters. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::Alphabetic; /// /// let alphabetic = CodePointSetData::new::<Alphabetic>(); /// /// assert!(!alphabetic.contains('3')); /// assert!(!alphabetic.contains('੩')); // U+0A69 GURMUKHI DIGIT THREE /// assert!(alphabetic.contains('A')); /// assert!(alphabetic.contains('Ä')); // U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS /// ```
}
make_binary_property! {
name: "Bidi_Control";
short_name: "Bidi_C";
ident: BidiControl;
data_marker: crate::provider::PropertyBinaryBidiControlV1;
singleton: SINGLETON_PROPERTY_BINARY_BIDI_CONTROL_V1; /// Format control characters which have specific functions in the Unicode Bidirectional /// Algorithm. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::BidiControl; /// /// let bidi_control = CodePointSetData::new::<BidiControl>(); /// /// assert!(bidi_control.contains('\u{200F}')); // RIGHT-TO-LEFT MARK /// assert!(!bidi_control.contains('ش')); // U+0634 ARABIC LETTER SHEEN /// ```
}
make_binary_property! {
name: "Bidi_Mirrored";
short_name: "Bidi_M";
ident: BidiMirrored;
data_marker: crate::provider::PropertyBinaryBidiMirroredV1;
singleton: SINGLETON_PROPERTY_BINARY_BIDI_MIRRORED_V1; /// Characters that are mirrored in bidirectional text. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::BidiMirrored; /// /// let bidi_mirrored = CodePointSetData::new::<BidiMirrored>(); /// /// assert!(bidi_mirrored.contains('[')); /// assert!(bidi_mirrored.contains(']')); /// assert!(bidi_mirrored.contains('∑')); // U+2211 N-ARY SUMMATION /// assert!(!bidi_mirrored.contains('ཉ')); // U+0F49 TIBETAN LETTER NYA /// ```
make_binary_property! {
name: "Cased";
short_name: "Cased";
ident: Cased;
data_marker: crate::provider::PropertyBinaryCasedV1;
singleton: SINGLETON_PROPERTY_BINARY_CASED_V1; /// Uppercase, lowercase, and titlecase characters. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::Cased; /// /// let cased = CodePointSetData::new::<Cased>(); /// /// assert!(cased.contains('Ꙡ')); // U+A660 CYRILLIC CAPITAL LETTER REVERSED TSE /// assert!(!cased.contains('ދ')); // U+078B THAANA LETTER DHAALU /// ```
}
make_binary_property! {
name: "Case_Ignorable";
short_name: "CI";
ident: CaseIgnorable;
data_marker: crate::provider::PropertyBinaryCaseIgnorableV1;
singleton: SINGLETON_PROPERTY_BINARY_CASE_IGNORABLE_V1; /// Characters which are ignored for casing purposes. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::CaseIgnorable; /// /// let case_ignorable = CodePointSetData::new::<CaseIgnorable>(); /// /// assert!(case_ignorable.contains(':')); /// assert!(!case_ignorable.contains('λ')); // U+03BB GREEK SMALL LETTER LAMBDA /// ```
}
make_binary_property! {
name: "Full_Composition_Exclusion";
short_name: "Comp_Ex";
ident: FullCompositionExclusion;
data_marker: crate::provider::PropertyBinaryFullCompositionExclusionV1;
singleton: SINGLETON_PROPERTY_BINARY_FULL_COMPOSITION_EXCLUSION_V1; /// Characters that are excluded from composition. /// /// See <https://unicode.org/Public/UNIDATA/CompositionExclusions.txt>
}
make_binary_property! {
name: "Changes_When_Casefolded";
short_name: "CWCF";
ident: ChangesWhenCasefolded;
data_marker: crate::provider::PropertyBinaryChangesWhenCasefoldedV1;
singleton: SINGLETON_PROPERTY_BINARY_CHANGES_WHEN_CASEFOLDED_V1; /// Characters whose normalized forms are not stable under case folding. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::ChangesWhenCasefolded; /// /// let changes_when_casefolded = CodePointSetData::new::<ChangesWhenCasefolded>(); /// /// assert!(changes_when_casefolded.contains('ß')); // U+00DF LATIN SMALL LETTER SHARP S /// assert!(!changes_when_casefolded.contains('ᜉ')); // U+1709 TAGALOG LETTER PA /// ```
}
make_binary_property! {
name: "Changes_When_Casemapped";
short_name: "CWCM";
ident: ChangesWhenCasemapped;
data_marker: crate::provider::PropertyBinaryChangesWhenCasemappedV1;
singleton: SINGLETON_PROPERTY_BINARY_CHANGES_WHEN_CASEMAPPED_V1; /// Characters which may change when they undergo case mapping.
}
make_binary_property! {
name: "Changes_When_NFKC_Casefolded";
short_name: "CWKCF";
ident: ChangesWhenNfkcCasefolded;
data_marker: crate::provider::PropertyBinaryChangesWhenNfkcCasefoldedV1;
singleton: SINGLETON_PROPERTY_BINARY_CHANGES_WHEN_NFKC_CASEFOLDED_V1; /// Characters which are not identical to their `NFKC_Casefold` mapping. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::ChangesWhenNfkcCasefolded; /// /// let changes_when_nfkc_casefolded = CodePointSetData::new::<ChangesWhenNfkcCasefolded>(); /// /// assert!(changes_when_nfkc_casefolded.contains('')); // U+1F135 SQUARED LATIN CAPITAL LETTER F /// assert!(!changes_when_nfkc_casefolded.contains('f')); /// ```
}
make_binary_property! {
name: "Changes_When_Lowercased";
short_name: "CWL";
ident: ChangesWhenLowercased;
data_marker: crate::provider::PropertyBinaryChangesWhenLowercasedV1;
singleton: SINGLETON_PROPERTY_BINARY_CHANGES_WHEN_LOWERCASED_V1; /// Characters whose normalized forms are not stable under a `toLowercase` mapping. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::ChangesWhenLowercased; /// /// let changes_when_lowercased = CodePointSetData::new::<ChangesWhenLowercased>(); /// /// assert!(changes_when_lowercased.contains('Ⴔ')); // U+10B4 GEORGIAN CAPITAL LETTER PHAR /// assert!(!changes_when_lowercased.contains('ფ')); // U+10E4 GEORGIAN LETTER PHAR /// ```
}
make_binary_property! {
name: "Changes_When_Titlecased";
short_name: "CWT";
ident: ChangesWhenTitlecased;
data_marker: crate::provider::PropertyBinaryChangesWhenTitlecasedV1;
singleton: SINGLETON_PROPERTY_BINARY_CHANGES_WHEN_TITLECASED_V1; /// Characters whose normalized forms are not stable under a `toTitlecase` mapping. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::ChangesWhenTitlecased; /// /// let changes_when_titlecased = CodePointSetData::new::<ChangesWhenTitlecased>(); /// /// assert!(changes_when_titlecased.contains('æ')); // U+00E6 LATIN SMALL LETTER AE /// assert!(!changes_when_titlecased.contains('Æ')); // U+00E6 LATIN CAPITAL LETTER AE /// ```
}
make_binary_property! {
name: "Changes_When_Uppercased";
short_name: "CWU";
ident: ChangesWhenUppercased;
data_marker: crate::provider::PropertyBinaryChangesWhenUppercasedV1;
singleton: SINGLETON_PROPERTY_BINARY_CHANGES_WHEN_UPPERCASED_V1; /// Characters whose normalized forms are not stable under a `toUppercase` mapping. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::ChangesWhenUppercased; /// /// let changes_when_uppercased = CodePointSetData::new::<ChangesWhenUppercased>(); /// /// assert!(changes_when_uppercased.contains('ւ')); // U+0582 ARMENIAN SMALL LETTER YIWN /// assert!(!changes_when_uppercased.contains('Ւ')); // U+0552 ARMENIAN CAPITAL LETTER YIWN /// ```
}
make_binary_property! {
name: "Dash";
short_name: "Dash";
ident: Dash;
data_marker: crate::provider::PropertyBinaryDashV1;
singleton: SINGLETON_PROPERTY_BINARY_DASH_V1; /// Punctuation characters explicitly called out as dashes in the Unicode Standard, plus /// their compatibility equivalents. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::Dash; /// /// let dash = CodePointSetData::new::<Dash>(); /// /// assert!(dash.contains('⸺')); // U+2E3A TWO-EM DASH /// assert!(dash.contains('-')); // U+002D /// assert!(!dash.contains('=')); // U+003D /// ```
}
make_binary_property! {
name: "Deprecated";
short_name: "Dep";
ident: Deprecated;
data_marker: crate::provider::PropertyBinaryDeprecatedV1;
singleton: SINGLETON_PROPERTY_BINARY_DEPRECATED_V1; /// Deprecated characters. /// /// No characters will ever be removed from the standard, but the /// usage of deprecated characters is strongly discouraged. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::Deprecated; /// /// let deprecated = CodePointSetData::new::<Deprecated>(); /// /// assert!(deprecated.contains('ឣ')); // U+17A3 KHMER INDEPENDENT VOWEL QAQ /// assert!(!deprecated.contains('A')); /// ```
}
make_binary_property! {
name: "Default_Ignorable_Code_Point";
short_name: "DI";
ident: DefaultIgnorableCodePoint;
data_marker: crate::provider::PropertyBinaryDefaultIgnorableCodePointV1;
singleton: SINGLETON_PROPERTY_BINARY_DEFAULT_IGNORABLE_CODE_POINT_V1; /// For programmatic determination of default ignorable code points. /// /// New characters that /// should be ignored in rendering (unless explicitly supported) will be assigned in these /// ranges, permitting programs to correctly handle the default rendering of such /// characters when not otherwise supported. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::DefaultIgnorableCodePoint; /// /// let default_ignorable_code_point = CodePointSetData::new::<DefaultIgnorableCodePoint>(); /// /// assert!(default_ignorable_code_point.contains('\u{180B}')); // MONGOLIAN FREE VARIATION SELECTOR ONE /// assert!(!default_ignorable_code_point.contains('E')); /// ```
}
make_binary_property! {
name: "Diacritic";
short_name: "Dia";
ident: Diacritic;
data_marker: crate::provider::PropertyBinaryDiacriticV1;
singleton: SINGLETON_PROPERTY_BINARY_DIACRITIC_V1; /// Characters that linguistically modify the meaning of another character to which they apply. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::Diacritic; /// /// let diacritic = CodePointSetData::new::<Diacritic>(); /// /// assert!(diacritic.contains('\u{05B3}')); // HEBREW POINT HATAF QAMATS /// assert!(!diacritic.contains('א')); // U+05D0 HEBREW LETTER ALEF /// ```
}
make_binary_property! {
name: "Emoji_Modifier_Base";
short_name: "EBase";
ident: EmojiModifierBase;
data_marker: crate::provider::PropertyBinaryEmojiModifierBaseV1;
singleton: SINGLETON_PROPERTY_BINARY_EMOJI_MODIFIER_BASE_V1; /// Characters that can serve as a base for emoji modifiers. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::EmojiModifierBase; /// /// let emoji_modifier_base = CodePointSetData::new::<EmojiModifierBase>(); /// /// assert!(emoji_modifier_base.contains('✊')); // U+270A RAISED FIST /// assert!(!emoji_modifier_base.contains('⛰')); // U+26F0 MOUNTAIN /// ```
}
make_binary_property! {
name: "Emoji_Component";
short_name: "EComp";
ident: EmojiComponent;
data_marker: crate::provider::PropertyBinaryEmojiComponentV1;
singleton: SINGLETON_PROPERTY_BINARY_EMOJI_COMPONENT_V1; /// Characters used in emoji sequences that normally do not appear on emoji keyboards as /// separate choices, such as base characters for emoji keycaps. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::EmojiComponent; /// /// let emoji_component = CodePointSetData::new::<EmojiComponent>(); /// /// assert!(emoji_component.contains('')); // U+1F1F9 REGIONAL INDICATOR SYMBOL LETTER T /// assert!(emoji_component.contains('\u{20E3}')); // COMBINING ENCLOSING KEYCAP /// assert!(emoji_component.contains('7')); /// assert!(!emoji_component.contains('T')); /// ```
}
make_binary_property! {
name: "Emoji_Modifier";
short_name: "EMod";
ident: EmojiModifier;
data_marker: crate::provider::PropertyBinaryEmojiModifierV1;
singleton: SINGLETON_PROPERTY_BINARY_EMOJI_MODIFIER_V1; /// Characters that are emoji modifiers. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::EmojiModifier; /// /// let emoji_modifier = CodePointSetData::new::<EmojiModifier>(); /// /// assert!(emoji_modifier.contains('\u{1F3FD}')); // EMOJI MODIFIER FITZPATRICK TYPE-4 /// assert!(!emoji_modifier.contains('\u{200C}')); // ZERO WIDTH NON-JOINER /// ```
}
make_binary_property! {
name: "Emoji";
short_name: "Emoji";
ident: Emoji;
data_marker: crate::provider::PropertyBinaryEmojiV1;
singleton: SINGLETON_PROPERTY_BINARY_EMOJI_V1; /// Characters that are emoji. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::Emoji; /// /// let emoji = CodePointSetData::new::<Emoji>(); /// /// assert!(emoji.contains('')); // U+1F525 FIRE /// assert!(!emoji.contains('V')); /// ```
}
make_binary_property! {
name: "Emoji_Presentation";
short_name: "EPres";
ident: EmojiPresentation;
data_marker: crate::provider::PropertyBinaryEmojiPresentationV1;
singleton: SINGLETON_PROPERTY_BINARY_EMOJI_PRESENTATION_V1; /// Characters that have emoji presentation by default. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::EmojiPresentation; /// /// let emoji_presentation = CodePointSetData::new::<EmojiPresentation>(); /// /// assert!(emoji_presentation.contains('')); // U+1F9AC BISON /// assert!(!emoji_presentation.contains('♻')); // U+267B BLACK UNIVERSAL RECYCLING SYMBOL /// ```
}
make_binary_property! {
name: "Extender";
short_name: "Ext";
ident: Extender;
data_marker: crate::provider::PropertyBinaryExtenderV1;
singleton: SINGLETON_PROPERTY_BINARY_EXTENDER_V1; /// Characters whose principal function is to extend the value of a preceding alphabetic /// character or to extend the shape of adjacent characters. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::Extender; /// /// let extender = CodePointSetData::new::<Extender>(); /// /// assert!(extender.contains('ヾ')); // U+30FE KATAKANA VOICED ITERATION MARK /// assert!(extender.contains('ー')); // U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK /// assert!(!extender.contains('・')); // U+30FB KATAKANA MIDDLE DOT /// ```
}
make_binary_property! {
name: "Extended_Pictographic";
short_name: "ExtPict";
ident: ExtendedPictographic;
data_marker: crate::provider::PropertyBinaryExtendedPictographicV1;
singleton: SINGLETON_PROPERTY_BINARY_EXTENDED_PICTOGRAPHIC_V1; /// Pictographic symbols, as well as reserved ranges in blocks largely associated with /// emoji characters /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::ExtendedPictographic; /// /// let extended_pictographic = CodePointSetData::new::<ExtendedPictographic>(); /// /// assert!(extended_pictographic.contains('')); // U+1F973 FACE WITH PARTY HORN AND PARTY HAT /// assert!(!extended_pictographic.contains('')); // U+1F1EA REGIONAL INDICATOR SYMBOL LETTER E /// ```
}
make_binary_property! {
name: "graph";
short_name: "graph";
ident: Graph;
data_marker: crate::provider::PropertyBinaryGraphV1;
singleton: SINGLETON_PROPERTY_BINARY_GRAPH_V1; /// Invisible characters. /// /// This is defined for POSIX compatibility.
}
make_binary_property! {
name: "Grapheme_Base";
short_name: "Gr_Base";
ident: GraphemeBase;
data_marker: crate::provider::PropertyBinaryGraphemeBaseV1;
singleton: SINGLETON_PROPERTY_BINARY_GRAPHEME_BASE_V1; /// Property used together with the definition of Standard Korean Syllable Block to define /// "Grapheme base". /// /// See D58 in Chapter 3, Conformance in the Unicode Standard. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::GraphemeBase; /// /// let grapheme_base = CodePointSetData::new::<GraphemeBase>(); /// /// assert!(grapheme_base.contains('ക')); // U+0D15 MALAYALAM LETTER KA /// assert!(grapheme_base.contains('\u{0D3F}')); // U+0D3F MALAYALAM VOWEL SIGN I /// assert!(!grapheme_base.contains('\u{0D3E}')); // U+0D3E MALAYALAM VOWEL SIGN AA /// ```
}
make_binary_property! {
name: "Grapheme_Extend";
short_name: "Gr_Ext";
ident: GraphemeExtend;
data_marker: crate::provider::PropertyBinaryGraphemeExtendV1;
singleton: SINGLETON_PROPERTY_BINARY_GRAPHEME_EXTEND_V1; /// Property used to define "Grapheme extender". /// /// See D59 in Chapter 3, Conformance in the /// Unicode Standard. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::GraphemeExtend; /// /// let grapheme_extend = CodePointSetData::new::<GraphemeExtend>(); /// /// assert!(!grapheme_extend.contains('ക')); // U+0D15 MALAYALAM LETTER KA /// assert!(!grapheme_extend.contains('\u{0D3F}')); // U+0D3F MALAYALAM VOWEL SIGN I /// assert!(grapheme_extend.contains('\u{0D3E}')); // U+0D3E MALAYALAM VOWEL SIGN AA /// ```
make_binary_property! {
name: "Hex_Digit";
short_name: "Hex";
ident: HexDigit;
data_marker: crate::provider::PropertyBinaryHexDigitV1;
singleton: SINGLETON_PROPERTY_BINARY_HEX_DIGIT_V1; /// Characters commonly used for the representation of hexadecimal numbers, plus their /// compatibility equivalents. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::HexDigit; /// /// let hex_digit = CodePointSetData::new::<HexDigit>(); /// /// assert!(hex_digit.contains('0')); /// assert!(!hex_digit.contains('੩')); // U+0A69 GURMUKHI DIGIT THREE /// assert!(hex_digit.contains('f')); /// assert!(hex_digit.contains('f')); // U+FF46 FULLWIDTH LATIN SMALL LETTER F /// assert!(hex_digit.contains('F')); // U+FF26 FULLWIDTH LATIN CAPITAL LETTER F /// assert!(!hex_digit.contains('Ä')); // U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS /// ```
}
make_binary_property! {
name: "Hyphen";
short_name: "Hyphen";
ident: Hyphen;
data_marker: crate::provider::PropertyBinaryHyphenV1;
singleton: SINGLETON_PROPERTY_BINARY_HYPHEN_V1; /// Deprecated property. /// /// Dashes which are used to mark connections between pieces of /// words, plus the Katakana middle dot.
}
make_binary_property! {
name: "ID_Continue";
short_name: "IDC";
ident: IdContinue;
data_marker: crate::provider::PropertyBinaryIdContinueV1;
singleton: SINGLETON_PROPERTY_BINARY_ID_CONTINUE_V1; /// Characters that can come after the first character in an identifier. /// /// If using NFKC to /// fold differences between characters, use [`XidContinue`] instead. See /// [`Unicode Standard Annex #31`](https://www.unicode.org/reports/tr31/tr31-35.html) for /// more details. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::IdContinue; /// /// let id_continue = CodePointSetData::new::<IdContinue>(); /// /// assert!(id_continue.contains('x')); /// assert!(id_continue.contains('1')); /// assert!(id_continue.contains('_')); /// assert!(id_continue.contains('ߝ')); // U+07DD NKO LETTER FA /// assert!(!id_continue.contains('ⓧ')); // U+24E7 CIRCLED LATIN SMALL LETTER X /// assert!(id_continue.contains('\u{FC5E}')); // ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM /// ```
}
make_binary_property! {
name: "Ideographic";
short_name: "Ideo";
ident: Ideographic;
data_marker: crate::provider::PropertyBinaryIdeographicV1;
singleton: SINGLETON_PROPERTY_BINARY_IDEOGRAPHIC_V1; /// Characters considered to be CJKV (Chinese, Japanese, Korean, and Vietnamese) /// ideographs, or related siniform ideographs /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::Ideographic; /// /// let ideographic = CodePointSetData::new::<Ideographic>(); /// /// assert!(ideographic.contains('川')); // U+5DDD CJK UNIFIED IDEOGRAPH-5DDD /// assert!(!ideographic.contains('밥')); // U+BC25 HANGUL SYLLABLE BAB /// ```
}
make_binary_property! {
name: "ID_Start";
short_name: "IDS";
ident: IdStart;
data_marker: crate::provider::PropertyBinaryIdStartV1;
singleton: SINGLETON_PROPERTY_BINARY_ID_START_V1; /// Characters that can begin an identifier. /// /// If using NFKC to fold differences between /// characters, use [`XidStart`] instead. See [`Unicode Standard Annex /// #31`](https://www.unicode.org/reports/tr31/tr31-35.html) for more details. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::IdStart; /// /// let id_start = CodePointSetData::new::<IdStart>(); /// /// assert!(id_start.contains('x')); /// assert!(!id_start.contains('1')); /// assert!(!id_start.contains('_')); /// assert!(id_start.contains('ߝ')); // U+07DD NKO LETTER FA /// assert!(!id_start.contains('ⓧ')); // U+24E7 CIRCLED LATIN SMALL LETTER X /// assert!(id_start.contains('\u{FC5E}')); // ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM /// ```
}
make_binary_property! {
name: "IDS_Binary_Operator";
short_name: "IDSB";
ident: IdsBinaryOperator;
data_marker: crate::provider::PropertyBinaryIdsBinaryOperatorV1;
singleton: SINGLETON_PROPERTY_BINARY_IDS_BINARY_OPERATOR_V1; /// Characters used in Ideographic Description Sequences. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::IdsBinaryOperator; /// /// let ids_binary_operator = CodePointSetData::new::<IdsBinaryOperator>(); /// /// assert!(ids_binary_operator.contains('\u{2FF5}')); // IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM ABOVE /// assert!(!ids_binary_operator.contains('\u{3006}')); // IDEOGRAPHIC CLOSING MARK /// ```
}
make_binary_property! {
name: "IDS_Trinary_Operator";
short_name: "IDST";
ident: IdsTrinaryOperator;
data_marker: crate::provider::PropertyBinaryIdsTrinaryOperatorV1;
singleton: SINGLETON_PROPERTY_BINARY_IDS_TRINARY_OPERATOR_V1; /// Characters used in Ideographic Description Sequences. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::IdsTrinaryOperator; /// /// let ids_trinary_operator = CodePointSetData::new::<IdsTrinaryOperator>(); /// /// assert!(ids_trinary_operator.contains('\u{2FF2}')); // IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO MIDDLE AND RIGHT /// assert!(ids_trinary_operator.contains('\u{2FF3}')); // IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO MIDDLE AND BELOW /// assert!(!ids_trinary_operator.contains('\u{2FF4}')); /// assert!(!ids_trinary_operator.contains('\u{2FF5}')); // IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM ABOVE /// assert!(!ids_trinary_operator.contains('\u{3006}')); // IDEOGRAPHIC CLOSING MARK /// ```
}
make_binary_property! {
name: "Join_Control";
short_name: "Join_C";
ident: JoinControl;
data_marker: crate::provider::PropertyBinaryJoinControlV1;
singleton: SINGLETON_PROPERTY_BINARY_JOIN_CONTROL_V1; /// Format control characters which have specific functions for control of cursive joining /// and ligation. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::JoinControl; /// /// let join_control = CodePointSetData::new::<JoinControl>(); /// /// assert!(join_control.contains('\u{200C}')); // ZERO WIDTH NON-JOINER /// assert!(join_control.contains('\u{200D}')); // ZERO WIDTH JOINER /// assert!(!join_control.contains('\u{200E}')); /// ```
}
make_binary_property! {
name: "Logical_Order_Exception";
short_name: "LOE";
ident: LogicalOrderException;
data_marker: crate::provider::PropertyBinaryLogicalOrderExceptionV1;
singleton: SINGLETON_PROPERTY_BINARY_LOGICAL_ORDER_EXCEPTION_V1; /// A small number of spacing vowel letters occurring in certain Southeast Asian scripts such as Thai and Lao. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::LogicalOrderException; /// /// let logical_order_exception = CodePointSetData::new::<LogicalOrderException>(); /// /// assert!(logical_order_exception.contains('ແ')); // U+0EC1 LAO VOWEL SIGN EI /// assert!(!logical_order_exception.contains('ະ')); // U+0EB0 LAO VOWEL SIGN A /// ```
}
make_binary_property! {
name: "Noncharacter_Code_Point";
short_name: "NChar";
ident: NoncharacterCodePoint;
data_marker: crate::provider::PropertyBinaryNoncharacterCodePointV1;
singleton: SINGLETON_PROPERTY_BINARY_NONCHARACTER_CODE_POINT_V1; /// Code points permanently reserved for internal use. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::NoncharacterCodePoint; /// /// let noncharacter_code_point = CodePointSetData::new::<NoncharacterCodePoint>(); /// /// assert!(noncharacter_code_point.contains('\u{FDD0}')); /// assert!(noncharacter_code_point.contains('\u{FFFF}')); /// assert!(!noncharacter_code_point.contains('\u{10000}')); /// ```
}
make_binary_property! {
name: "NFC_Inert";
short_name: "nfcinert";
ident: NfcInert;
data_marker: crate::provider::PropertyBinaryNfcInertV1;
singleton: SINGLETON_PROPERTY_BINARY_NFC_INERT_V1; /// Characters that are inert under NFC, i.e., they do not interact with adjacent characters.
}
make_binary_property! {
name: "NFD_Inert";
short_name: "nfdinert";
ident: NfdInert;
data_marker: crate::provider::PropertyBinaryNfdInertV1;
singleton: SINGLETON_PROPERTY_BINARY_NFD_INERT_V1; /// Characters that are inert under NFD, i.e., they do not interact with adjacent characters.
}
make_binary_property! {
name: "NFKC_Inert";
short_name: "nfkcinert";
ident: NfkcInert;
data_marker: crate::provider::PropertyBinaryNfkcInertV1;
singleton: SINGLETON_PROPERTY_BINARY_NFKC_INERT_V1; /// Characters that are inert under NFKC, i.e., they do not interact with adjacent characters.
}
make_binary_property! {
name: "NFKD_Inert";
short_name: "nfkdinert";
ident: NfkdInert;
data_marker: crate::provider::PropertyBinaryNfkdInertV1;
singleton: SINGLETON_PROPERTY_BINARY_NFKD_INERT_V1; /// Characters that are inert under NFKD, i.e., they do not interact with adjacent characters.
}
make_binary_property! {
name: "Pattern_Syntax";
short_name: "Pat_Syn";
ident: PatternSyntax;
data_marker: crate::provider::PropertyBinaryPatternSyntaxV1;
singleton: SINGLETON_PROPERTY_BINARY_PATTERN_SYNTAX_V1; /// Characters used as syntax in patterns (such as regular expressions). /// /// See [`Unicode /// Standard Annex #31`](https://www.unicode.org/reports/tr31/tr31-35.html) for more /// details. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::PatternSyntax; /// /// let pattern_syntax = CodePointSetData::new::<PatternSyntax>(); /// /// assert!(pattern_syntax.contains('{')); /// assert!(pattern_syntax.contains('⇒')); // U+21D2 RIGHTWARDS DOUBLE ARROW /// assert!(!pattern_syntax.contains('0')); /// ```
}
make_binary_property! {
name: "Pattern_White_Space";
short_name: "Pat_WS";
ident: PatternWhiteSpace;
data_marker: crate::provider::PropertyBinaryPatternWhiteSpaceV1;
singleton: SINGLETON_PROPERTY_BINARY_PATTERN_WHITE_SPACE_V1; /// Characters used as whitespace in patterns (such as regular expressions). /// /// See /// [`Unicode Standard Annex #31`](https://www.unicode.org/reports/tr31/tr31-35.html) for /// more details. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::PatternWhiteSpace; /// /// let pattern_white_space = CodePointSetData::new::<PatternWhiteSpace>(); /// /// assert!(pattern_white_space.contains(' ')); /// assert!(pattern_white_space.contains('\u{2029}')); // PARAGRAPH SEPARATOR /// assert!(pattern_white_space.contains('\u{000A}')); // NEW LINE /// assert!(!pattern_white_space.contains('\u{00A0}')); // NO-BREAK SPACE /// ```
}
make_binary_property! {
name: "Prepended_Concatenation_Mark";
short_name: "PCM";
ident: PrependedConcatenationMark;
data_marker: crate::provider::PropertyBinaryPrependedConcatenationMarkV1;
singleton: SINGLETON_PROPERTY_BINARY_PREPENDED_CONCATENATION_MARK_V1; /// A small class of visible format controls, which precede and then span a sequence of /// other characters, usually digits.
}
make_binary_property! {
name: "print";
short_name: "print";
ident: Print;
data_marker: crate::provider::PropertyBinaryPrintV1;
singleton: SINGLETON_PROPERTY_BINARY_PRINT_V1; /// Printable characters (visible characters and whitespace). /// /// This is defined for POSIX compatibility.
}
make_binary_property! {
name: "Quotation_Mark";
short_name: "QMark";
ident: QuotationMark;
data_marker: crate::provider::PropertyBinaryQuotationMarkV1;
singleton: SINGLETON_PROPERTY_BINARY_QUOTATION_MARK_V1; /// Punctuation characters that function as quotation marks. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::QuotationMark; /// /// let quotation_mark = CodePointSetData::new::<QuotationMark>(); /// /// assert!(quotation_mark.contains('\'')); /// assert!(quotation_mark.contains('„')); // U+201E DOUBLE LOW-9 QUOTATION MARK /// assert!(!quotation_mark.contains('<')); /// ```
}
make_binary_property! {
name: "Radical";
short_name: "Radical";
ident: Radical;
data_marker: crate::provider::PropertyBinaryRadicalV1;
singleton: SINGLETON_PROPERTY_BINARY_RADICAL_V1; /// Characters used in the definition of Ideographic Description Sequences. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::Radical; /// /// let radical = CodePointSetData::new::<Radical>(); /// /// assert!(radical.contains('⺆')); // U+2E86 CJK RADICAL BOX /// assert!(!radical.contains('丹')); // U+F95E CJK COMPATIBILITY IDEOGRAPH-F95E /// ```
}
make_binary_property! {
name: "Regional_Indicator";
short_name: "RI";
ident: RegionalIndicator;
data_marker: crate::provider::PropertyBinaryRegionalIndicatorV1;
singleton: SINGLETON_PROPERTY_BINARY_REGIONAL_INDICATOR_V1; /// Regional indicator characters, `U+1F1E6..U+1F1FF`. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::RegionalIndicator; /// /// let regional_indicator = CodePointSetData::new::<RegionalIndicator>(); /// /// assert!(regional_indicator.contains('')); // U+1F1F9 REGIONAL INDICATOR SYMBOL LETTER T /// assert!(!regional_indicator.contains('Ⓣ')); // U+24C9 CIRCLED LATIN CAPITAL LETTER T /// assert!(!regional_indicator.contains('T')); /// ```
}
make_binary_property! {
name: "Soft_Dotted";
short_name: "SD";
ident: SoftDotted;
data_marker: crate::provider::PropertyBinarySoftDottedV1;
singleton: SINGLETON_PROPERTY_BINARY_SOFT_DOTTED_V1; /// Characters with a "soft dot", like i or j. /// /// An accent placed on these characters causes /// the dot to disappear. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::SoftDotted; /// /// let soft_dotted = CodePointSetData::new::<SoftDotted>(); /// /// assert!(soft_dotted.contains('і')); //U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I /// assert!(!soft_dotted.contains('ı')); // U+0131 LATIN SMALL LETTER DOTLESS I /// ```
}
make_binary_property! {
name: "Segment_Starter";
short_name: "segstart";
ident: SegmentStarter;
data_marker: crate::provider::PropertyBinarySegmentStarterV1;
singleton: SINGLETON_PROPERTY_BINARY_SEGMENT_STARTER_V1; /// Characters that are starters in terms of Unicode normalization and combining character /// sequences.
}
make_binary_property! {
name: "Case_Sensitive";
short_name: "Sensitive";
ident: CaseSensitive;
data_marker: crate::provider::PropertyBinaryCaseSensitiveV1;
singleton: SINGLETON_PROPERTY_BINARY_CASE_SENSITIVE_V1; /// Characters that are either the source of a case mapping or in the target of a case /// mapping.
}
make_binary_property! {
name: "Sentence_Terminal";
short_name: "STerm";
ident: SentenceTerminal;
data_marker: crate::provider::PropertyBinarySentenceTerminalV1;
singleton: SINGLETON_PROPERTY_BINARY_SENTENCE_TERMINAL_V1; /// Punctuation characters that generally mark the end of sentences. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::SentenceTerminal; /// /// let sentence_terminal = CodePointSetData::new::<SentenceTerminal>(); /// /// assert!(sentence_terminal.contains('.')); /// assert!(sentence_terminal.contains('?')); /// assert!(sentence_terminal.contains('᪨')); // U+1AA8 TAI THAM SIGN KAAN /// assert!(!sentence_terminal.contains(',')); /// assert!(!sentence_terminal.contains('¿')); // U+00BF INVERTED QUESTION MARK /// ```
}
make_binary_property! {
name: "Terminal_Punctuation";
short_name: "Term";
ident: TerminalPunctuation;
data_marker: crate::provider::PropertyBinaryTerminalPunctuationV1;
singleton: SINGLETON_PROPERTY_BINARY_TERMINAL_PUNCTUATION_V1; /// Punctuation characters that generally mark the end of textual units. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::TerminalPunctuation; /// /// let terminal_punctuation = CodePointSetData::new::<TerminalPunctuation>(); /// /// assert!(terminal_punctuation.contains('.')); /// assert!(terminal_punctuation.contains('?')); /// assert!(terminal_punctuation.contains('᪨')); // U+1AA8 TAI THAM SIGN KAAN /// assert!(terminal_punctuation.contains(',')); /// assert!(!terminal_punctuation.contains('¿')); // U+00BF INVERTED QUESTION MARK /// ```
}
make_binary_property! {
name: "Unified_Ideograph";
short_name: "UIdeo";
ident: UnifiedIdeograph;
data_marker: crate::provider::PropertyBinaryUnifiedIdeographV1;
singleton: SINGLETON_PROPERTY_BINARY_UNIFIED_IDEOGRAPH_V1; /// A property which specifies the exact set of Unified CJK Ideographs in the standard. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::UnifiedIdeograph; /// /// let unified_ideograph = CodePointSetData::new::<UnifiedIdeograph>(); /// /// assert!(unified_ideograph.contains('川')); // U+5DDD CJK UNIFIED IDEOGRAPH-5DDD /// assert!(unified_ideograph.contains('木')); // U+6728 CJK UNIFIED IDEOGRAPH-6728 /// assert!(!unified_ideograph.contains('')); // U+1B178 NUSHU CHARACTER-1B178 /// ```
}
make_binary_property! {
name: "Variation_Selector";
short_name: "VS";
ident: VariationSelector;
data_marker: crate::provider::PropertyBinaryVariationSelectorV1;
singleton: SINGLETON_PROPERTY_BINARY_VARIATION_SELECTOR_V1; /// Characters that are Variation Selectors. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::VariationSelector; /// /// let variation_selector = CodePointSetData::new::<VariationSelector>(); /// /// assert!(variation_selector.contains('\u{180D}')); // MONGOLIAN FREE VARIATION SELECTOR THREE /// assert!(!variation_selector.contains('\u{303E}')); // IDEOGRAPHIC VARIATION INDICATOR /// assert!(variation_selector.contains('\u{FE0F}')); // VARIATION SELECTOR-16 /// assert!(!variation_selector.contains('\u{FE10}')); // PRESENTATION FORM FOR VERTICAL COMMA /// assert!(variation_selector.contains('\u{E01EF}')); // VARIATION SELECTOR-256 /// ```
}
make_binary_property! {
name: "White_Space";
short_name: "WSpace";
ident: WhiteSpace;
data_marker: crate::provider::PropertyBinaryWhiteSpaceV1;
singleton: SINGLETON_PROPERTY_BINARY_WHITE_SPACE_V1; /// Spaces, separator characters and other control characters which should be treated by /// programming languages as "white space" for the purpose of parsing elements. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::WhiteSpace; /// /// let white_space = CodePointSetData::new::<WhiteSpace>(); /// /// assert!(white_space.contains(' ')); /// assert!(white_space.contains('\u{000A}')); // NEW LINE /// assert!(white_space.contains('\u{00A0}')); // NO-BREAK SPACE /// assert!(!white_space.contains('\u{200B}')); // ZERO WIDTH SPACE /// ```
}
make_binary_property! {
name: "xdigit";
short_name: "xdigit";
ident: Xdigit;
data_marker: crate::provider::PropertyBinaryXdigitV1;
singleton: SINGLETON_PROPERTY_BINARY_XDIGIT_V1; /// Hexadecimal digits /// /// This is defined for POSIX compatibility.
}
make_binary_property! {
name: "XID_Continue";
short_name: "XIDC";
ident: XidContinue;
data_marker: crate::provider::PropertyBinaryXidContinueV1;
singleton: SINGLETON_PROPERTY_BINARY_XID_CONTINUE_V1; /// Characters that can come after the first character in an identifier. /// /// See [`Unicode Standard Annex /// #31`](https://www.unicode.org/reports/tr31/tr31-35.html) for more details. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::XidContinue; /// /// let xid_continue = CodePointSetData::new::<XidContinue>(); /// /// assert!(xid_continue.contains('x')); /// assert!(xid_continue.contains('1')); /// assert!(xid_continue.contains('_')); /// assert!(xid_continue.contains('ߝ')); // U+07DD NKO LETTER FA /// assert!(!xid_continue.contains('ⓧ')); // U+24E7 CIRCLED LATIN SMALL LETTER X /// assert!(!xid_continue.contains('\u{FC5E}')); // ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM /// ```
}
make_binary_property! {
name: "XID_Start";
short_name: "XIDS";
ident: XidStart;
data_marker: crate::provider::PropertyBinaryXidStartV1;
singleton: SINGLETON_PROPERTY_BINARY_XID_START_V1; /// Characters that can begin an identifier. /// /// See [`Unicode /// Standard Annex #31`](https://www.unicode.org/reports/tr31/tr31-35.html) for more /// details. /// /// # Example /// /// ``` /// use icu::properties::CodePointSetData; /// use icu::properties::props::XidStart; /// /// let xid_start = CodePointSetData::new::<XidStart>(); /// /// assert!(xid_start.contains('x')); /// assert!(!xid_start.contains('1')); /// assert!(!xid_start.contains('_')); /// assert!(xid_start.contains('ߝ')); // U+07DD NKO LETTER FA /// assert!(!xid_start.contains('ⓧ')); // U+24E7 CIRCLED LATIN SMALL LETTER X /// assert!(!xid_start.contains('\u{FC5E}')); // ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM /// ```
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.93Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.