#!/bin/bash
# Neha Gupta
#***************************************************************#
base="/home/damani/Desktop/post/System"
file=$1
flag=$3
flagVGI=$4
flagAfterVGI=$5
path=$6
ngiflag=$7
dm=$8
tags=$9
flagUseMorphFeatures=${10}
model=$base/HindiLinguisticResources/${2}_${flag}_${flagVGI}_${flagUseMorphFeatures}.model

if [ -e ${file}_dm ]
then
rm ${file}_dm
fi
echo > ${file}_dm

if [ $dm == "true" ]
then

java -classpath $base/CPOST/bin:$base/CPOST/lib/colt.jar:$base/CPOST/lib/LBFGS.jar:$base/CPOST/lib/trove.jar:$base/CPOST/lib/UGM.jar iitb.cfilt.cpost.crfpp.DMFileFormer $base/HindiLinguisticResources/hindiConfig $file ${file}_new $flag $flagVGI $tags >> ${file}_dm

else if [ $tags == "true" ]
then

java -classpath $base/CPOST/bin:$base/CPOST/lib/colt.jar:$base/CPOST/lib/LBFGS.jar:$base/CPOST/lib/trove.jar:$base/CPOST/lib/UGM.jar iitb.cfilt.cpost.crfpp.DMFileFormer $base/HindiLinguisticResources/hindiConfig $file ${file}_new $flag $flagVGI $tags

fi
fi

echo ********Done Morph Analysis****

if [ $tags == "true" ]
then

#echo $base/CRF++-0.50/crf_test -m $model ${file}_new 
$base/CRF++-0.50/crf_test -m $model ${file}_new > ${file}_output 

echo ********Done CRF Tagging****

java -classpath $base/CPOST/bin:$base/CPOST/lib/colt.jar:$base/CPOST/lib/LBFGS.jar:$base/CPOST/lib/trove.jar:$base/CPOST/lib/UGM.jar iitb.cfilt.cpost.crfpp.Tester_VGI_pref $base/HindiLinguisticResources/hindiConfig ${file}_output ${file}_result ${file}_final $flagAfterVGI $ngiflag > ${file}_accuracyReport

fi

echo ********Done NGI/VGI Error Analysis****

