feat: allow de-censoring some moods in display

This commit is contained in:
əlemi 2023-12-02 06:15:06 +01:00
parent 5490a28b75
commit 232d47cdc9
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -16,11 +16,18 @@ fn main() {
probabilities.sort_by_key(|x| x.1); probabilities.sort_by_key(|x| x.1);
let mut uncensored = Vec::new();
let censored = std::env::args().nth(1).as_deref().unwrap_or("") == "--censored"; let censored = std::env::args().nth(1).as_deref().unwrap_or("") == "--censored";
if censored {
for arg in std::env::args().skip(2) {
uncensored.push(arg);
}
}
println!("{{"); println!("{{");
for (line, count, chance) in probabilities { for (line, count, chance) in probabilities {
let l = if censored { let l = if censored && !uncensored.iter().any(|x| line.starts_with(x)) {
"".repeat(line.len()) "".repeat(line.len())
} else { } else {
line.replace('"', "\\\"") line.replace('"', "\\\"")