diff --git a/testsuite/lpgf/Foods.treebank b/testsuite/lpgf/Foods.treebank new file mode 100644 index 000000000..02efbf644 --- /dev/null +++ b/testsuite/lpgf/Foods.treebank @@ -0,0 +1,14 @@ +Foods: Pred (That Wine) Delicious +FoodsEng: that wine is delicious + +Foods: Pred (This Pizza) (Very Boring) +FoodsEng: this pizza is very boring + +Foods: Pred (This Cheese) Fresh +FoodsEng: this cheese is fresh + +Foods: Pred (Those Fish) Warm +FoodsEng: those fish are warm + +Foods: Pred (That (Mod Boring (Mod Italian Pizza))) Expensive +FoodsEng: that boring Italian pizza is expensive diff --git a/testsuite/lpgf/Foods.trees b/testsuite/lpgf/Foods.trees index 2253d4acb..373cdf6b9 100644 --- a/testsuite/lpgf/Foods.trees +++ b/testsuite/lpgf/Foods.trees @@ -1,29 +1,5 @@ -Foods: Pred (This Pizza) (Very Boring) -FoodsEng: this pizza is very boring - -Foods: Pred (That Pizza) Delicious -FoodsEng: that pizza is delicious - -Foods: Pred (That Wine) Boring -FoodsEng: that wine is boring - -Foods: Pred (This Cheese) Fresh -FoodsEng: this cheese is fresh - -Foods: Pred (Those Fish) Boring -FoodsEng: those fish are boring - -Foods: Pred (This Cheese) Warm -FoodsEng: this cheese is warm - -Foods: Pred (That (Mod Boring (Mod Italian Pizza))) Italian -FoodsEng: that boring Italian pizza is Italian - -Foods: Pred (Those Cheese) Expensive -FoodsEng: those cheeses are expensive - -Foods: Pred (Those Wine) Italian -FoodsEng: those wines are Italian - -Foods: Pred (This Wine) Boring -FoodsEng: this wine is boring +Pred (That Wine) Delicious +Pred (This Pizza) (Very Boring) +Pred (This Cheese) Fresh +Pred (Those Fish) Warm +Pred (That (Mod Boring (Mod Italian Pizza))) Expensive diff --git a/testsuite/lpgf/Walking.treebank b/testsuite/lpgf/Walking.treebank new file mode 100644 index 000000000..a8e50b342 --- /dev/null +++ b/testsuite/lpgf/Walking.treebank @@ -0,0 +1,11 @@ +Walking: Pred John Walk +WalkingEng: John walks +WalkingGer: John geht + +Walking: Pred We Walk +WalkingEng: we walk +WalkingGer: wir gehen + +Walking: And (Pred John Walk) (Pred We Walk) +WalkingEng: John walks and we walk +WalkingGer: John geht und wir gehen diff --git a/testsuite/lpgf/Walking.trees b/testsuite/lpgf/Walking.trees index a8e50b342..e405c8e75 100644 --- a/testsuite/lpgf/Walking.trees +++ b/testsuite/lpgf/Walking.trees @@ -1,11 +1,3 @@ -Walking: Pred John Walk -WalkingEng: John walks -WalkingGer: John geht - -Walking: Pred We Walk -WalkingEng: we walk -WalkingGer: wir gehen - -Walking: And (Pred John Walk) (Pred We Walk) -WalkingEng: John walks and we walk -WalkingGer: John geht und wir gehen +Pred John Walk +Pred We Walk +And (Pred John Walk) (Pred We Walk) diff --git a/testsuite/lpgf/mkTreebank.sh b/testsuite/lpgf/mkTreebank.sh new file mode 100755 index 000000000..dc7ce5134 --- /dev/null +++ b/testsuite/lpgf/mkTreebank.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -e +if [ $# -lt 1 ]; then + echo "Must specify trees file" + exit 1 +fi +ABSNAME="${1%.*}" +echo "read_file -file=$1 -lines -tree | linearize -treebank | write_file -file=$ABSNAME.treebank" | gf --run $ABSNAME*.gf +echo "Wrote $ABSNAME.treebank" +echo "(you will have to add newlines separating the trees manually)" diff --git a/testsuite/lpgf/run.hs b/testsuite/lpgf/run.hs index e26aa8e70..70aadcd84 100644 --- a/testsuite/lpgf/run.hs +++ b/testsuite/lpgf/run.hs @@ -34,7 +34,7 @@ doGrammar gname = do lpgf <- readLPGF $ gname ++ ".lpgf" -- Read treebank - gs <- groups . lines <$> readFile (dir gname <.> "trees") + gs <- groups . lines <$> readFile (dir gname <.> "treebank") forM_ gs $ \grp -> do let ast = drop 2 $ dropWhile (/=':') $ head grp printf "%s: %s\n" gname ast