Skip to content

Instantly share code, notes, and snippets.

@stesh
Created January 31, 2013 23:50
Show Gist options
  • Select an option

  • Save stesh/4687813 to your computer and use it in GitHub Desktop.

Select an option

Save stesh/4687813 to your computer and use it in GitHub Desktop.
#!/bin/sh
fomafst="$1"
inverted=$(tempfile)
cat <<EOF | foma -p
read regex @"$fomafst";
invert net
save stack $inverted
EOF
mv "$inverted" "$inverted.gz"
gunzip "$inverted.gz"
hfst-fst2fst -O -i "$inverted" -o "$inverted".hfst
mv "$inverted".hfst "$fomafst".hfst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment