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 ;