9:02 am GMT
Demo Results
Here is the highlighted version of your file. If there are any problems with the highlighted
version, check you're using the right language, and that your syntax is correct. If there still is
a problem, mail a bug report to BenBE@geshi.org.
GeSHi © 2004-2007 Nigel McNie, 2007-2008 Benny Baumann, 2008 Milian Wolff #!/bin/bash
sizes=`cat <<- SIZ
312500
625000
1250000
2500000
5000000
10000000
20000000
SIZ`;
CHAR_MODEL=7;
WORD_MODEL=3;
N=$WORD_MODEL;
fileTrain="/tmp/$$.train";
fileHeldout="/tmp/$$.heldout";
fileOut="/tmp/$$.out";
fileBugs="/tmp/$$.bugs";
fileCorrect="/tmp/$$.correct";
if [ x$1 == x ]; then
echo "Usage: ./task.sh [0-4]";
exit;
fi;
cc charDiff.c -o charDiff
case $1 in
1)
N=$WORD_MODEL;
scr='cat';
;;
2)
N=$WORD_MODEL;
scr="./toLower.pl";
;;
3)
N=$CHAR_MODEL;
scr="./makeCharVerticalFile";
;;
4)
N=$CHAR_MODEL;
scr="./makeCharVerticalFile | ./toLower.pl"
;;
*)
echo "Usage: ./task.sh [0-4]";
exit;
esac;
echo "Mode: " $1
echo " Filter: " $scr
cat words.correct | eval $scr > $fileCorrect;
cat words.bugs | eval $scr > $fileBugs;
for s in $sizes; do
h=`expr $s / 20`;
head -n $s words.train | eval $scr > $fileTrain
head -n $h words.heldout | eval $scr > $fileHeldout
echo "Training size: " $s;
for i in `seq 1 $N`; do
run="./correct.pl $fileTrain $fileHeldout $i $fileBugs"
# echo $run;
echo -n `date +"%Y-%m-%d %H:%M:%S"`;
echo -n " n: " $i ": ";
eval $run > $fileOut;
./charDiff $fileOut $fileCorrect;
done;
done;
rm -rf /tmp/$$.*
Statistics
Language used: bash |
Statistic | Your source | Average for bash |
Characters in source: | 1311 (13488 in highlighted result) | 1182.487 |
Total time highlighting: | 0.393 seconds | 0.120 seconds |
Characters per second: | 3332.317 chars per second | 0.000/8895.838/181115.914 chars per second |
Back to enter source |