#!/bin/bash
#
# Hey, emacs(1), this is -*- mode: shell; coding: utf-8; -*- got it?
#
unset DISPLAY;
unset LUI;
if [ -z "${LOGONROOT}" ]; then
echo "www: unable to determine \$LOGONROOT directory; exit.";
exit 1;
fi
#
# include a shared set of shell functions and global parameters, including the
# architecture identifier .LOGONOS.
#
. ${LOGONROOT}/etc/library.bash;
date=`date "+%y-%m-%d"`;
source="--source";
setup="logon";
limit=5;
llf="
(This on-line demonstrator is hosted at the
Laboratoire de linguistique formelle (UMR 7110), CNRS & U Paris-Diderot)"
uio="
(This on-line demonstrator is hosted at the
University
of Oslo)"
upf="
(This on-line demonstrator is hosted at
Universtitat
Pompeu Fabra)"
uw="
(This on-line demonstrator is hosted at the
University
of Washington)"
while [ $# -gt 0 -a "${1#-}" != "$1" ]; do
case ${1} in
--binary)
source="";
shift 1;
;;
--source)
source="--source";
shift 1;
;;
--setup)
setup=${2};
shift 2;
;;
--noen|logon)
setup=logon;
shift 1;
dislaimer="${uio}";
;;
--erg)
setup=erg;
shift 1;
dislaimer="${uio}";
;;
--terg)
setup=terg;
shift 1;
dislaimer="${uio}";
;;
--gg)
setup=gg;
shift 1;
dislaimer="${llf}";
;;
--deen)
setup=deen;
shift 1;
dislaimer="${llf}";
;;
--ende)
setup=ende;
shift 1;
dislaimer="${llf}";
;;
--jaen)
setup=jaen;
shift 1;
;;
--jaen+chasen)
setup=jaen+chasen;
shift 1;
;;
--jacy)
setup=jacy;
shift 1;
dislaimer="${uw}";
;;
--srg)
setup=srg;
shift 1;
dislaimer="${upf}";
;;
--cst)
setup=cst;
shift 1;
;;
--krg)
setup=krg;
shift 1;
;;
--hag)
setup=hag;
shift 1;
dislaimer="${llf}";
;;
--limit)
limit=${2};
shift 2;
;;
--port)
port=${2};
shift 2;
;;
--reset)
reset;
shift 1;
;;
--cat)
cat="--cat";
shift 1;
;;
-d|--debug)
debug=true;
shift 1;
;;
esac
done
if [ -z "${port}" ]; then
case ${setup} in
logon|noen) port=8012; ;;
jaen|jaen+chasen) port=8050; ;;
enja) port=8051; ;;
deen) port=8052; ;;
ende) port=8053; ;;
erg) port=8100; ;;
gg) port=8101; ;;
jacy) port=8102; ;;
srg) port=8103; ;;
cst) port=8104; ;;
hag) port=8105; ;;
krg) port=8106; ;;
terg) port=8200; ;;
*) port=8888; ;;
esac
fi
LOG=${LOGONROOT}/www.${date}.${USER}.${port}.log
{
options=":error :exit :wait 1200";
echo "(setf (system:getenv \"DISPLAY\") nil)";
loadup;
#
# set [incr tsdb()] options as needed for this particular task
#
echo "(setf tsdb::*process-suppress-duplicates* nil)";
echo "(setf tsdb::*process-raw-print-trace-p* t)";
if [ "${limit}" != "nil" -a "${limit}" != "0" ]; then
echo "(setf tsdb::*www-maximal-number-of-results* ${limit})";
fi;
if [ -n "${dislaimer}" ]; then
echo "(setf tsdb::*www-disclaimer* \"${dislaimer}\")";
fi
case ${setup} in
logon|noen)
echo "(tsdb:tsdb :cpu :norgram :task :parse :file t
:count 1 ${options})";
echo "(tsdb:tsdb :cpu :noen :task :transfer :file t
:reset nil :count 1 ${options})";
echo "(tsdb:tsdb :cpu :erg :task :generate
:file t :reset nil :count 1 ${options})";
echo "(lkb::read-script-file-aux \"${LOGONROOT}/lingo/erg/lkb/script\")";
echo "(tsdb:tsdb :cpu :norgram :task :parse :file t
:reset nil :count 2 ${options})";
echo "(tsdb:tsdb :cpu :noen :task :transfer :file t
:reset nil :count 2 ${options})";
echo "(tsdb:tsdb :cpu :erg :task :generate
:file t :reset nil :count 2 ${options})";
echo "(mt::read-smt)";
echo "(setf tsdb::*www-title* :noen)";
echo "(setf tsdb::*www-custom-js* \"noen\")";
echo "(setf tsdb::*www-introduction* \"noen\")";
echo "(setf tsdb::*www-comparisons*
'((:smt \"http://www.isi.edu/publications/licensed-sw/pharaoh/\")
(:google \"http://www.google.com/translate_t?sl=no&tl=en\")
(:visl \"http://www.gramtrans.com/?pair=nor2eng\")
(:it \"http://www.tranexp.com:2000/Translate/result.shtml\")))";
echo "(setf tsdb::*www-sample*
\"Bergensområdet er tett befolket fremdeles.\")";
echo "(setf tsdb::*www-urls*
'((:parse \"http://www.ling.uib.no/~victoria/NorGram/\")
(:generate \"http://www.delph-in.net/erg\")))";
;;
jaen)
echo "(tsdb:tsdb :cpu :jacy+chasen :task :parse :file t
:count 1 ${options})";
echo "(tsdb:tsdb :cpu :jaen :task :transfer :file t
:reset nil :count 1 ${options})";
echo "(tsdb:tsdb :cpu :erg :task :generate
:file t :reset nil :count 1 ${options})";
echo "(lkb::read-script-file-aux \"${LOGONROOT}/lingo/erg/lkb/script\")";
echo "(setf tsdb::*www-title* :jaen)";
echo "(setf tsdb::*www-custom-js* \"jacy\")";
echo "(setf tsdb::*www-introduction* \"jaen\")";
echo "(setf tsdb::*www-comparisons* nil)";
echo "(setf tsdb::*www-sample*
\"日本語が面白いぞ.\")";
echo "(setf tsdb::*www-urls*
'((:parse \"http://www.delph-in.net/jacy\")
(:generate \"http://www.delph-in.net/erg\")))";
;;
deen)
echo "(tsdb:tsdb :cpu :gg@pet :task :parse :file t
:count 1 ${options})";
echo "(tsdb:tsdb :cpu :deen :task :transfer :file t
:reset nil :count 1 ${options})";
echo "(tsdb:tsdb :cpu :erg :task :generate
:file t :reset nil :count 1 ${options})";
echo "(lkb::read-script-file-aux \"${LOGONROOT}/dfki/gg/lkb/script\")";
echo "(setf tsdb::*www-title* :deen)";
echo "(setf tsdb::*www-custom-js* \"gg\")";
echo "(setf tsdb::*www-introduction* \"deen\")";
echo "(setf tsdb::*www-comparisons* nil)";
echo "(setf tsdb::*www-sample*
\"Karl lacht.\")";
echo "(setf tsdb::*www-urls*
'((:parse \"http://www.delph-in.net/gg\")
(:generate \"http://www.delph-in.net/erg\")))";
;;
ende)
echo "(tsdb:tsdb :cpu :erg :task :parse :file t
:count 1 ${options})";
echo "(tsdb:tsdb :cpu :enfr :task :transfer :file t
:reset nil :count 1 ${options})";
echo "(tsdb:tsdb :cpu :gg :task :generate
:file t :reset nil :count 1 ${options})";
echo "(lkb::read-script-file-aux \"${LOGONROOT}/lingo/erg/lkb/script\")";
echo "(setf tsdb::*www-title* :ende)";
echo "(setf tsdb::*www-custom-js* \"ende\")";
echo "(setf tsdb::*www-introduction* \"ende\")";
echo "(setf tsdb::*www-comparisons* nil)";
echo "(setf tsdb::*www-sample*
\"Abrams hired Browne.\")";
echo "(setf tsdb::*www-urls*
'((:parse \"http://www.delph-in.net/erg\")
(:generate \"http://www.delph-in.net/gg\")))";
;;
erg|terg)
echo "(lkb::read-script-file-aux
\"${LOGONROOT}/lingo/${setup}/lkb/script\")";
echo "(setf tsdb::*sdp-semi* (mt:construct-semi :ids t :rules t))";
echo "(setf tsdb::*www-brat-base* \"/brat/\")";
case ${setup} in
erg)
echo "(tsdb:tsdb :cpu :cheap :task :parse :file t
:count 4 ${options})";
echo "(tsdb:tsdb :cpu :erg+tnt :task :parse :reset nil
:count 8 ${options})";
echo "(tsdb:tsdb :cpu :erg/ace :task :generate :reset nil
:count 4 ${options})";
;;
terg)
echo "(tsdb:tsdb :cpu :terg :task :parse :file t
:count 2 ${options})";
echo "(tsdb:tsdb :cpu :terg+tnt :task :parse :reset nil
:count 4 ${options})";
echo "(tsdb:tsdb :cpu :terg/ace :task :generate :reset nil
:count 4 ${options})";
;;
esac
;;
gg)
echo "(lkb::read-script-file-aux \"${LOGONROOT}/dfki/gg/lkb/script\")";
echo "(tsdb:tsdb :cpu :gg@pet :task :parse :file t
:count 2 ${options})";
echo "(tsdb:tsdb :cpu :gg :task :generate :reset nil
:count 1 ${options})";
echo "(setf tsdb::*www-title* :gg)";
echo "(setf tsdb::*www-custom-js* \"gg\")";
echo "(setf tsdb::*www-introduction* \"gg\")";
echo "(setf tsdb::*www-comparisons* nil)";
echo "(setf tsdb::*www-sample*
\"Karl lacht.\")";
echo "(setf tsdb::*www-urls*
'((:parse \"http://www.delph-in.net/gg\")
(:generate \"http://www.delph-in.net/gg\")))";
;;
jacy)
echo "(lkb::read-script-file-aux
\"${LOGONROOT}/dfki/jacy/lkb/script.chasen\")";
echo "(tsdb:tsdb :cpu :jacy+chasen :task :parse :file t
:count 1 ${options})";
echo "(tsdb:tsdb :cpu :jacy :task :generate :reset nil
:count 1 ${options})";
echo "(setf tsdb::*www-title* :jacy)";
echo "(setf tsdb::*www-custom-js* \"jacy\")";
echo "(setf tsdb::*www-introduction* \"jacy\")";
echo "(setf tsdb::*www-comparisons* nil)";
echo "(setf tsdb::*www-sample*
\"日本語が面白いぞ.\")";
echo "(setf tsdb::*www-urls*
'((:parse \"http://www.delph-in.net/jacy\")
(:generate \"http://www.delph-in.net/jacy\")))";
;;
srg)
echo "(lkb::read-script-file-aux \"${LOGONROOT}/upf/srg/lkb/script\")";
echo "(tsdb:tsdb :cpu :srg :task :parse :file t
:count 4 ${options})";
echo "(setf tsdb::*www-title* :srg)";
echo "(setf tsdb::*www-custom-js* \"srg\")";
echo "(setf tsdb::*www-introduction* \"srg\")";
echo "(setf tsdb::*www-comparisons* nil)";
echo "(setf tsdb::*www-sample*
\"El muchacho sucedió a la muchacha en el trono.\")";
echo "(setf tsdb::*www-urls*
'((:parse \"http://www.delph-in.net/srg\")
(:generate \"http://www.delph-in.net/srg\")))";
;;
cst)
echo "(lkb::read-script-file-aux \"${LOGONROOT}/cst/danish/lkb/script\")";
echo "(tsdb:tsdb :cpu :cst :task :parse :file t
:count 4 ${options})";
echo "(setf tsdb::*www-title* :cst)";
echo "(setf tsdb::*www-custom-js* \"cst\")";
echo "(setf tsdb::*www-introduction* \"cst\")";
echo "(setf tsdb::*www-comparisons* nil)";
echo "(setf tsdb::*www-sample*
\"kvinden underviser i filmhistorie\")";
echo "(setf tsdb::*www-urls* nil)";
;;
hag)
echo "(setf tsdb::*www-custom-js* \"hag\")"
echo "(lkb::read-script-file-aux
\"${LOGONROOT}/llf/hag/lkb/script\")";
echo "(tsdb:tsdb :cpu :hag@pet :task :parse :file t
:count 1 ${options})";
echo "(tsdb:tsdb :cpu :hag@ace :task :generate :reset nil
:count 1 ${options})";
;;
krg)
echo "(lkb::read-script-file-aux
\"${LOGONROOT}/khu/krg/lkb/script\")";
echo "(tsdb:tsdb :cpu :krg@pet :task :parse :file t
:count 2 ${options})";
echo "(tsdb:tsdb :cpu :krg :task :generate :reset nil
:count 1 ${options})";
echo "(tsdb:tsdb :cpu :krg :task :generate :reset nil
:count 1 ${options})";
;;
*)
echo "www: configuration \`${setup}' not supported yet; exit.";
exit 1;
;;
esac
echo "(tsdb::www-initialize :port ${port})";
cat -;
} | ${LOGONROOT}/bin/logon ${source} ${cat} \
-I base -locale no_NO.UTF-8 -qq 2>&1 | tee -a ${LOG}