#AWK script to handle transduction of running Mixtec text. Attempts to handle both Mixtec and Spanish.
#Version: 5b
#Foma Mixtec version: 39b (wt39b.bin)
#2018-02-14
{
del=0
for (i=1; i<=NF; i++) {
if ($i ~ /^\[.*\]$/ && $i != "[...]")
continue;
if ($i ~ /^\[/ && $i !~ /\]/)
del=1
if (del == 0) {
if ($i !~ /[1234]/ || $i ~ /\*/) {
cmd = "echo \"" $i "\" | flookup -ix minspanb_saves-punct.bin | head -1"
} else {
cmd = "echo \"" $i "\" | flookup -ix wt39b_saves-punct.bin | head -1"
}
cmd | getline out[i]
close(cmd)
printf "%s ", out[i]
}
if ($i ~ /\]/)
del=0
}
printf "\n"
}