# Makefile to build the file word_map.tbl # that maps English words to Vietnamese words. # Last edited on 2026-07-23 10:32:19 by stolfi OUTTBL := word_map.tbl MAKEFILE := word_map.make all: ${OUTTBL} WORKBIN := ${STOLFIHOME}/projects/voynich/work BANKBIN := ${STOLFIHOME}/projects/voynich/work # We obtain the list of English words and symbols from the plaintext # itself, using the same sample-functions that we used for the plaintext # sample (engl/wow). ENGLLANG := engl ENGLBOOK := wow ENGLSMP := ${ENGLLANG}/${ENGLBOOK} ENGLSRC := org/main.wds ENGLAWK := ../../${ENGLSMP}/sample_fns.gawk ENGLTBL := ../../${ENGLSMP}/word_map.tbl ENGLDIC := /tmp/.engl.dic ${ENGLDIC}: ${ENGLSRC} ${MAKEFILE} \ ${WORKBIN}/wds_to_tlw.gawk \ ${ENGLAWK} ${ENGLTBL} cat ${ENGLSRC} \ | ${WORKBIN}/wds_to_tlw.gawk \ -f ${ENGLAWK} \ -v table=${ENGLTBL} \ -v lang="${ENGLLANG}" -v book=${ENGLBOOK} -v sec="tot.1" \ | gawk '($$1 ~ /[as]/) { print $$3; }' \ | sort | uniq -c | expand \ | sort -b -k1,1nr \ | gawk '/./ { print $$2; }' \ > ${ENGLDIC} wc -l ${ENGLDIC} 1>&2 head -n 200 ${ENGLDIC} | ${WORKBIN}/format-words-filled 1>&2 # We obtain the list of Vietnamese words (no symbols) from the # Vietnamese Pentateuch sample (viet/ptt), using the same # sample-functions that we used for that sample, with compounding so # that it has about the same number of distinct words as the English # sample: VIETLANG := viet VIETBOOK := ptt VIETSMP := ${VIETLANG}/${VIETBOOK} VIETSRC := ../../${VIETSMP}/org/main.wds VIETAWK := ../../${VIETSMP}/sample_fns.gawk VIETTBL := ../../${VIETSMP}/word_map.tbl VIETDIC := /tmp/.viet.dic ${VIETDIC}: ${VIETSRC} ${MAKEFILE} \ ${WORKBIN}/wds_to_tlw.gawk \ ${VIETAWK} ${TBL} \ enlarge-lexicon cat ${VIETSRC} \ | ${WORKBIN}/wds_to_tlw.gawk \ -f ${VIETAWK} \ -v table=${VIETTBL} \ -v lang="${VIETLANG}" -v book=${VIETBOOK} -v sec="tot.1" \ | gawk '($$1 == "a") { print $$3; }' \ | enlarge-lexicon -v num=`cat ${ENGLDIC} | wc -l` \ | sort | uniq -c | expand \ | sort -b -k1,1nr \ | gawk '/./ { print $$2; }' \ > ${VIETDIC} wc -l ${VIETDIC} 1>&2 head -n 200 ${VIETDIC} | ${WORKBIN}/format-words-filled 1>&2 # Then we feed the two lists to the script make-word-subst-table ${OUTTBL}: ${ENGLSRC} ${VIETSRC} ${MAKEFILE} \ ${ENGLDIC} \ ${VIETDIC} \ make-word-subst-table.gawk make-word-subst-table.gawk \ -v old=${ENGLDIC} \ -v new=${VIETDIC} \ -v order=2 \ > ${OUTTBL}