pub struct DecomposingNormalizer {
pub(crate) decompositions: DataPayload<NormalizerNfdDataV1>,
pub(crate) tables: DataPayload<NormalizerNfdTablesV1>,
pub(crate) supplementary_tables: Option<DataPayload<NormalizerNfkdTablesV1>>,
pub(crate) decomposition_passthrough_bound: u8,
pub(crate) composition_passthrough_bound: u16,
}Expand description
A normalizer for performing decomposing normalization.
Fields§
§decompositions: DataPayload<NormalizerNfdDataV1>§tables: DataPayload<NormalizerNfdTablesV1>§supplementary_tables: Option<DataPayload<NormalizerNfkdTablesV1>>§decomposition_passthrough_bound: u8§composition_passthrough_bound: u16Implementations§
Source§impl DecomposingNormalizer
impl DecomposingNormalizer
Sourcepub fn as_borrowed(&self) -> DecomposingNormalizerBorrowed<'_>
pub fn as_borrowed(&self) -> DecomposingNormalizerBorrowed<'_>
Constructs a borrowed version of this type for more efficient querying.
Sourcepub const fn new_nfd() -> DecomposingNormalizerBorrowed<'static>
pub const fn new_nfd() -> DecomposingNormalizerBorrowed<'static>
NFD constructor using compiled data.
✨ Enabled with the compiled_data Cargo feature.
Sourcepub fn try_new_nfd_unstable<D>(provider: &D) -> Result<Self, DataError>
pub fn try_new_nfd_unstable<D>(provider: &D) -> Result<Self, DataError>
A version of Self::new_nfd that uses custom data provided by a DataProvider.
Sourcepub const fn new_nfkd() -> DecomposingNormalizerBorrowed<'static>
pub const fn new_nfkd() -> DecomposingNormalizerBorrowed<'static>
NFKD constructor using compiled data.
✨ Enabled with the compiled_data Cargo feature.
Sourcepub fn try_new_nfkd_unstable<D>(provider: &D) -> Result<Self, DataError>where
D: DataProvider<NormalizerNfkdDataV1> + DataProvider<NormalizerNfdTablesV1> + DataProvider<NormalizerNfkdTablesV1> + ?Sized,
pub fn try_new_nfkd_unstable<D>(provider: &D) -> Result<Self, DataError>where
D: DataProvider<NormalizerNfkdDataV1> + DataProvider<NormalizerNfdTablesV1> + DataProvider<NormalizerNfkdTablesV1> + ?Sized,
A version of Self::new_nfkd that uses custom data provided by a DataProvider.
Sourcepub(crate) fn try_new_uts46_decomposed_unstable<D>(
provider: &D,
) -> Result<Self, DataError>
pub(crate) fn try_new_uts46_decomposed_unstable<D>( provider: &D, ) -> Result<Self, DataError>
UTS 46 decomposed constructor (testing only)
This is a special building block normalization for IDNA. It is the decomposed counterpart of ICU4C’s UTS 46 normalization with two exceptions: characters that UTS 46 disallows and ICU4C maps to U+FFFD and characters that UTS 46 maps to the empty string normalize as in NFD in this normalization. In both cases, the previous UTS 46 processing before using normalization is expected to deal with these characters. Making the disallowed characters behave like this is beneficial to data size, and this normalizer implementation cannot deal with a character normalizing to the empty string, which doesn’t happen in NFD or NFKD as of Unicode 14.
Warning: In this normalization, U+0345 COMBINING GREEK YPOGEGRAMMENI exhibits a behavior that no character in Unicode exhibits in NFD, NFKD, NFC, or NFKC: Case folding turns U+0345 from a reordered character into a non-reordered character before reordering happens. Therefore, the output of this normalization may differ for different inputs that are canonically equivalent with each other if they differ by how U+0345 is ordered relative to other reorderable characters.