view stuff/wordfreq @ 61:0f2510fa7d98 default tip

Some more minor cleanups in the text. Already done on 2014-11-05 and thus part of the PB publication.
author markus schnalke <meillo@marmaro.de>
date Fri, 21 Nov 2014 08:50:55 +0100
parents eb0815f21f04
children
line wrap: on
line source

#!/bin/sh
#
# print word frequency

deroff "$@" |
        tr -c 'A-Za-zÄÖÜäöüß-' '\n' | tr A-ZÄÖÜ a-zäöü |
	sed '/^ *$/d'| sort |uniq -c | awk '
{sum+=$1; a[$2]=$1;}
END {for (x in a) {printf("%s\t%.2f\t%4d\n", x, a[x]/sum, a[x])} }
'| sort -nr -k 3