mazer_atog/
lib.rs

1use std::collections::HashMap;
2use std::sync::LazyLock;
3use std::collections::hash_map::IntoIter;
4
5static LETTERS: LazyLock<HashMap<&'static str, &'static str>> = LazyLock::new(|| HashMap::from([
6        // greek symbols
7        ("alpha", "α"),
8        ("Alpha", "Α"),
9        ("beta", "β"),
10        ("Beta", "Β"),
11        ("gamma", "γ"),
12        ("Gamma", "Γ"),
13        ("delta", "δ"),
14        ("Delta", "Δ"),
15        ("epsilon", "ε"),
16        ("Epsilon", "Ε"),
17        ("zeta", "ζ"),
18        ("Zeta", "Ζ"),
19        ("eta", "η"),
20        ("Eta", "Η"),
21        ("theta", "θ"),
22        ("Theta", "Θ"),
23        ("iota", "ι"),
24        ("Iota", "Ι"),
25        ("kappa", "κ"),
26        ("Kappa", "Κ"),
27        ("lambda", "λ"),
28        ("Lambda", "Λ"),
29        ("mu", "μ"),
30        ("Mu", "Μ"),
31        ("nu", "ν"),
32        ("Nu", "Ν"),
33        ("xi", "ξ"),
34        ("Xi", "Ξ"),
35        ("omicron", "ο"),
36        ("Omicron", "Ο"),
37        ("pi", "π"),
38        ("Pi", "Π"),
39        ("rho", "ρ"),
40        ("Rho", "Ρ"),
41        ("sigma", "σ"),
42        ("Sigma", "Σ"),
43        ("tau", "τ"),
44        ("Tau", "Τ"),
45        ("upsilon", "υ"),
46        ("Upsilon", "Υ"),
47        ("phi", "φ"),
48        ("Phi", "Φ"),
49        ("chi", "χ"),
50        ("Chi", "Χ"),
51        ("psi", "ψ"),
52        ("Psi", "Ψ"),
53        ("omega", "ω"),
54        ("Omega", "Ω"),
55        // more math symbols
56        ("infinity", "∞"),
57        ("partial", "∂"),
58        ("nabla", "∇"),
59        ("therefore", "∴"),
60        ("angle", "∠"),
61        ("degree", "°"),
62        ("plusminus", "±"),
63        ("times", "×"),
64        ("divide", "÷"),
65        ("approx", "≈"),
66        ("neq", "≠"),
67        ("leq", "≤"),
68        ("geq", "≥"),
69        ("equiv", "≡"),
70        ("subset", "⊂"),
71        ("supset", "⊃"),
72        ("in", "∈"),
73        ("notin", "∉"),
74        ("union", "∪"),
75        ("intersection", "∩"),
76        ("forall", "∀"),
77        ("exists", "∃"),
78        ("emptyset", "∅"),
79        ("arrowup", "↑"),
80        ("arrowdown", "↓"),
81        ("arrowleft", "←"),
82        ("arrowright", "→"),
83        ("arrow", "→"),
84        ("ellipsis", "…"),
85    ]));
86
87pub struct Atog;
88
89impl Atog {
90    pub fn get(s: &str) -> Option<&str> {
91        LETTERS.get(s).copied()
92    }
93}
94
95impl IntoIterator for Atog {
96    type Item = (&'static str, &'static str);
97    type IntoIter = IntoIter<&'static str, &'static str>;
98
99    fn into_iter(self) -> Self::IntoIter {
100        LETTERS.clone().into_iter()
101    }
102}