Pairtest script
From LING073
The following is a script to perform twol pair tests.
The code
LG=xyz
count=0
pass=0
for i in `cat ../apertium-${LG}.${LG}.twol | grep '!@' | cut -f2 -d'@' | tr ' ' '%'`; do
count=`expr $count + 1`;
x=`echo $i | tr '%' ' '`;
echo -e "@@@ $x\n ---------------------------------" ;
echo $x | hfst-pair-test ../.deps/${LG}.twol.hfst | sed 's/^/ /g';
npass=`echo $x | hfst-pair-test ../.deps/${LG}.twol.hfst | sed 's/^/ /g' | grep passed | wc -l`;
pass=`expr $pass + $npass`;
echo "";
done
echo $pass"/"$count" passed.";
To "install"
- Copy the code into a file called
run-twol-pairtests.shin your ling073-xyz/tests/ directory. - Replace
xyzon the first line with the code for your language. - In the tests directory,
chmod +x run-twol-pairtests.sh. - Commit the script to your git repository.
- You can run the script from the tests directory by typing
./run-twol-pairtests.sh.