#! /usr/bin/gawk -f # Last edited on 1999-07-28 02:03:01 by stolfi BEGIN { split("", fst); nfst = 0; split("", cfst); split("", sec); nsec = 0; split("", csec); } /./{ if (NF != 2) { printf "bad NF\n" > "/dev/stderr"; exit 1; } ct = $1; wd = $2; wd = (wd " "); m = length(wd); state = 0; for (i=1;i<=m;i++) { s = substr(wd,i,1); if (state == 0) { for (j=0;j= 60) || (nw >= 10000)) { printf "\n"; linlen = 0; } else { printf " "; linlen++; } state = 0; } else { printf "%s", s; linlen++; state = 1; } } } } function printprobs(tit, clet, nlet, s) { printf "# Probabilities of %s letters\n", tit; for (s in clet) { printf "# %7d %7.5f %s\n", clet[s], clet[s]/nlet, s; } printf "# %7d %7.5f %s\n", nlet, 1.0, "TOTAL"; printf "#\n"; }