#!/bin/csh -f  
#
#  Run translator on an Esperanto sentence 
# 
#  format: run file-containing-sentence 
#
# this script does not show lisp session.  for debugging, use 'translate'

# -- !! do not modify the following line by hand.  Makefile takes care of this
set LISP_BIN=lisp


set SRC=../src
set ESP=../esp

# -- log file for monitoring.  use 'tail -20f' to monitor
set TMP=/usr/tmp/fred.run

set STR="---fred---"


echo " "
echo '-- runing Esperanto-Esperanto on sentence <' `cat $argv[1]` '>'
echo " "

echo '-- result: '
set S1=`cat $argv[1] | tee $TMP | $SRC/lispify | tee -a $TMP `

set S2=' (in-package :user) (setq *esp-sentence* '"'"'('"$S1"')) '
# echo "$S2"

echo "$S2" | cat - $ESP/run | ( cd $ESP ; $LISP_BIN ) | /bin/grep -e $STR | sed "s/$STR//" | tee -a $TMP | $SRC/glue | tee -a $TMP   

echo " "
