#!/bin/sh
#
# Usage: speech [ <filename> ]
#
# Runs the speech-enabled guide
#
dir=`dirname $0`/..
java -mx512m -cp "$dir/class:$dir/lib/jing.jar:$dir/lib/js-engine5.jar:$dir/speech/jsapi.jar:$dir/speech/sphinx4.jar:$dir/speech/tags.jar:$dir/speech/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar:$dir/speech/freetts.jar:$dir/speech/cmu_us_kal.jar:$dir/speech/cmulex.jar" edu.wpi.cetask.guide.SpeechGuide $1
if [ "$1" ]; then
  good=$1.guide
  if [ -f $good ]; then 
    # ignore comments and blank  lines (Unix and Windows)
    diff -qBI "^.$\|\#" /tmp/`basename $1`.guide $good
    diff=$?
    if [ $diff == 0 ]; then echo Succeed `basename $1`; fi;
    exit $diff
  fi;
fi
