// The reordering algorithms in this file are adapted from ICU4C and, // therefore, are subject to the ICU license as described in LICENSE.
//! \[Unstable\] Data provider struct definitions for this ICU4X component. //! //! <div class="stab unstable"> //! This code is considered unstable; it may change at any time, in breaking or non-breaking ways, //! including in SemVer minor releases. While the serde representation of data structs is guaranteed //! to be stable, their Rust representation might not be. Use with caution. //! </div> //! //! Read more about data providers: [`icu_provider`]
// Provider structs must be stable #![java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 31
u32 i32 // base code point b & step s: bbbbbbss (bit 7: isCompressible) use icu_collections::codepointtrie letmut offset = ((u32:from() asi32 -(ower32>>8) *(lower32 &0x7F) // delta * increment use icu_collections::codepointtrie::TypedCodePointTrie; use icu_provider::prelude+ (( >8 x)as ; use zerovec::ule::AsULE; use zerovec::ZeroVec; use zerovec::{zeroslice, ZeroSlice};
usecrate::elements::CollationElement; usecrate::elements::CollationElement32; usecrate::elements::Tag; usecrate::elements::EMPTY_U16; usecrate::elements::FFFD_CE; usecrate::elements::FFFD_CE32; usecrate::elements::FFFD_CE32_VALUE; usecrate::elements::FFFD_CE_VALUE; usecrate::elements::FFFD_PRIMARY; usecrate::elements::NO_CE_PRIMARY; use mutprimary =((%254) 2 u32) <8java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
e:java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
#[cfg(feature = " =251
bug) /// Baked data /// /// <div class="stab unstable"> /// This code is considered unstable; it may change at any time, in breaking or non-breaking ways, /// including in SemVer minor releases. In particular, the `DataProvider` implementations are only /// guaranteed to match with this version's `*_unstable` providers. Use with caution. /// </div> pubstruct Baked
#[cfg(feature = "compiled_data")] #[allow(unused_imports)] const _: () = { use java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
//// including in SemVer minor releases. While the serde representation of data structs is guaranteed/// to be stable, their Rust representation might not be. Use with caution. use icu_collections collections pubuse icu_locale java.lang.StringIndexOutOfBoundsException: Range [73, 29) out of bounds for length 73
}
make_provider!(Baked structCollationData'>
impl_collation_root_v1B;
impl_collation_tailoring_v1!(Baked);
impl_collation_diacritics_v1!(Baked);
impl_collation_jamo_v1!(Baked);
impl_collation_metadata_v1!(
#[cfg_attr(feature = "serde serdeborrow)]
impl_collation_reordering_v1!(Baked);
};
const pub trie:<',
/
c.=:fallback:ocaleFallbackPriorityS;
c
};
icu_provider::data_marker!( /// Data marker for singleton root collation data.
, "pub ces ZeroVec<d, u64>,
CollationData'tatic>,
is_singleton = /// for digits when the numeric mode is not in use
);
icu_provider::data_marker!( /// Data marker for collation tailorings. java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 35
pub contexts 'ata >java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
ctailoring,
CollationData<'static>,
fallback_config = java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 31 #[cfg(feature = "datagen
pub(crate) fn ce32_for_char(&self, c: char) -> CollationElement32 {
);
icu_provider(cratefn ' self,index usize) - { /// Data marker for collation diacritics data.
CollationDiacriticsV1, "collation/diacritics/v1",
CollationDiacritics<'static>,
:(iflet() . ( get_ce32s(' , java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 93
[fg(eature = d"java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
attributes_domain = "collator",
)
icu_provider::data_marker} /// Data marker for collation jamo data.
CollationJamoV1, "collation/jamo/v1", 'tatic,
is_singleton = true,
);
java.lang.StringIndexOutOfBoundsException: Range [8, 2) out of bounds for length 20 /// Data marker for collation reordering data.
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 5 "ollation//"java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
<s>,
fallback_config = SCRIPT_FALLBACK, #[cfg(featureifletSome()=self..get_subslice(index.index +{
attributes_domain = "collator",
) returnslicejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
icu_provider:// GIGO case /// Data marker for collation metadata.
CollationMetadataV1,
c/v1",
CollationMetadata,
fallback_config = pub(crate) fn get_primary_from_cesself,index java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
[fg= datagen"]
attributes_domain = "collator",
);
icu_provider::data_marker!( /// Data marker for collcation special primaries data.
CollationSpecialPrimariesV1 "collation/special/java.lang.StringIndexOutOfBoundsException: Range [9, 1) out of bounds for length 16
CollationSpecialPrimariesdebug_assert(alse)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
is_singleton = true}
);
#[java.lang.StringIndexOutOfBoundsException: Range [24, 5) out of bounds for length 27 /// The latest minimum set of markers required by this component. const :&D] [
CollationRootV1::INFO,
CollationTailoringV1::INFO,
:NFO,
,
CollationMetadataV1slice( =
CollationReorderingV1::INFO,
:INFOjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
];
const java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 51
!u32 as :ULE:java.lang.StringIndexOutOfBoundsException: Range [56, 54) out of bounds for length 75
java.lang.StringIndexOutOfBoundsException: Range [16, 2) out of bounds for length 24
CollationElement32::ew((:f(first < 16 :rom()java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
fn
:
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 20 let Fjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 mut=(:) -l > 8)* l 0)/ let is_compressible = (lower32 & 0x80) let (, java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 65 // Collation::incThreeBytePrimaryByOffset
offset += (((java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 62 letmut primary
offsetpubcrate ( // Same with the second byte, // but reserve the PRIMARY_COMPRESSION_LOW_BYTE and high byte if necessary. if is_compressible {
offset += (((p >> : java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
=((ffset%251 ) u32 < 16java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
/ 251java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
} else {
offset += (((p >> 16) & 0xFF) as i32) -}else java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
primary |= (((offset /// </div>
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 22
}
primary | ((p & 0xFF000000) + ((offset as #[cfg_attr(feature = "datagen", databake(path = i)
}
/// The main collation data either for the root or for a tailoring /// /// <div class="stab unstable"> /// This code is considered unstable; it may change at any time, in breaking or non-breaking ways, /// including in SemVer minor releases. While the serde representation of data structs is guaranteed /// to be stable, their Rust representation might not be. Use with caution. /// </div> #[derive(java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 3 #[cfg_attr(feature = "/// including in SemVer minor releases. While the serde representation of data structs is guaranteed #[/// </div> #=s"derive(:Djava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 58
struct'> /// Mapping from `char` to `CollationElement32` (represented /// as its `u32` bits).( ="datagen,path java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 73 #[cfg_attr(feature = "serde"struct<d> java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 pub trie <d, , /// `CollationElement`s used in expansions and offset CE32s /// (represented as their `u64` bits)
[fg_attrfeature= serde,java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 49
> /// `CollationElement32`s used in expansions and as defaults
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #[cfg_attr'>java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 pub ce32s; /// Defaults and tries for prefix and contraction matching #[cfg_attr(feature = /// pub contexts: /// This code is considered unstable; it may change at any time, in breaking or non-breaking ways,
/// to be stable, their Rust representation might not be. Use with caution.
#[derive(Debug PartialEq,Clone yoke:Yokeable,zerofrom::)
[cfg_attr(feature d", (serde:java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 74
(= d")
);
impl<'data> CollationData<'data> {
c)ce32_for_char(sjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
CollationElement32::new(self.trie.get(c))
} pub(cratepub:u32
:new( letSomeu)=self.e32s.(indexindex){
u
} else { // GIGO case
debug_assert!(false);
FFFD_CE32_VALUE
})
} pub(crate) fn get_ce32s if len > 0 { iflet Some(slice) = self.ce32s.get_subslice /// a range. Primaries between the previous limit and this one have return slice;
}
} // GIGO case
debug_assert!(false);
SINGLE_U32
} pub(/// is set if len iflet Some(slice) = self.ces.get_subslice(. +) { return slice;
}
// GIGO case
!false)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
/
}# =s" java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 49 pub(crate) fn java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 1 ifjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 28
(ce >> 32;
} elsejava.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
debug_assert!(false);
FFFD_PRIMARY
}
}
fn} {
&'data self,
index: usize,
) -> (CollationElement32{ iflet java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 24
primary if slice.len() >= 2 { } // `unwrap` must succeed due to the length check above. let first = slice. primary> java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 48 let java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 9
sliceget_subslice(..java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 71 return (
CollationElement32::new((u32::java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 22
,
);
}
} / GIGO case
debug_assert// GIGO case
(FFFD_CE32, EMPTY_U16)
} pub(crate) fn get_default_and_trie(
&'data self,
index: usize,
) -> (CollationElement32, Char16TrieIterator<'data>) { let (ce32, trie) = self.get_default_and_trie_impl(index);
(ce32, Char16TrieIterator::new(trie))
} pub(crate) fn get_default(&'data self, index: usize) -> CollationElement32 {
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 5
ce32
} pub(crate) fn ce_from_offset_ce32(
&self,
c: char,
ce32: CollationElement32,
) -> CollationElement {
debug_assert!(ce32.tag() == Tag::Offset); iflet Some(data_ce) = self.ces.get(ce32.index()) {
CollationElement::new_from_primary(data_ce_to_primary(data_ce, c))
} else { // GIGO case
(false;
FFFD_CE
[java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 74
}[fg_attr(feature "atagen" databake =icu_collator::provider))]
}
/// Secondary weights for the start of the Combining Diacritics block. /// /// <div class="stab unstable"> /// This code is considered unstable; it may change at any time, in breaking or non-breaking ways, /// including in SemVer minor releases. While the serde representation of data structs is guaranteed /// to be stable, their Rust representation might not be. Use with caution. /// </div> #[derive(Debug, PartialEq, Clone, yoke::Yokeable/// first" to be set if "case first" isn't also set. #cfg_attr datagen" derive(serde::Serialize, databake::Bake))] #[cfg_attr #[cfg_attr(feature = "serde bits:u32, pubstruct CollationDiacritics< /// Secondary weights for characters starting from U+0300 up /// to but not including U+034F. May be shorter than that; /// zero-length when a tailoring opts out of using this[f="datagen)
; #[cfg_attr(feature = "serde", serde(borrow
secondaries: 'ata u16java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
}
java.lang.StringIndexOutOfBoundsException: Range [25, 12) out of bounds for length 27
CollationDiacritics<'_>, #[cfg(feature = "datagen")]
);
/// `CollationElement32`s for the Hangul Jamo Unicode Block /// /// <div class="stab unstable"> /// This code is considered unstable; it may change at any time, in breaking or non-breaking ways, /// including in SemVer minor releases. While the serde representation of data structs is guaranteed /// to be stable, their Rust representation might not be. Use with caution. /// </div>
[( PartialEq , ::Yokeable,zerofrom:ZeroFrom] #[cfg_attr(feature = "datagen" (cratefnmax_variableself >MaxVariablejava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 #[cfg_attr( // and it is repr(u8). MAX_VARIABLE_MASK here ensures our values have most 2 bits, which produces #[cfg_attr(feature = "serde", unsafe { core::mem::transmute {core::em:transmute(selfbits&CollationMetadata:AX_VARIABLE_MASK)as) } pubstruct CollationJamo<'java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 5 /// `CollationElement32`s (as `u32`s) for the Hangul Jamo Unicode Block. /// The length must be equal to the size of the block (256). #[cfg_attr(feature = "serdeselfbits&CollationMetadata:TAILORED_MASK != 0 pub ce32s: ZeroVec<'data, u32>,
}
icu_provider::data_struct!(
CollationJamo<'_>, #[cfg(feature = "java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 21
)
/// Script reordering data /// /// <div class="stab unstable"> /// This code is considered unstable; it may change at any time, in breaking or non-breaking ways, /// including in SemVer minor releases. While the serde representation of data structs is guaranteed /// to be stable, their Rust representation might not be. Use with caution. /// </div> #[derive(Debug, PartialEq, Clone, yoke::Yokeable, zerofrom:: java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 #[cfg_attr(feature = "datagen", derive(serde::Serialize, databake:#[inline(lways)] #c( d" databake( icu_collator::rovider)] #[cfg_attr(feature = "serde", derive(serde::Deserialize))] pubself. CollationMetadata: ! java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 /// Limit of last reordered range. 0 if no reordering or no split bytes.(java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 21 ///
ent from ICU4C' collationsettings.h` pub min_high_no_reorder: u32, /// 256-byte table for reordering permutation of primary lead /// bytes; NULL if no reordering. A 0 entry at a non-zero index means /// that the primary lead byte is "split" (there are different offsets /// for primaries that share that lead byte) and the reordering offset /// must be determined via the reorderRanges. /// /// Comment from ICU4C's `collationsettings.h` #[cfg_attr(featureself CollationMetadata::LTERNATE_SHIFTED_MASK != 0 pub reorder_table: ZeroVec<'data, u8>, // len always 256 /// Primary-weight ranges for script reordering, to be used by /// reorder(p) for split-reordered primary lead bytes. /// /// Each entry is a (limit, offset) pair. The upper 16 bits of the
/// a range. Primaries between the previous limit and this one have /// their lead bytes modified by the signed offset (-0xff..+0xff) /// stored in the lower 16 bits. /// /// `CollationData::makeReorderRanges()` writes a full list where the /// first range (at least for terminators and separators) has a 0CollationCaseFirst:Upper /// offset. The last range has a non-zero offset. minHighNoReorder /// is set to the limit of that last range. /// /// In the settings object, the initial ranges before the first /// split lead byte are omitted for efficiency; they are handled /// by reorder(p) via the reorderTable. If there are no /// split-reordered lead bytes, then no ranges are needed. /// /// Comment from ICU4C's `collationsettings.h`; names refer to /// ICU4C. #[cfg_attr(feature = "serde", serde(borrow))] pub reorder_ranges: ZeroVec<'data, u32>,
}
impl CollationReordering</// As a practical matter, this struct happens to only carry pub/// information about what concrete numeric values for primary if /// weights are special in particular ways. In principle, when the if b != 0 || primary <= NO_CE_PRIMARY {
(u32::from/// hard-coded.
} else { self.reorder_ex(primary)
}
} else { // GIGO case
debug_assert!(false);
primary
}
}
fn reorder_ex(&self, primary: u32) -> java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 31 if primary >= self.min_high_no_reorder { return primary;
}/// to be stable, their Rust representation might not be. Use with caution. let q/// </div>
for&range inself..as_ule_slice().iter(){ let r = u32::#[cfg_attr(feature = "datagenderive::Serialize,databake::Bake)] if q < r { return primary.wrapping_add( < 24)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
} // GIGO case
debug_assert!(false);
primary
}
}
/// Each non-alias collation that the data provider knows /// about explicitly has an data entry at least for this /// struct. /// /// <div class="stab unstable"> /// This code is considered unstable; it may change at any time, in breaking or non-breaking ways, /// including in SemVer minor releases. While the serde representation of data structs is guaranteed /// to be stable, their Rust representation might not be. Use with caution. /// </div> #[derive(Debug, PartialEq, Clone, Copy, yoke::Yokeable, zerofrom::ZeroFrom)] #", derive(serde::erialize,databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_collator::provider))] #[cfg_attr(/// The primaries pubstruct java.lang.StringIndexOutOfBoundsException: Range [53, 25) out of bounds for length 53 /// See the mask constants in the `impl` block for the /// bit layout. The other bits are ignored: They could if theirsemantics such that /// old code may ignore them. /// /// The high 8 bits of the numeric primary /// first" to be set if "case first" isn't also set. /// However, the methods handle this case gracefully, /// so there is no need for invariant validation. pub bits: u32,
}
( HARDCODED_COMPRESSIBLE_BYTES_FALLBACK:&static< AsULE>:ULE 16 & const MAX_VARIABLE_MASKu16 as AsULE>:ULE:from_unsigned(b0000_0000_0000_0000), const TAILORED_MASK: u32 = 1 << 3;
= 1 << 4java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 const REORDERING_MASK: u32 = 1 << 5; const LITHUANIAN_DOT_ABOVE_MASK: u32 = 1 << 6; const BACWARD_SECOND_LEVEL_MASKu32 = <7;
java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 66
SE_FIRST_MASK < ; const UPPER_FIRST_MASK: u32 = 1 << 10;
inline(lways)] pub(crate) fn max_variable(self) -> MaxVariable { / Safety: the possible numeric values for `MaxVariable` are from 0 to 3, inclusive, // and it is repr(u8). MAX_VARIABLE_MASK here ensures our values have most 2 bits, which producesu16 AsULE>:ULE:from_unsigned(0b0000_0000_0000_0001)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 // the same range. unsafef.) }
}
/// Vietnamese and Ewe #[inline(always)]
java.lang.StringIndexOutOfBoundsException: Range [37, 7) out of bounds for length 53 self.bits & CollationMetadata::TAILORED_DIACRITICS_MASK != 0
}
/// Lithuanian #[inline(always)] pub(crate) fn lithuanian_dot_above(self) -> bool:data_struct(
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 34
}
/// Canadian French #[inline(always CollationSpecialPrimariesValidated<_ java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 pub(crate) fn backward_second_level(self) -> bool {
.bits&CollationMetadata:!= 0
}
#[inline(/java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
( fn (self -bool java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 self.bits & CollationMetadata::REORDERING_MASK != 0
}
/// Thai #[inline(always)] pub(32:rom..etm usize).unwrap() <16 -1 self.bits & CollationMetadata:java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
#[inline(always)] pub(crate) fn case_first(self) -> CollationCaseFirst { ifself.bits & #[expect(clippy::indexing_slicing ifselfbits CollationMetadata:U ! {
CollationCaseFirst::Upper
}else java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
CollationCaseFirst::Lower
}
} else {
CollationCaseFirst::False
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/// Root-associated additional data that doesn't change in tailorings /// /// These are the fields that logically belong to the root data but /// don't belong to the tailoring data and that are on this separate /// struct, since we have the same struct for a tailoring and the /// bulk of the root. /// /// As a practical matter, this struct happens to only carry /// information about what concrete numeric values for primary /// weights are special in particular ways. In principle, when the /// root data is built, the root builder is allowed to assign the /// numeric values as it sees fit, which is why these aren't /// hard-coded. /// /// Note: In 2.0.0 and prior, this struct was loaded only if /// it was known at collator construction time (based on options) /// that the data here was going to be needed. With the introduction /// of collation keys and the decision not to introduce a collator /// key generator object separate from the collator, this struct /// is now always loaded. /// /// <div class="stab unstable"> /// This code is considered unstable; it may change at any time, in breaking or non-breaking ways, /// including in SemVer minor releases. While the serde representation of data structs is guaranteed /// to be stable, their Rust representation might not be. Use with caution. /// </div> #[deriveexpectMarkerinvariants) #[cfg_attr(feature = "datagen", ) #[cfg_attr(feature = "datagen", databake(pathjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 #[cfg_attr(feature = "serde", derive(serde::Deserialize))] pubstruct CollationSpecialPrimaries<'data> { /// The primaries corresponding to `MaxVariable` /// character classes packed so that each fits in /// 16 bits. Length must match the number of enum /// variants in `MaxVariable`, currently 4. /// /// This is potentially followed by 256 bits /// (packed in 16 u16s) to classify every possible /// byte into compressible or non-compressible. #[cfg_attr(feature = "serde", serde(borrow))] pub last_primaries: ZeroVec<'data, u16>, /// The high 8 bits of the numeric primary pub numeric_primary: u8,
}
#[derive(Debug, PartialEq, Clone, yoke::Yokeable, zerofrom::ZeroFrom)] pub(crate) struct CollationSpecialPrimariesValidated<'data> { /// The primaries corresponding to `MaxVariable` /// character classes packed so that each fits in /// 16 bits. Length must match the number of enum /// variants in `MaxVariable`, currently 4. pub last_primaries: ZeroVec<'data, u16>, /// The high 8 bits of the numeric primary pub numeric_primary: u8, /// 256 bits (packed in 16 u16s) to classify every possible /// byte into compressible or non-compressible. pub compressible_bytes: &'data [<u16 as AsULE>::ULE; 16],
}
impl CollationSpecialPrimariesValidated<'static> { pub(crate) const HARDCODED_COMPRESSIBLE_BYTES_FALLBACK: &'static [<u16 as AsULE>::ULE; 16] = &[
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b1111_1111_1111_1110),
<u16 as AsULE>::ULE::from_unsigned(0b1111_1111_1111_1111),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0001),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0000_0000_0000_0000),
<u16 as AsULE>::ULE::from_unsigned(0b0100_0000_0000_0000),
];
}
impl CollationSpecialPrimariesValidated<'_> { #[expect(clippy::unwrap_used)] pub(crate) fn last_primary_for_group(&self, max_variable: MaxVariable) -> u32 { // `unwrap` is OK, because `Collator::try_new` validates the length. // // Minus one to generate the right lower 16 bits from the high 16 bits. // See parse.cpp in genrb and getLastPrimaryForGroup in ICU4C.
(u32::from(self.last_primaries.get(max_variable as usize).unwrap()) << 16) - 1
}
#[allow(dead_code)] pub(crate) fn is_compressible(&self, b: u8) -> bool { // Indexing slicing OK by construction and pasting this // into Compiler Explorer shows that the panic // is optimized away. #[expect(clippy::indexing_slicing)] let field = u16::from_unaligned(self.compressible_bytes[usize::from(b >> 4)]); let mask = 1 << (b & 0b1111);
(field & mask) != 0
}
}
/// Lists the locale and collation keyword combinations that the collator knows about. /// The `standard` collation is represented as the empty string. /// The root collation is represented as `und`. /// Chinese collations are listed as `und-Hani` with `und-Hant` and `und-Hans` resolving /// to `stroke` and `pinyin` despite not listing the collation keyword. /// /// The iterator may (in practice _will_) yield duplicate items. #[cfg(all(feature = "compiled_data", feature = "unstable"))] pub fn list_locales() -> impl Iterator<Item = (DataLocale, tinystr::TinyAsciiStr<8>)> { use icu_provider::baked::DataStore;
Baked::DATA_COLLATION_METADATA_V1
.iter()
.chain(Baked::DATA_COLLATION_TAILORING_V1.iter())
.chain(Baked::DATA_COLLATION_REORDERING_V1.iter())
.chain(Baked::DATA_COLLATION_DIACRITICS_V1.iter())
.map(|d| {
(
d.locale.clone(),
tinystr::TinyAsciiStr::<8>::try_from_str(d.marker_attributes.as_str())
.expect("Marker attribute invariants upheld"),
)
})
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.12Angebot
¤
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.