summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-10-08 13:41:34 +0000
committerkrasimir <krasimir@chalmers.se>2009-10-08 13:41:34 +0000
commit624b1075d9be8ed577c62b08a45320b571d849ed (patch)
tree6917d136adb0011159f94617268207572ac4d367
parenta84cdb32c75b11a2e7bae2906137cefae4ad03ce (diff)
added start category S to Trigram.gf
-rw-r--r--examples/trigram/Trigram.gf5
-rw-r--r--examples/trigram/TrigramCnc.gf3
2 files changed, 7 insertions, 1 deletions
diff --git a/examples/trigram/Trigram.gf b/examples/trigram/Trigram.gf
index 2e6e18fdd..0ad99b0bf 100644
--- a/examples/trigram/Trigram.gf
+++ b/examples/trigram/Trigram.gf
@@ -1,6 +1,9 @@
abstract Trigram = {
cat
+ -- A sentence
+ S ;
+
-- A lexicon is a set of 'Word's
Word ;
@@ -17,6 +20,8 @@ cat
Prob (a,b,c : Word) ;
data
+ sent : ({a,b} : Word) -> Seq a b -> S ;
+
-- Here we construct sequence by using nil and cons. The Prob argument ensures
-- that the sequence contains only valid N-grams and contributes with the right
-- probability mass
diff --git a/examples/trigram/TrigramCnc.gf b/examples/trigram/TrigramCnc.gf
index 917aa3db8..181750396 100644
--- a/examples/trigram/TrigramCnc.gf
+++ b/examples/trigram/TrigramCnc.gf
@@ -1,11 +1,12 @@
concrete TrigramCnc of Trigram = {
lincat
- Word,Seq = Str;
+ S,Word,Seq = Str;
Unigram, Bigram, Trigram, Prob = {} ;
lin
+ sent _ _ l = l ;
nil a b c _ = a ++ b ++ c ;
cons _ _ l c _ = l ++ c ;