1pub fn canonical_token(token: &str) -> String {
3 token.to_string()
4}
5
6#[derive(Clone, Debug)]
8pub struct Lexicon;
9
10#[derive(Clone, Debug, Default)]
11pub struct LexiconRegistry;
12
13impl LexiconRegistry {
14 pub fn global() -> &'static Self {
15 static REG: once_cell_stub::OnceCell<LexiconRegistry> = once_cell_stub::OnceCell::new();
16 REG.get_or_init(|| LexiconRegistry)
17 }
18 pub fn translate(&self, text: &str, _from: &str, _to: &str) -> String {
19 text.to_string()
20 }
21}
22
23mod once_cell_stub {
25 use std::sync::OnceLock;
26 pub struct OnceCell<T>(OnceLock<T>);
27 impl<T> OnceCell<T> {
28 pub const fn new() -> Self {
29 Self(OnceLock::new())
30 }
31 pub fn get_or_init(&'static self, f: impl FnOnce() -> T) -> &'static T {
32 self.0.get_or_init(f)
33 }
34 }
35}
36
37#[derive(Clone, Debug)]
38pub struct CanonicalToken(pub String);
39