#! /bin/csh -f # Last edited on 2008-02-04 20:49:14 by stolfi set usage = "$0 FNUM VERS SIMILAR COMMENTS CTABLE" # Produces a listing of page FNUM, transcription VERS, # in HTML format, with words color-highlighted according # to the dictionary file CTABLE. # # If SIMILAR = 0 colors only exact matches. # If SIMILAR = 1 assumes [ktfp] [aoy] equivalence when coloring words. # If SIMILAR = 2 also assumes [rsche] equivalence. # # If COMMENTS is 1, includes #-comments; if 0, omits them. set script = "$0"; set script = "${script:t}" set date = "`date +'%Y-%m-%d %H:%M:%S'`" set wdir = ${STOLFIHOME}/projects/voynich/work set vdir = ${STOLFIHOME}/projects/voynich/work/Notes/050 set path = ( ${vdir} ${wdir} /bin /usr/bin ) # Gather command-line options: if ( $#argv != 5 ) then html-error "$script: usage: ${usage}"; exit 0 endif set fnum = "$1"; shift; set version = "$1"; shift; set similar = "$1"; shift; set comments = "$1"; shift; set ctable = "$1"; shift; set vars = ( ) set pfile = "${vdir}/evt-pages/${fnum}" if ( ! ( -r "${pfile}" ) ) then html-error 'Page "'"${fnum}"'" does not exist'; exit 0 endif # Define word equivalence options: if ( ${similar} == 1 ) then set vars = ( ${vars} \ -v showSimilar=1 \ -v erase_ligatures=0 \ -v erase_plumes=0 \ -v ignore_gallows_eyes=1 \ -v join_ei=1 \ -v equate_aoy=1 \ -v collapse_ii=0 \ -v equate_eights=0 \ -v equate_pt=1 \ -v erase_q=1 \ -v erase_word_spaces=1 \ ) else if ( ${similar} == 2 ) then set vars = ( ${vars} \ -v showSimilar=1 \ -v erase_ligatures=1 \ -v erase_plumes=1 \ -v ignore_gallows_eyes=1 \ -v join_ei=1 \ -v equate_aoy=1 \ -v collapse_ii=1 \ -v equate_eights=1 \ -v equate_pt=1 \ -v erase_q=1 \ -v erase_word_spaces=1 \ ) else set vars = ( ${vars} \ -v showSimilar=0 \ ) endif # Add default color options: set vars = ( \ -v bgColor="000000" \ -v textColor="cccccc" \ -v linkColor="00ff99" \ -v vlinkColor="009900" \ -v alinkColor="eeff99" \ -v defaultColor="ff0000" \ -v commentColor="99aabb" \ -v titleColor="ff0000" \ -v indent=2 \ ${vars} \ -v script="${script}" \ ) cat ${vdir}/page-header.html \ | replace-html-vars \ -v fnum="${fnum}" \ -v date="${date}" \ ${vars} # Text echo "
"
cat ${pfile} \
  | colorize-text -f ${vdir}/eva2erg.gawk \
      -v colorTable="${ctable}" \
      -v version="${version}" \
      -v comments="${comments}" \
      -v similar="${similar}" \
      -v fnum="${fnum}" \
      ${vars}
echo "
" cat ${vdir}/page-trailer.html \ | replace-html-vars \ -v fnum="${fnum}" \ -v date="${date}" \ ${vars}