tsclite.sh 16.6 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511
#!/bin/sh

base_dir=base
OUT=out
exe_dir=..
exe_name=sclite
clean=TRUE
DATA=.
SCLFLAGS="  "

###
### File: tsclite.sh
### Usage: tsclite.sh [ -en exe_name | -nc | -clean ]
###
###
for i in $*
do
	case $i in
        	-nc) clean="FALSE";;
                -en) exe_name=$2;;
		-clean) echo "Cleaning out tsclite.sh's directory"
			rm -rf $OUT Failed.log ; exit;;
		-purify_status)
			echo "Checking Purify Output"
			echo "    " `ls *.pure|wc -l` "Purify files"
			grep '^[A-Z][A-Z][A-Z]:' *pure | egrep -v 'FIU.*(stdin|stdout|stderr|reserved for Purif)' > /tmp/tsc.log
			for t in `awk -F: '{print $2}' /tmp/tsc.log | sort -u` ; do
				echo "   Type: $t  Count:" `grep $t /tmp/tsc.log|wc -l` " Tests:" `grep $t /tmp/tsc.log|awk -F. '{print $1}' | sort -u`
			done
			exit;;
                *) break;;
        esac
	shift;
done

echo "tsclite.sh -- Version 1.2"
echo "Variables:"
echo "    reference directory  =" $base_dir
echo "    executable directory =" $exe_dir
echo "    sclite executable    =" $exe_name
if test "`grep DIFF_EXE ../makefile`" = "" ; then
	DIFF_ENABLED=0
	echo "    Diff Alignments Disabled"
else
	DIFF_ENABLED=1
	echo "    Diff Alignments Enabled"
fi
if test "`grep "SLM_TARGETS =" ../makefile| sed 's/.*= *//'`" = "" ; then
	SLM_ENABLED=0
	echo "    SLM-Toolkit Disabled"
else
	SLM_ENABLED=1
	echo "    SLM-Toolkit Enabled"
fi
echo ""

if [ -d $OUT ] ; then
	echo "Shall I delete the output directory \"$OUT\"'s contents [y]"
	read ans
	if [ "$ans" = "n" -o "$ans" = "N" ] ; then
		echo "    OK, leaving files inplace"
	else
		echo "    Erasing the output directory"
		rm -rf $OUT
		mkdir $OUT
	fi
	echo ""
else
	mkdir $OUT
fi


scliteCom="$exe_dir/${exe_name}"
#scliteCom="valgrind --dsymutil=yes --tool=exp-sgcheck --tool=memcheck $exe_dir/${exe_name}"

doit(){
   testid="$1"
   desc="$2"  
   com="$3"
   pipeInput="$4";
   prereq="$5"

   echo "$testid: $desc"
   if [ "$prereq" = "SLM" ] ; then
        if test $SLM_ENABLED = 1 ; then
            $exe_dir/${exe_name} $com 1> $OUT/$testid.out 2> $OUT/$testid.err
        else
            echo "            **** SLM weighted alignment is disabled, not testing ***"
        fi   
   elif [ "$prereq" = "DIFF" ] ; then
        if test $DIFF_ENABLED = 1 ; then
            $exe_dir/${exe_name} $com 1> $OUT/$testid.out 2> $OUT/$testid.err
        else
            echo "            **** Diff alignments have been disabled, not testing ***"
        fi   
   elif [ "$pipeInput" = "" ] ; then
        $exe_dir/${exe_name} $com 1> $OUT/$testid.out 2> $OUT/$testid.err
   else 
        $exe_dir/${exe_name} $com < $pipeInput 1> $OUT/$testid.out 2> $OUT/$testid.err
   fi 

   if [ -f $OUT/$TEST.prf ] ; then
       grep -v 'Creation date:' < $OUT/$TEST.prf > x ; mv x $OUT/$TEST.prf
   fi
   if [ -f $OUT/$TEST.sgml ] ; then
       sed 's/creation_date="[^"]*"//' < $OUT/$TEST.sgml > x ; mv x $OUT/$TEST.sgml
   fi
   if [ -f $OUT/$TEST.nl.sgml ] ; then
       sed 's/creation_date="[^"]*"//' < $OUT/$TEST.nl.sgml > x ; mv x $OUT/$TEST.nl.sgml
   fi
}

TEST=test1
doit $TEST \
        "Align Both Ref and Hyp transcripts. (one transcript to a line followed by an utterance id in parens)" \
        "${SCLFLAGS} -r $DATA/csrnab.ref -h $DATA/csrnab.hyp -i wsj -o all snt spk dtl prf sgml nl.sgml -O $OUT -f 0 -n $TEST" \
        "" \
        ""
        
TEST=test1a
doit $TEST \
        "Same as test1, but generating an sgml file, then piping to sclite for reports" \
        "${SCLFLAGS} -P -o dtl prf -O $OUT -f 0 -n $TEST" \
        test1.sgml \
	""
	
TEST=test1b
doit $TEST \
        "Same as test1, but using a language model for weights" \
        "${SCLFLAGS} -r $DATA/csrnab.ref -h $DATA/csrnab.hyp -i wsj -L $DATA/csrnab_r.blm -o sum wws prf -O $OUT -f 0 -n $TEST" \
        "" \
        "SLM"
	
TEST=test1c
doit $TEST \
        "Same as test1, but using a language model for weights" \
        "${SCLFLAGS} -r $DATA/csrnab.ref -h $DATA/csrnab.hyp -i wsj -w $DATA/csrnab_r.wwl -o wws prf -O $OUT -f 0 -n $TEST" \
        "" \
        ""

TEST=test1d
doit $TEST \
        "Same as test1, but producing a nl.sgml file" \
        "${SCLFLAGS} -r $DATA/csrnab.ref -h $DATA/csrnab.hyp -i wsj -o nl.sgml -O $OUT -f 0 -n $TEST" \
        "" \
        ""

TEST=test1e
doit $TEST \
        "Same as test1 but with utf-8 1 bytes per char" \
        "${SCLFLAGS} -r $DATA/csrnab.ref -h $DATA/csrnab.hyp -i wsj -o all snt spk dtl prf sgml nl.sgml -O $OUT -f 0 -n $TEST -e utf-8" \
        "" \
        ""

TEST=test2
doit $TEST \
        "Same as Test 1, but use Diff instead of DP alignments" \
        "${SCLFLAGS} -r $DATA/csrnab.ref -h $DATA/csrnab.hyp -i wsj -o all -O $OUT -f 0 -n $TEST -d" \
        "" \
        "DIFF"

TEST=test3
doit $TEST \
        "Align Segmental Time marks (STM) to Conversation time marks (CTM)" \
        "${SCLFLAGS} -r $DATA/lvc_ref.stm stm -h $DATA/lvc_hyp.ctm ctm -o all lur prf -O $OUT -f 0 -n $TEST" \
        "" \
        ""

TEST=test3a
doit $TEST \
        "Align Segmental Time marks (STM) to Conversation time marks (CTM) using the stm tag IGNORE_TIME_SEGMENT_IN_SCORING" \
        "${SCLFLAGS} -r $DATA/lvc_refe.stm stm -h $DATA/lvc_hyp.ctm ctm -o all lur prf -O $OUT -f 0 -n $TEST" \
        "" \
        ""

TEST=test3b
doit $TEST \
        "Align Segmental Time marks (STM) to Conversation time marks (CTM) with confidence scores" \
        "${SCLFLAGS} -r $DATA/lvc_ref.stm stm -h $DATA/lvc_hypc.ctm ctm -o sum -O $OUT -f 0 -n $TEST" \
        "" \
        ""

TEST=test3c
doit $TEST \
        "Test the output generated in lur when ther is no reference data" \
        "${SCLFLAGS} -r $DATA/lvc_refm.stm stm -h $DATA/lvc_hypm.ctm ctm -o lur -O $OUT -f 0 -n $TEST" \
        "" \
        ""

# TEST Number 4
TN=4
TEST=test$TN
echo "Test $TN:     Same as test 3, but using diff for alignment"
if test $DIFF_ENABLED = 1 ; then 
    $scliteCom ${SCLFLAGS} -r $DATA/lvc_ref.stm stm -h $DATA/lvc_hyp.ctm ctm \
	-o all -O $OUT -f 0 -n $TEST -d \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err
else
    echo "            **** Diff alignments have been disabled, not testing ***"
fi

# TEST Number 5
TN=5
TEST=test$TN
echo "Test $TN:     Align STM to free formatted text (TXT)"
if test $DIFF_ENABLED = 1 ; then
    $scliteCom ${SCLFLAGS} -r $DATA/lvc_ref.stm stm -h $DATA/lvc_hyp.txt txt \
	-o all prf -O $OUT -f 0 -n $TEST \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err
    grep -v 'Creation date:' < out/$TEST.prf > x ; mv x out/$TEST.prf
else
    echo "            **** Diff alignments have been disabled, not testing ***"
fi

# TEST Number 6
TN=6
TEST=test$TN
echo "Test $TN:     Align Mandarin Chinese words using DIFF"
if test $DIFF_ENABLED = 1 ; then
    $scliteCom ${SCLFLAGS} -e gb -r $DATA/mand_ref.stm stm \
	-h $DATA/mand_hyp.ctm ctm \
	-o all -O $OUT -f 0 -n $TEST -d \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err
else
    echo "            **** Diff alignments have been disabled, not testing ***"
fi

# TEST Number 7	
TN=7
TEST=test$TN
echo "Test $TN:     Run some test cases through"
$scliteCom ${SCLFLAGS} -r $DATA/tests.ref -h $DATA/tests.hyp -i spu_id \
	-o all -O $OUT -f 0 -n $TEST -F -D \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 7_r
TN=7_r
TEST=test$TN
echo "Test $TN:   Run some test cases through (reversing ref and hyp)"
$scliteCom ${SCLFLAGS} -h $DATA/tests.ref -r $DATA/tests.hyp -i spu_id \
	-o all -O $OUT -f 0 -n $TEST -F -D \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 7_1
TN=7_1
TEST=test$TN
echo "Test $TN:   Run some test cases through using infered word boundaries,"
echo "            not changing ASCII words"
$scliteCom ${SCLFLAGS} -r $DATA/tests.ref -h $DATA/tests.hyp -i spu_id \
	-o all -O $OUT -f 0 -n $TEST -S algo1 tests.lex \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 7_2
TN=7_2
TEST=test$TN
echo "Test $TN:   Run some test cases through using infered word boundaries,"
echo "            changing ASCII words"
$scliteCom ${SCLFLAGS} -r $DATA/tests.ref -h $DATA/tests.hyp -i spu_id \
	-o all -O $OUT -f 0 -n $TEST -S algo1 tests.lex ASCIITOO \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 7_2a
TN=7_2a
TEST=test$TN
echo "Test $TN:  Run some test cases through using infered word boundaries,"
echo "            changing ASCII words, using algo2."
$scliteCom ${SCLFLAGS} -r $DATA/tests.ref -h $DATA/tests.hyp -i spu_id \
	-o all -O $OUT -f 0 -n $TEST -S algo2 tests.lex ASCIITOO \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 7_3
TN=7_3
TEST=test$TN
echo "Test $TN:   Run some test cases through using infered word boundaries,"
echo "            not changing ASCII words and correct Fragments"
$scliteCom ${SCLFLAGS} -r $DATA/tests.ref -h $DATA/tests.hyp -i spu_id \
	-o all -O $OUT -f 0 -n $TEST -S algo1 tests.lex -F \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 7_4
TN=7_4
TEST=test$TN
echo "Test $TN:   Run some test cases through using infered word boundaries,"
echo "            changing ASCII words and correct Fragments"
$scliteCom ${SCLFLAGS} -r $DATA/tests.ref -h $DATA/tests.hyp -i spu_id \
	-o all -O $OUT -f 0 -n $TEST -S algo1 tests.lex ASCIITOO -F \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 7_5
TN=7_5
TEST=test$TN
echo "Test $TN:   Run some test cases through, character aligning them and"
echo "            removing hyphens"
$scliteCom ${SCLFLAGS} -r $DATA/tests.ref -h $DATA/tests.hyp -i spu_id \
	-o all -O $OUT -f 0 -n $TEST -c DH \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 7_6
TN=7_6
TEST=test$TN
echo "Test $TN:     Run some test cases through with utf-8 encoding"
$scliteCom ${SCLFLAGS} -r $DATA/tests.ref -h $DATA/tests.hyp -i spu_id \
	-o all sgml nl.sgml -O $OUT -f 0 -n $TEST -F -D -e utf-8 \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err
sed 's/creation_date="[^"]*"//' < out/$TEST.sgml > x ; mv x out/$TEST.sgml
sed 's/creation_date="[^"]*"//' < out/$TEST.nl.sgml > x ; mv x out/$TEST.nl.sgml


for utf in utf8-2bytes utf8-3bytes utf8-4bytes ; do
    TEST=test7-$utf
    doit $TEST \
        "Same as test 1 but with $utf" \
        "${SCLFLAGS} -r $DATA/tests.ref.$utf -h $DATA/tests.hyp.$utf -i spu_id -o all sgml -O $OUT -f 0 -n $TEST -F -D -e utf-8" \
        "" \
        ""        
done

# TEST Number 8
TN=8
TEST=test$TN
echo "Test $TN:     Align transcripts as character alignments"
$scliteCom ${SCLFLAGS} -r $DATA/csrnab1.ref -h $DATA/csrnab1.hyp -i wsj \
	-o all -O $OUT -f 0 -n $TEST -c \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 9
TN=9
TEST=test$TN
echo "Test $TN:     Run the Mandarin, doing a character alignment"
$scliteCom ${SCLFLAGS} -e gb -r $DATA/mand_ref.stm stm -h $DATA/mand_hyp.ctm ctm \
	-o all dtl prf -O $OUT -f 0 -n $TEST -c \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err
grep -v 'Creation date:' < out/$TEST.prf > x ; mv x out/$TEST.prf

# TEST Number 9_1
TN=9_1
TEST=test$TN
echo "Test $TN:   Run the Mandarin, doing a character alignment, removing hyphens"
$scliteCom ${SCLFLAGS} -e gb -r $DATA/mand_ref.stm stm -h $DATA/mand_hyp.ctm ctm \
	-o all -O $OUT -f 0 -n $TEST -c DH \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 10
TN=10
TEST=test$TN
echo "Test $TN:    Run the Mandarin, doing a character alignment, not effecting ASCII WORDS"
$scliteCom ${SCLFLAGS} -e gb -r $DATA/mand_ref.stm stm -h $DATA/mand_hyp.ctm ctm \
	-o all prf -O $OUT -f 0 -n $TEST -c NOASCII \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err
grep -v 'Creation date:' < out/$TEST.prf > x ; mv x out/$TEST.prf

# TEST Number 10_1
TN=10_1
TEST=test$TN
echo "Test $TN:  Run the Mandarin, doing a character alignment, not effecting ASCII WORDS"
echo "            Removing hyphens."
$scliteCom ${SCLFLAGS} -e gb -r $DATA/mand_ref.stm stm -h $DATA/mand_hyp.ctm ctm \
	-o all -O $OUT -f 0 -n $TEST -c NOASCII DH \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 11
TN=11
TEST=test$TN
echo "Test $TN:    Run the Mandarin, doing the inferred word segmentation alignments, algo1"
$scliteCom ${SCLFLAGS} -e gb -r $DATA/mand_ref.stm stm -h $DATA/mand_hyp.ctm ctm \
	-o all -O $OUT -f 0 -n $TEST -S algo1 mand.lex \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 12
TN=12
TEST=test$TN
echo "Test $TN:    Run the Mandarin, doing the inferred word segmentation alignments, algo1"
echo "            Scoring fragments as correct"
$scliteCom ${SCLFLAGS} -e gb -r $DATA/mand_ref.stm stm -h $DATA/mand_hyp.ctm ctm \
	-o all -O $OUT -f 0 -n $TEST -S algo1 mand.lex -F \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 13
TN=13
TEST=test$TN
echo "Test $TN:    Run alignments on two CTM files, using DP Word alignments"
$scliteCom ${SCLFLAGS} -r $DATA/tima_ref.ctm ctm -h $DATA/tima_hyp.ctm ctm \
	-o all prf -O $OUT -f 0 -n $TEST \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err
grep -v 'Creation date:' < out/$TEST.prf > x ; mv x out/$TEST.prf

# TEST Number 13_a
TN=13_a
TEST=test$TN
echo "Test $TN:  Run alignments on two CTM files, using Time-Mediated DP alignments"
$scliteCom ${SCLFLAGS} -r $DATA/tima_ref.ctm ctm -h $DATA/tima_hyp.ctm ctm \
	-o all -O $OUT -f 0 -n $TEST -T \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 14_a
TN=14_a
TEST=test$TN
echo "Test $TN:  Reduce the ref and hyp input files to the intersection of the inputs"
$scliteCom ${SCLFLAGS} -r $DATA/lvc_refr.stm stm -h $DATA/lvc_hypr.ctm ctm \
	-o all lur -O $OUT -f 0 -n $TEST -m ref hyp\
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 14_b
TN=14_b
TEST=test$TN
echo "Test $TN:  Reduce the ref and hyp input files to the intersection of the inputs"
echo "            Using a reduced size hyp file"
$scliteCom ${SCLFLAGS} -r $DATA/lvc_ref.stm stm -h $DATA/lvc_hypr.ctm ctm \
	-o all lur -O $OUT -f 0 -n $TEST -m ref hyp\
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 14_c
TN=14_c
TEST=test$TN
echo "Test $TN:  Reduce the ref and hyp input files to the intersection of the inputs"
echo "            Using a reduced size hyp file"
$scliteCom ${SCLFLAGS} -r $DATA/lvc_refr.stm stm -h $DATA/lvc_hyp.ctm ctm \
	-o all lur -O $OUT -f 0 -n $TEST -m ref hyp \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 14_d
TN=14_d
TEST=test$TN
echo "Test $TN:  Reduce the ref and hyp input files to the intersection of the inputs"
echo "            Using a reduced size hyp and ref file"
$scliteCom ${SCLFLAGS} -r $DATA/lvc_refr.stm stm -h $DATA/lvc_hypr.ctm ctm \
	-o all lur -O $OUT -f 0 -n $TEST -m hyp \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

# TEST Number 14_e
TN=14_e
TEST=test$TN
echo "Test $TN:  Reduce the ref and hyp input files to the intersection of the inputs"
echo "            Using a reduced size hyp and ref file"
$scliteCom ${SCLFLAGS} -r $DATA/lvc_refr.stm stm -h $DATA/lvc_hypr.ctm ctm \
	-o all lur -O $OUT -f 0 -n $TEST -m ref \
	1> $OUT/$TEST.out 2> $OUT/$TEST.err

TEST=test15_a
doit $TEST \
        "UTF-8 test - Cantonese no options" \
        "${SCLFLAGS} -r $DATA/test.cantonese.stm stm -h $DATA/test.cantonese.ctm ctm -o all prf -O $OUT -f 0 -n $TEST -e utf-8" \
        "" \
        ""

TEST=test15_b
doit $TEST \
        "UTF-8 test - Cantonese no options - Character scoring" \
        "${SCLFLAGS} -r $DATA/test.cantonese.stm stm -h $DATA/test.cantonese.ctm ctm -o all prf -O $OUT -f 0 -n $TEST -e utf-8 -c NOASCII DH" \
        "" \
        ""

TEST=test15_c
doit $TEST \
        "UTF-8 test - UTF-8 Turkish" \
        "${SCLFLAGS} -r $DATA/test.turkish.ref trn -h $DATA/test.turkish.hyp -o all prf -O $OUT -f 0 -n $TEST -e utf-8 babel_turkish -i spu_id" \
        "" \
        ""

# TEST Number 16_X
n=1
for hyp in stm2ctm_missing.hyp-extra.ctm stm2ctm_missing.hyp-missall.ctm stm2ctm_missing.hyp-missfile1.ctm stm2ctm_missing.hyp-missfile1chanA.ctm stm2ctm_missing.hyp-missfile1chanb.ctm stm2ctm_missing.hyp-missfile2.ctm stm2ctm_missing.hyp-missfile2chanA.ctm stm2ctm_missing.hyp-missfile2chanB.ctm stm2ctm_missing.hyp.ctm ; do
    TEST=test16_$n
    doit $TEST \
        "Allow incomplete hyp CTM files - $hyp" \
        "${SCLFLAGS} -r $DATA/stm2ctm_missing.ref.stm stm -h $DATA/$hyp ctm -o all prf -O $OUT -f 0 -n $TEST " \
        "" \
        ""
    n=`expr $n + 1`
done

# TEST Number 17
TEST=test17
doit $TEST \
    "Vietnamese case conversion" \
    "${SCLFLAGS} -r $DATA/test.vietnamese.ref.trn trn -h test.vietnamese.hyp.trn trn -i spu_id -o all prf -O $OUT -f 0 -n $TEST -e utf-8 babel_vietnamese " \
    "" \
    ""

echo ""
echo "Executions complete: Comparing output"
filter="diff -r $base_dir $OUT | grep -v CVS"
vfilter="diff -c -r $base_dir $OUT | grep -v CVS"
if test $DIFF_ENABLED = 0 ; then
    echo "   Removing DIFF tests"
    filter="$filter | grep -ve 'test[2456]\.'"
    vfilter="$vfilter | grep -ve 'test[2456]\.'"
fi
if test $SLM_ENABLED = 0 ; then
    echo "   Removing SLM tests"
    filter="$filter | grep -ve 'test1b\.'"
    vfilter="$vfilter | grep -ve 'test1b\.'"
fi
echo ""

if test "`eval $filter`" = "" ; then
    echo "ALL TESTS SUCCESSFULLY COMPLETED"
    if [ $clean = "TRUE" ] ; then
	rm -r $OUT
    fi
    exit 0
else
    echo "     !!!!!  TESTS HAVE FAILED  !!!!!"
    echo ""
    grep 'diff -c -r' Failed.log | awk '{print $5}'
    echo ""
    echo "Read Failed.log"
    eval $vfilter > Failed.log
    exit 1
fi