#!/freeware/bin/gnu-tools/gawk -f BEGIN { if(ARGC <= 2) {printf("Use: WLAT2DAV -v only_wlat= \n") | "stderr"; exit(0); } # Read the lexicon fname = ARGV[2]; hlen = 1; while((getline < fname) == 1) # header length {hlen++; if($0 ~ "^#+$") break; } close(fname); # must sort it using plain C-rules (no language specific specials) fname = sprintf("tail +%i %s | env LC_ALL=C sort",hlen,fname); iword = 0; while((fname | getline) == 1) # read data word[iword++] = $1; close(fname); # Read and convert the word graph fname = ARGV[1]; for(iline=1;(getline