1 # turn output of mkindex into form needed by dict
4 print "Usage: awk -F' ' -f canonind.awk rawindex > index"
9 while ((getline < file) > 0) {
10 for(i = 2; i <= NF; i++) {
17 w1 = substr(w, 1, b-1)
18 w2 = substr(w, b+1, e-b-1)
20 printf "%s%s\t%d\n", w1, w3, $1 > "junk"
21 printf "%s%s%s\t%d\n", w1, w2, w3, $1 > "junk"
23 printf "%s\t%d\n", w, $1 > "junk"
26 system("sort -u -t' ' +0f -1 +0 -1 +1n -2 < junk")