-
Notifications
You must be signed in to change notification settings - Fork 263
Expand file tree
/
Copy pathradical.rs
More file actions
32 lines (27 loc) · 1.1 KB
/
radical.rs
File metadata and controls
32 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
//! Data provider struct definitions for radicals.
use icu_collections::codepointtrie::CodePointTrie;
use icu_provider::prelude::*;
/// Data for Unihan IRG sources (Radicals).
#[derive(Debug, PartialEq, Clone, yoke::Yokeable, zerofrom::ZeroFrom)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
#[cfg_attr(feature = "datagen", databake(path = icu_segmenter::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct UnihanIrgData<'data> {
/// Trie mapping code points to their IRG source radical ID (u8).
#[cfg_attr(feature = "serde", serde(borrow))]
pub trie: CodePointTrie<'data, u8>,
}
icu_provider::data_struct!(
UnihanIrgData<'_>,
#[cfg(feature = "datagen")]
);
icu_provider::data_marker!(
/// `SegmenterUnihanRadicalV1`
SegmenterUnihanRadicalV1,
"segmenter/unihan/radical/v1",
UnihanIrgData<'static>,
is_singleton = true
);