diff --git a/src/counter.rs b/src/counter.rs index b676423..6e12cd0 100644 --- a/src/counter.rs +++ b/src/counter.rs @@ -16,8 +16,15 @@ fn main() { probabilities.sort_by_key(|x| x.1); + let censored = std::env::args().nth(1).as_deref().unwrap_or("") == "--censored"; + println!("{{"); for (line, count, chance) in probabilities { + let l = if censored { + "■".repeat(line.len()) + } else { + line.replace('"', "\\\"") + }; println!(" \"{}\": [{}, {:.4}],", l, count, chance*100.); } println!(" \"count\": {},", lines.len());