1
0
forked from GitHub/gf-core

added start category S to Trigram.gf

This commit is contained in:
krasimir
2009-10-08 13:41:34 +00:00
parent d920a0c53d
commit 0b9c38569c
2 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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 ;