#!/bin/sh
INSTALL_DIR=/gig2/ftproot/madcow/programs/sro2lsn.911217
# Produce the Lexical SNOR scoring input from the SR_output (.sro)
# transcriptions or Speech recognizer output
#
# 0) remove edit cues and leave the remaining words
# 1) delete the helpful interpretation marks
# 2) delete non-lexical acoustic events in square brackets
# 3) remove angle brackets from verbally deleted words
# 4) remove the stars from mispronounced words
# 5) delete false start words ending with a hyphen
# 6) collapse runs of spaces, delete initial and final spaces
# 7) make everything uppercase

awk -f $INSTALL_DIR/sro2lsn.awk* | \
sed -e 's/[,.:\!\?~]//g'  | \
sed -e 's/\[[^ ][^ ]*\]//g'  | \
sed -e 's/[<>]//g'  | \
sed -e 's/\*\([^ ][^ ]*\)\*/\1/g'  | \
sed -e 's/[^ ][^ ]*-//g' -e 's/-[^ ][^ ]*//g'  | \
sed -e 's/  */ /g' -e 's/^ *//g' -e 's/ *$//g'  | \
tr '[a-z]' '[A-Z]'  | \
cat
