updated grammar conversion to ignore terminal alignments