Skip to content

Commit

Permalink
Clear error message if language model is not found.
Browse files Browse the repository at this point in the history
  • Loading branch information
senarvi committed Aug 5, 2014
1 parent c4858a3 commit dd7bd68
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pyrectool/recognize-batch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,18 @@ fi
if [ "$FSA" != "" ]
then
PARAMS="$PARAMS --fsa"
if [ -e "$LM.fsabin" ]
then
PARAMS="$PARAMS --bin-lm $LM.fsabin"
fi
BIN_LM_PATH="$LM.fsabin"
DECODER_OPT=$DECODER_OPT-fsa
else
if [ -e "$LM.bin" ]
then
PARAMS="$PARAMS --bin-lm $LM.bin"
fi
BIN_LM_PATH="$LM.bin"
fi
if [ -e "$BIN_LM_PATH" ]
then
PARAMS="$PARAMS --bin-lm $BIN_LM_PATH"
elif [ ! -e "$LM" ]
then
echo "Neither binary LM ($BIN_LM_PATH) nor ARPA LM ($LM) was found." >&2
exit 2
fi

# ARPA LM may be needed in any case for rescoring lattices.
Expand Down

0 comments on commit dd7bd68

Please sign in to comment.