#! /bin/sh 

#
# This script tags a ctm file with BBN's IdentiFinder, then 
# compares the output to the reference.
#

UTF_FILT = $(IEEVAL)/scripts/utf_filt
CTM2UTF  = $(IEEVAL)/scripts/ctm2utf.pl
REEP     = $(IEEVAL)/scripts/reep
DTD      = $(IEEVAL)/refdata/utf.dtd
IDFWRAP  = $(IEEVAL)/scripts/IdF_utf_wrapper.pl
UTF2NERF = $(IEEVAL)/scripts/utf2nerf.pl

test:	h4e_97.ref.utf h4e_97_ref-t.ie.utf 
	$(REEP) \
		--ref h4e_97.ref.utf \
		--hyp h4e_97_ref-t.ie.utf \
		--outdir . \
		--nocleanup \
		--text_mode

h4e_97_ref-t.ie.utf:	h4e_97_ref-t.utf 
	@if [ ! -d "$(IDFROOT)" ] ; then \
		(echo "Please set env. var. IDFROOT to IdentiFinder's location" ; \
		exit 1 ) ; \
	fi
	$(IDFWRAP) -I $(IDFROOT) -i h4e_97_ref-t.utf -o h4e_97_ref-t.ie.utf

h4e_97_ref-t.utf:	h4e_97.ref.utf
	$(UTF2NERF) -e $(DTD) -i h4e_97.ref.utf -o h4e_97_ref-t.utf


clean:
	$(RM) *~ \
		sclitesgml.*.tald \
		foo.hyp  \
		IdF.utf.* \
		*.[0-9] \
		*.[0-9][0-9] \
		*.[0-9][0-9][0-9] \
		*.[0-9][0-9][0-9][0-9] \
		*.[0-9][0-9][0-9][0-9][0-9]

xclean:	clean
	$(RM) h4e_97_ref-t.utf h4e_97_ref-t.ie.utf

