#!/bin/sh # this is a script for processing a form that calls the context matcher # the data from the form is taken from stdin PATH=.:/usr/ucb:/opt/jdk1.2.1/bin:/home/pjbrown/bin:/usr/java/bin:/usr/bin:/usr/local/bin:/bin:/usr/X11R6/bin:/usr/local/jdk/bin:/usr/X11R6/bin:/usr/local/jdk/bin:$PATH export PATH echo "Content-type: text/html" echo # redirect stderr to stdout exec 2>&1 RAW_FORM=`cat` echo "" FORM=`echo $RAW_FORM | sed ' #CMP_THRESHOLD is assumed to be the last parameter (at the end of the form) s/CMP_THRESHOLD=.*$// s/%2c/,/g s/%2C/,/g s/+/ /g s/%2b/+/g s/%2B/+/g s/%22/"/g s/\\&/\ /g s/CM_/ /g #s/X=// #s/Y=/ / #s/THRESHOLD=/ / '` echo ' Research issues in context-aware retrieval: evaluation experiment on straying ' echo "" # this sets $CMP_THRESHOLD eval "$RAW_FORM" #echo "
Environment is:";set;echo "
" # extract the active tags from the form: assume any tag set is active ACTIVE=`echo $RAW_FORM | sed ' s/%2c/,/g s/%2C/,/g s/%22/"/g s/=["A-Za-z0-9 ,\\.+-]*\\&CM/,CM/g s/, *CMP.*$// s/CM_//g '` echo "" # special set up because HOSTTYPE is not set on apache at exeter if test x"$SERVER_NAME" = x"www.dcs.ex.ac.uk"; then HOSTTYPE=sun4; export HOSTTYPE fi #echo $HOSTTYPE is HOSTTYPE and :$SERVER_NAME: is SERVER_NAME # call the normal matcher cd /home/pjbrown/w/CAR_share_copy/Xamples # after output, sort into score order and take top 10 # (there is a problem with head: it closes its input when it has had its fill, thus upsetting processes such as ml1 that are earlier in the pipe) OFILE=../tmp/t#sort_out$$ rm -f $OFILE # we use an intermediate OFILE here, because piping into head gives "broken Pipe" ./run_sw -s $SW_EXTRA_PARAM "$FORM" "$CMP_THRESHOLD" "$ACTIVE" 2>&1 > $OFILE head -38 $OFILE echo "" rm -f $OFILE