#!/bin/bash

NKJP_ROOT=$1

function doReplace {
	cat - | sed 's/<symbol value="'$1'"\/>/<symbol value="'$2'"\/>/g'
}

for f in `find "$NKJP_ROOT" -name ann_groups.xml | sort`
do
	echo $f
	cat $f | doReplace 'AdjG[a-z]' 'AdjG' | doReplace 'NumG[a-z]' 'NumG' | doReplace 'PreNG' 'PrepNG' | doReplace 'PrepNG[a-z]' 'PrepNG' | sponge $f
done
