#!/bin/bash

if [ "$1" == "" ]
then
    echo "Must specify NKJP root directory" >&2
    exit 1
fi

ROOT=$1

for f in `find "$ROOT" -name ann_morphosyntax.xml | sort`
do 
    d=`dirname $f`
    echo "Validating $d"
    python validateDir.py --dirname=$d
    if [ $? -ne 0 ]; then exit 1; fi
done
