#!/bin/bash

if [ $# != 1 ]
then
    echo "usage: $0 <xml-filename>" >&2
    exit 1
fi

xml=$1

set -e -u -o pipefail

dir=`dirname $0`

output=$dir/../models/`basename $xml .xml`
mkdir -p $output
echo "output dir: `readlink -f $output`"

$dir/create-asr-models.sh $xml $output
$dir/slu/train-slu.sh $xml $output
$dir/create-config.sh $xml

echo SUCCESS
