#!/bin/sh

if [ -f ../ngram-count-gt/swbd.3bo.gz ]; then
	gz=.gz
else
	gz=
fi

smooth=""

test=../ngram-count-gt/eval97.text

ngram-count \
	-text $test \
	-write-vocab test.vocab

# test reading pre-build binary LM
ngram -debug 0 \
	-lm swbd.2bin \
	-vocab test.vocab \
	-limit-vocab \
	-ppl $test

# create LM from counts
ngram -debug 1 \
	-lm ../ngram-count-gt/swbd.3bo$gz \
	-write-bin-lm swbd.3bin

ngram -debug 0 \
	-lm swbd.3bin \
	-vocab test.vocab \
	-limit-vocab \
	-ppl $test

rm -f test.vocab swbd.3bin

