#! /bin/csh -f 
# Last edited on 2002-01-16 03:29:56 by stolfi

set wkbin = /home/staff/stolfi/voynich/work

ls -l source/main.wds > /dev/null

cat source/main.wds \
  | egrep '^[a-zA-Z'"'"']+$' \
  | tr 'A-Z' 'a-z' \
  | ${wkbin}/roman-code-words \
      -f ${wkbin}/roman-encoding.gawk \
      -f ${wkbin}/roman-encoding-pseudo-voynich-1.gawk \
  | sed \
      -e '/^# BEGIN DICTIONARY/,/^# END DICTIONARY/\!d' \
      -e '/DICTIONARY/d' \
      -e 's/^#[ ]*//' \
      -e '/[*]DELETE[*]/\!s/[ ][ ]*/ @/' \
  > /tmp/$$
  
# Create map for lowercase, initial-caps, and all-uppercase
# versions of every word:

cat /tmp/$$

cat /tmp/$$ \
  | gawk \
      ' ($1 ~ /^[a-z]/){ w = $1; $1 = (toupper(substr(w,1,1)) substr(w,2)); } \
        ($1 ~ /^['"'"']/){ w = $1; $1 = (substr(w,1,1) toupper(substr(w,2,1)) substr(w,3)); } \
        //{ print; } \
      '
cat /tmp/$$ \
  | gawk '($1 ~ /[a-z].*[a-z]/){ $1 = toupper($1); print; } '
