#!/bin/bash -e

export LANG=en_US.UTF-8 LC_COLLATE=C
set -o pipefail -x

for weight in 1000 100 10; do
  echo "WEIGHT = $weight"

  rm -rf "arguments-$weight"
  mkdir -p "arguments-$weight"

  for elements in subjects predicates objects; do
    ln -sfT "neighbors-$elements-$weight.txt" "neighbors-$elements.txt"
    make "neighbors-$elements-watset.tsv"
    cp -fv "neighbors-$elements.txt" "neighbors-$elements-watset.tsv" "arguments-$weight/"
  done

  WEIGHT=$weight make "arguments.txt"
  cp -fv "arguments.txt" "arguments-$weight/"

  nice groovy -classpath ../watset-java/target/watset.jar 'fi/eval/triframes_nmpu.groovy' 'arguments.txt' 'fn-depcc-triples.tsv' | tee "arguments-$weight/nmpu.txt"
done
