#!/bin/sh

PATH="/usr/local/bin:/usr/local/libexec/mecab:/bin:/usr/lib/mecab:/usr/local/Cellar/mecab/0.994/libexec/mecab"
export PATH

export LANG=ja_JP.UTF-8

#CORPUS_LIST="misc kanjikai ryomou jts-wa jts-JP"
CORPUS_LIST="misc kanjikai ryomou"

for i in $CORPUS_LIST
do
    mecab-test-gen < "corpus.$i.mc" > "test.$i"
done

#cat corpus \
#cat corpus.*.txt \
#| grep -v EOS | sed 's/	/,0,0,0,/' | sort | uniq > misc.corpus.csv


echo 'mecab-system-eval -l "0 1 2 3 4 5 6 7"' > system-eval.results

for l in $CORPUS_LIST
do
    cat corpus.$l.mc > corpus
    ./mk-final.sh
    for target in $CORPUS_LIST
    do
	mecab -d ../final/ < "test.$target" > "test.$target.$l.result"
	echo '' >> system-eval.results
	echo "test.$target (corpus.$l.mc):" >> system-eval.results
	mecab-system-eval -l "0 1 2 3 4 5 6 7" \
	    "test.$target.$l.result" "corpus.$target.mc" \
	    >> system-eval.results
    done
done
