mirror of
https://git.alemi.dev/mood.git
synced 2024-11-12 20:09:20 +01:00
feat: allow to print chances but censored
This commit is contained in:
parent
1dc9d8575f
commit
3dc9219ea2
1 changed files with 7 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue