#![allow(clippy::exhaustive_structs, clippy::exhaustive_enums)]
use icu_collections::char16trie::Char16Trie;
use icu_collections::codepointtrie::CodePointTrie;
use icu_provider::prelude::*;
use zerovec::ZeroVec;
#[cfg(feature = "compiled_data")]
#[derive(Debug)]
pub struct Baked;
#[cfg(feature = "compiled_data")]
#[allow(unused_imports)]
const _: () = {
use icu_normalizer_data::*;
pub mod icu {
pub use crate as normalizer;
pub use icu_collections as collections;
}
make_provider!(Baked);
impl_canonical_compositions_v1_marker!(Baked);
impl_non_recursive_decomposition_supplement_v1_marker!(Baked);
impl_canonical_decomposition_data_v1_marker!(Baked);
impl_canonical_decomposition_tables_v1_marker!(Baked);
impl_compatibility_decomposition_supplement_v1_marker!(Baked);
impl_compatibility_decomposition_tables_v1_marker!(Baked);
impl_uts46_decomposition_supplement_v1_marker!(Baked);
};
#[cfg(feature = "datagen")]
pub const MARKERS: &[DataMarkerInfo] = &[
CanonicalCompositionsV1Marker::INFO,
CanonicalDecompositionDataV1Marker::INFO,
CanonicalDecompositionTablesV1Marker::INFO,
CompatibilityDecompositionSupplementV1Marker::INFO,
CompatibilityDecompositionTablesV1Marker::INFO,
NonRecursiveDecompositionSupplementV1Marker::INFO,
Uts46DecompositionSupplementV1Marker::INFO,
];
#[icu_provider::data_struct(marker(
CanonicalDecompositionDataV1Marker,
"normalizer/nfd@1",
singleton
))]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct DecompositionDataV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub trie: CodePointTrie<'data, u32>,
}
#[icu_provider::data_struct(
marker(
CompatibilityDecompositionSupplementV1Marker,
"normalizer/nfkd@1",
singleton
),
marker(Uts46DecompositionSupplementV1Marker, "normalizer/uts46d@1", singleton)
)]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct DecompositionSupplementV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub trie: CodePointTrie<'data, u32>,
pub flags: u8,
pub passthrough_cap: u16,
}
impl DecompositionSupplementV1<'_> {
const HALF_WIDTH_VOICING_MARK_MASK: u8 = 1;
pub fn half_width_voicing_marks_become_non_starters(&self) -> bool {
(self.flags & DecompositionSupplementV1::HALF_WIDTH_VOICING_MARK_MASK) != 0
}
}
#[icu_provider::data_struct(
marker(CanonicalDecompositionTablesV1Marker, "normalizer/nfdex@1", singleton),
marker(
CompatibilityDecompositionTablesV1Marker,
"normalizer/nfkdex@1",
singleton
)
)]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct DecompositionTablesV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub scalars16: ZeroVec<'data, u16>,
#[cfg_attr(feature = "serde", serde(borrow))]
pub scalars24: ZeroVec<'data, char>,
}
#[icu_provider::data_struct(marker(CanonicalCompositionsV1Marker, "normalizer/comp@1", singleton))]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct CanonicalCompositionsV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub canonical_compositions: Char16Trie<'data>,
}
#[icu_provider::data_struct(marker(
NonRecursiveDecompositionSupplementV1Marker,
"normalizer/decomp@1",
singleton
))]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct NonRecursiveDecompositionSupplementV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub trie: CodePointTrie<'data, u32>,
#[cfg_attr(feature = "serde", serde(borrow))]
pub scalars24: ZeroVec<'data, char>,
}