#!/bin/sh

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

export LANG=ja_JP.UTF-8

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

for i in $CORPUS_LIST
do
    mecab-test-gen < "corpus.$i.txt" > "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.txt > 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.txt):" >> system-eval.results
	mecab-system-eval -l "0 1 2 3 4 5 6 7" \
	    "test.$target.$l.result" "corpus.$target.txt" \
	    >> system-eval.results
    done
done
