#!/bin/bash -ex
export LANG=en_US.UTF-8 LC_COLLATE=C

for WEIGHT in tf idf tfidf; do
for SYNSETS in *-synsets.tsv; do
for ISAS in {patterns,patterns-limit,wiktionary,mas,joint}-filter{,-exp}-isas.txt; do
  if [ ! -f "$ISAS" ]; then
    touch "$ISAS"
  fi

  LINKED=${SYNSETS%-synsets.tsv}-${ISAS%-isas.txt}-$WEIGHT-linked.tsv
  ./link.py --synsets=$SYNSETS --isas=$ISAS | sort -t $'\t' -k2nr -k4nr -k1n -o "$LINKED"

  ISAS=${LINKED%-linked.tsv}-isas.txt
  ./linked-isas.awk "$LINKED" > "$ISAS"

  EVALUATE="$EVALUATE $ISAS"
done
done
done

./evaluate.py --gold=ruthes-isas.txt {patterns,patterns-limit,wiktionary,mas,joint}-filter{,-exp}-isas.txt $EVALUATE | tee pairwise-ruthes.tsv | sort -t $'\t' -g -k9r | column -t

#!/bin/bash -ex
export LANG=en_US.UTF-8 LC_COLLATE=C

for WEIGHT in tf idf tfidf; do
for SYNSETS in *-synsets.tsv; do
for ISAS in {patterns,patterns-limit,wiktionary,mas}-filter{,-exp}-isas.txt; do
  if [ ! -f "$ISAS" ]; then
    touch "$ISAS"
  fi

  LINKED=${SYNSETS%-synsets.tsv}-${ISAS%-isas.txt}-$WEIGHT-linked.tsv
  ./link.py --synsets=$SYNSETS --isas=$ISAS | sort -t $'\t' -k2nr -k4nr -k1n -o "$LINKED"

  ISAS=${LINKED%-linked.tsv}-isas.txt
  ./linked-isas.awk "$LINKED" > "$ISAS"

  EVALUATE="$EVALUATE $ISAS"
done
done
done

./evaluate.py --gold=ruthes-isas.txt {patterns,patterns-limit,wiktionary,mas}-filter{,-exp}-isas.txt $EVALUATE | tee pairwise-ruthes.tsv | sort -t $'\t' -g -k9r | column -t

--- 
+++ 
@@ -3,7 +3,7 @@
 
 for WEIGHT in tf idf tfidf; do
 for SYNSETS in *-synsets.tsv; do
-for ISAS in {patterns,patterns-limit,wiktionary,mas}-filter{,-exp}-isas.txt; do
+for ISAS in {patterns,patterns-limit,wiktionary,mas,joint}-filter{,-exp}-isas.txt; do
   if [ ! -f "$ISAS" ]; then
     touch "$ISAS"
   fi
@@ -19,4 +19,4 @@
 done
 done
 
-./evaluate.py --gold=ruthes-isas.txt {patterns,patterns-limit,wiktionary,mas}-filter{,-exp}-isas.txt $EVALUATE | tee pairwise-ruthes.tsv | sort -t $'\t' -g -k9r | column -t
+./evaluate.py --gold=ruthes-isas.txt {patterns,patterns-limit,wiktionary,mas,joint}-filter{,-exp}-isas.txt $EVALUATE | tee pairwise-ruthes.tsv | sort -t $'\t' -g -k9r | column -t
Add joint to the comparison
