# for C in newscomm; do
# for C in europarl-v7 jrc taus gale nist openst newscomm; do
for C in ccbword un; do
  echo $C
  cd ${C};
  for L in `ls .`; do
    echo $L
    if [ -f ${L}/corpus.parsed.en ]; then
      cd ${L};
      paste corpus.${L} corpus.parsed.en corpus.align | \
        perl -pe "s/\t/ ||| /g" | grep -v '()' | grep -v "||| \+\$" \
        > input-file;
      echo "LEAVING."
      cd ..;
    fi;
#     if [ ! -f ${L}/corpus.parsed.en -a -f ${L}/corpus.en ]; then
#       cd ${L};
#       paste data/train/corpus.${L} data/train/corpus.parsed.en \
#         alignments/training.align | \
#         perl -pe "s/\t/ ||| /g" | grep -v '()' | grep -v "||| \+\$" \
#         > input-file;
#       echo "LEAVING."
#       cd ..;
#     fi;
  done;
  echo "HOPPING."
  cd ..;
done


