#!/bin/sh

if [ -f swbd.3grams.gz ]; then
	gz=.gz
else
	gz=
fi

smooth=""

if [ -f swbd.3bo$gz ]; then
	mv swbd.3bo$gz swbd.3bo$gz.SAVED
fi

# create LM from counts
ngram-count -debug 1 \
	$smooth \
	-read swbd.3grams$gz \
	-vocab eval2001.vocab \
	-lm swbd.3bo$gz

ngram -debug 0 \
	-lm swbd.3bo$gz \
	-ppl eval97.text

if [ -f swbd.3bo$gz.SAVED ]; then
	mv swbd.3bo$gz.SAVED swbd.3bo$gz
fi

