echo "Making file word_statistics.awk from file " $1

cat $1 | awk 'BEGIN{printf("BEGIN{\n"); }{for(i=1;i<=NF;i++) {printf("z[%d] = \"%s\"\n",++s,$i)}}END{printf("length_z = %d}",s+1)}'  > large_word_array.txt

cat large_word_array.txt | awk '{print $0}END{printf("{for(i=1;i<length_z;i++)if($1==z[i]) {a[i] = $2; s = s+$2; break;}}END{for(i=1;i<length_z;i++){print a[i]/s;}}")}' > word_statistics.awk














