#!/bin/sh

lmdir=../../../../lm/test/tests/class-ngram

if [ -f $lmdir/spine2000+2001-gridlabel+spell.4bo.gz ]; then
	gz=.gz
else
	gz=
fi


lm="$lmdir/spine2000+2001-gridlabel+spell.4bo$gz \
	-classes $lmdir/newlabels+spell.classes \
	-simple-classes \
	-multiwords "

#lm2=../../../../lm/test/tests/ngram-count-gt/swbd.3bo$gz
lm2=$lmdir/spine2000+2001-gridlabel+spell.4bo$gz

mkdir -p tmp

ls ../lattice-expansion/g07a01_unpr_A_* | head -1 > lattice-list

lattice-tool -debug 1 \
                -in-lattice-list lattice-list \
		-compact-expansion \
                -out-lattice-dir tmp \
                -overwrite \
                -reduce-iterate 2 \
		-lm $lm -order 3 \
		-mix-lm $lm2 -loglinear-mix -lambda 0.5

gunzip -f -c tmp/g07a01_unpr_A_0015080_0015309

#mkdir -p nbest
#lattice-tool -in-lattice tmp/g07a01_unpr_A_0015080_0015309.gz  -nbest-decode 20 -out-nbest-dir nbest

rm -rf tmp lattice-list

