blob: a97960d735b76953c12b25c415d793b470bcc234 [file] [log] [blame]
#!/bin/bash
#
# Joshua decoder invocation script.
#
# This script takes care of passing arguments to Java and to the
# Joshua decoder. Usage:
#
# ./decoder [-m memory] [Joshua arguments]
#
# The default amount of memory is 4gb.
NUM_ARGS=0
E_OPTERROR=1
## memory usage; default is 4 GB
mem=4g
if [[ $1 == "-m" ]]; then
mem=$2
shift
shift
fi
set -u
exec java -Xmx${mem} \
-cp $JOSHUA/class:$JOSHUA/thrax/bin/thrax.jar:$JOSHUA/lib/berkeleylm.jar \
-Dfile.encoding=utf8 \
-Djava.util.logging.config.file=${JOSHUA}/logging.properties \
-Djava.library.path=$JOSHUA/lib \
joshua.decoder.JoshuaDecoder "$@"