chanoma/characters_set/
punctuations.rs1use crate::corr::{Corr, Correspondence, Item, Linear};
3
4#[derive(Clone)]
6pub struct Punctuations;
7
8impl Corr for Punctuations {
9 fn items(&self) -> Vec<Item> {
10 (Self::EXCLAMATION_MARK
11 + &Self::QUOTATION_MARK
12 + &Self::SHARP
13 + &Self::DOLLER_SIGN
14 + &Self::PERCENT_SIGN
15 + &Self::AMPERSAND
16 + &Self::APOSTROPHE
17 + &Self::LEFT_PARENTHESIS
18 + &Self::RIGHT_PARENTHESIS
19 + &Self::ASTERISK
20 + &Self::PLUS_SIGN
21 + &Self::COMMA
22 + &Self::HYPHEN_MINUS
23 + &Self::FULL_STOP
24 + &Self::SLASH
25 + &Self::COLON
26 + &Self::SEMI_COLON
27 + &Self::LESS_THAN_SIGN
28 + &Self::EQUAL_SIGN
29 + &Self::GREATER_THAN_SIGN
30 + &Self::QUESTION_MARK
31 + &Self::AT_SIGN
32 + &Self::LEFT_SQUARE_BRACKET
33 + &Self::BACKSLASH
34 + &Self::YEN_SIGN
35 + &Self::RIGHT_SQUARE_BRACKET
36 + &Self::CIRCUMFLEX_ACCENT
37 + &Self::LOW_LINE
38 + &Self::GRAVE_ACCENT
39 + &Self::LEFT_CURLY_BRACKET
40 + &Self::VERTICAL_BAR
41 + &Self::RIGHT_CURLY_BRACKET
42 + &Self::TILDE)
43 .items()
44 }
45}
46
47impl Punctuations {
48 pub const EXCLAMATION_MARK: Correspondence<Linear> = Linear::new("!", "!").corr();
50 pub const QUOTATION_MARK: Correspondence<Linear> = Linear::new("”", "\"").corr();
52 pub const SHARP: Correspondence<Linear> = Linear::new("#", "#").corr();
54 pub const DOLLER_SIGN: Correspondence<Linear> = Linear::new("$", "$").corr();
56 pub const PERCENT_SIGN: Correspondence<Linear> = Linear::new("%", "%").corr();
58 pub const AMPERSAND: Correspondence<Linear> = Linear::new("&", "&").corr();
60 pub const APOSTROPHE: Correspondence<Linear> = Linear::new("’", "'").corr();
62 pub const LEFT_PARENTHESIS: Correspondence<Linear> = Linear::new("(", "(").corr();
64 pub const RIGHT_PARENTHESIS: Correspondence<Linear> = Linear::new(")", ")").corr();
66 pub const ASTERISK: Correspondence<Linear> = Linear::new("*", "*").corr();
68 pub const PLUS_SIGN: Correspondence<Linear> = Linear::new("+", "+").corr();
70 pub const COMMA: Correspondence<Linear> = Linear::new(",", ",").corr();
72 pub const HYPHEN_MINUS: Correspondence<Linear> = Linear::new("-", "-").corr();
74 pub const FULL_STOP: Correspondence<Linear> = Linear::new(".", ".").corr();
76 pub const SLASH: Correspondence<Linear> = Linear::new("/", "/").corr();
78
79 pub const COLON: Correspondence<Linear> = Linear::new(":", ":").corr();
81 pub const SEMI_COLON: Correspondence<Linear> = Linear::new(";", ";").corr();
83 pub const LESS_THAN_SIGN: Correspondence<Linear> = Linear::new("<", "<").corr();
85 pub const EQUAL_SIGN: Correspondence<Linear> = Linear::new("=", "=").corr();
87 pub const GREATER_THAN_SIGN: Correspondence<Linear> = Linear::new(">", ">").corr();
89 pub const QUESTION_MARK: Correspondence<Linear> = Linear::new("?", "?").corr();
91 pub const AT_SIGN: Correspondence<Linear> = Linear::new("@", "@").corr();
93
94 pub const LEFT_SQUARE_BRACKET: Correspondence<Linear> = Linear::new("[", "[").corr();
96 pub const BACKSLASH: Correspondence<Linear> = Linear::new("\", "\\").corr();
98 pub const YEN_SIGN: Correspondence<Linear> = Linear::new("¥", "¥").corr();
100 pub const RIGHT_SQUARE_BRACKET: Correspondence<Linear> = Linear::new("]", "]").corr();
102 pub const CIRCUMFLEX_ACCENT: Correspondence<Linear> = Linear::new("^", "^").corr();
104 pub const LOW_LINE: Correspondence<Linear> = Linear::new("_", "_").corr();
106 pub const GRAVE_ACCENT: Correspondence<Linear> = Linear::new("`", "`").corr();
108
109 pub const LEFT_CURLY_BRACKET: Correspondence<Linear> = Linear::new("{", "{").corr();
111 pub const VERTICAL_BAR: Correspondence<Linear> = Linear::new("|", "|").corr();
113 pub const RIGHT_CURLY_BRACKET: Correspondence<Linear> = Linear::new("}", "}").corr();
115 pub const TILDE: Correspondence<Linear> = Linear::new("〜", "~").corr();
117
118 pub const fn new() -> Self {
119 Self {}
120 }
121
122 pub const fn corr(self) -> Correspondence<Self> {
123 Correspondence::new(self)
124 }
125}
126
127pub const PUNCTUATIONS: Correspondence<Punctuations> = Punctuations::new().corr();