1use rand::seq::IndexedRandom;
2
3pub const PREFIXES: [&'static str; 10] = [
5 "<3 ",
6 "0w0 ",
7 "H-hewwo?? ",
8 "HIIII! ",
9 "Haiiii! ",
10 "Huohhhh. ",
11 "OWO ",
12 "OwO ",
13 "UwU ",
14 "uwu ",
15];
16
17pub const SUFFIXES: [&str; 31] = [
19 " :3",
20 " (●´ω`●)",
21 " UwU",
22 " (✿ ♡‿♡)",
23 " ÙωÙ",
24 " ʕʘ‿ʘʔ",
25 " ʕ•̫͡•ʔ",
26 " >_>",
27 " ^_^",
28 "..",
29 " Huoh.",
30 " ^-^",
31 " ;_;",
32 " ;-;",
33 " xD",
34 " x3",
35 " :D",
36 " :P",
37 " ;3",
38 " XDDD",
39 ", fwendo",
40 " ㅇㅅㅇ",
41 " (人◕ω◕)",
42 "(^v^)",
43 " x3",
44 " ._.",
45 " ( \"◟ \")",
46 " (• o •)",
47 " (;ω;)",
48 " (◠‿◠✿)",
49 " >_<",
50];
51
52pub const SUBSTITUTIONS: [(&str, &str); 10] = [
54 ("r", "w"),
55 ("l", "w"),
56 ("R", "W"),
57 ("L", "W"),
58 ("no", "nu"),
60 ("has", "haz"),
61 ("have", "haz"),
62 ("you", "uu"),
63 ("the ", "da "),
64 ("The ", "Da "),
65];
66
67pub fn add_affixes(msg: String) -> String {
76 let prefix = PREFIXES.choose(&mut rand::rng()).unwrap_or(&"Huohhhh. ");
77 let suffix = SUFFIXES.choose(&mut rand::rng()).unwrap_or(&" UwU");
78
79 format!("{prefix}{msg}{suffix}")
80}
81
82pub fn substitute(msg: &mut String) -> &String {
94 for substiution in SUBSTITUTIONS.iter() {
95 *msg = msg.replace(substiution.0, substiution.1);
96 }
97
98 msg
99}
100
101pub fn owo(msg: String) -> String {
111 let mut new_msg = add_affixes(msg);
112 substitute(&mut new_msg).to_owned()
113}