mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-17 16:59:34 -06:00
Added lib/resource/Examples/testexamples, a script which linearizes all the examples with all resource grammars, and saves the output to files.
This commit is contained in:
17
lib/resource/Examples/testexamples
Normal file
17
lib/resource/Examples/testexamples
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
DIR="."
|
||||
LANGS=`ls $DIR/Examples???.gf | perl -pe 's/.*(\w{3})\.gf/$1/'`
|
||||
|
||||
LATIN1_LANGS="Dan Fin Fre Ger Ita Nor Spa Swe"
|
||||
|
||||
for L in $LANGS; do
|
||||
echo "gt | l | wf tmp.txt" | gf -s -batch -nocpu $DIR/Examples${L}.gf
|
||||
grep -v '^$' tmp.txt > examples-$L.txt
|
||||
echo "Wrote examples-$L.txt..."
|
||||
done
|
||||
|
||||
for L in $LATIN1_LANGS; do
|
||||
iconv -f iso-8859-1 -t utf8 examples-${L}.txt > tmp.txt
|
||||
mv tmp.txt examples-${L}.txt
|
||||
done
|
||||
Reference in New Issue
Block a user