#!/bin/csh

# perform senseval scoring for a single word

# this is specific to the english task
# we have to remove tildes since we have converted the %
# in wordnet senseids into tildes, due to the fact that
# weka treats % as a comment

if ($#argv != 2) then
   echo "Usage: score-word task alg "
   exit 1
endif        

set alg = $2

# modify the distributional output to a simple class

winnerTakeAll.pl --margin 0.05 $1-test.$alg.answer.dist > $1-test.$alg.answer

## fix answers is specific to senseval-2, although it shouldn't hurt
## other data. it includes a tilde removal, hence tilde-rem superfluous
## tilde-rem.pl $1-test.$alg.answer.dist > $1-test.$alg.answer.dist.tmp
## tilde-rem.pl $1-test.$alg.answer > $1-test.$alg.answer.tmp

fix-answers.pl $1-test.$alg.answer.dist > $1-test.$alg.answer.dist.tmp
fix-answers.pl $1-test.$alg.answer > $1-test.$alg.answer.tmp

mv $1-test.$alg.answer.dist.tmp $1-test.$alg.answer.dist
mv $1-test.$alg.answer.tmp $1-test.$alg.answer

echo "score-word finished $1"
