HFST: Brazilian Portuguese Script

For more information, see HfstBrazilianPortuguese.

echo "[ a | e | i | o | u " \
     "|  |  |  |  |  " \
     "|  |  |          " \
     "|  |              " \
     "|                   " \
     "|                  " \
     "]" | hfst-regexp2fst -f $FORMAT > Vowel

echo "[?]" | hfst-regexp2fst -f $FORMAT > Solution

for i in \
  '[ s -> z || @"Vowel" _ @"Vowel" ]' \
  "[  -> s ]" \
  "[ c h -> %$ ]" \
  "[ c -> s || _ [ e | i |  |  |  ] ]" \
  "[ c -> k ]" \
  "[ s s -> s ]" \
  "[ n h -> N ]" \
  "[ l h -> L ]" \
  "[ h -> 0 ]" \
  "[ r r -> R ]" \
  "[ r -> R || .#. _ ]" \
  "[ e -> i || _ (s) .#. , .#. p _ r ]" \
  "[ o -> u || _ (s) .#. ]" \
  "[ d -> J || _ [ i |  ] ]" \
  "[ t -> C || _ [ i |  ] ]" \
  "[ z -> s || _ .#. ]";
do
  echo $i | hfst-regexp2fst -f $FORMAT | hfst-compose -1 Solution > TMP;
  mv TMP Solution;
done

mv Solution BrazilianPortuguese


-- ErikAxelson - 2011-10-20