From d96d0f0a6e5706490f4ee59f10d43e59340657c9 Mon Sep 17 00:00:00 2001 From: bjorn Date: Tue, 6 May 2008 15:29:32 +0000 Subject: [PATCH] Added lib/resource/Examples/testexamples, a script which linearizes all the examples with all resource grammars, and saves the output to files. --- lib/resource/Examples/testexamples | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/resource/Examples/testexamples diff --git a/lib/resource/Examples/testexamples b/lib/resource/Examples/testexamples new file mode 100644 index 000000000..1e0ea4cec --- /dev/null +++ b/lib/resource/Examples/testexamples @@ -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