From 2f095f9b2a1e575ffb7ca82ae2ef3a59bd90ffe2 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 7 Jan 2012 21:18:01 +0100 Subject: [PATCH] pattern_bayes_gen.sh: Sort patterns by occurence count by default --- tools/pattern_bayes_gen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pattern_bayes_gen.sh b/tools/pattern_bayes_gen.sh index 1c20185..9872b3b 100755 --- a/tools/pattern_bayes_gen.sh +++ b/tools/pattern_bayes_gen.sh @@ -21,7 +21,7 @@ for (keys %counts) { $p{$_} = $choices{$_} / $counts{$_}; } - for (sort { $p{$b} <=> $p{$a} } keys %p) { + for (sort { $counts{$b} <=> $counts{$a} } keys %p) { printf("%.3f %d %d %s\n", $p{$_}, $choices{$_}, $counts{$_}, $_); } }' -- 2.11.4.GIT