diff options
| author | john.j.camilleri <john.j.camilleri@chalmers.se> | 2013-09-16 07:17:27 +0000 |
|---|---|---|
| committer | john.j.camilleri <john.j.camilleri@chalmers.se> | 2013-09-16 07:17:27 +0000 |
| commit | f5461eb3d4eb2605b546a4ed202c12bcdaa1f4e4 (patch) | |
| tree | 946c9e8542b8e8271b6b529a95c0400fa6613cb4 /examples/trigram/Trigram.gf | |
| parent | 8e1c6cca407c82fc09569d80c231b8d256735989 (diff) | |
Remove contribs and examples
Everything has now been moved to a separate repository at
https://github.com/GrammaticalFramework/gf-contrib
The contents of the examples folder are build during SetupWeb
Diffstat (limited to 'examples/trigram/Trigram.gf')
| -rw-r--r-- | examples/trigram/Trigram.gf | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/examples/trigram/Trigram.gf b/examples/trigram/Trigram.gf deleted file mode 100644 index 0ad99b0bf..000000000 --- a/examples/trigram/Trigram.gf +++ /dev/null @@ -1,39 +0,0 @@ -abstract Trigram = { - -cat - -- A sentence - S ; - - -- A lexicon is a set of 'Word's - Word ; - - -- All N-gram instances seen in the corpus are abstract syntax constants - Unigram (a : Word) ; - Bigram (a,b : Word) ; - Trigram (a,b,c : Word) ; - - -- A text is a sequence words where the sequence is indexed by the last two tokens - Seq (a,b : Word) ; - - -- The estimated probability of the trigram 'a b c' is the total probability of all - -- trees of type Prob a b c. - 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 - nil : (a,b,c : Word) -> Prob a b c -> Seq b c ; - cons : ({a,b} : Word) -> Seq a b -> (c : Word) -> Prob a b c -> Seq b c ; - - -- Here we construct probabilities. There are two ways: by trigrams, by bigrams and - -- by unigrams. Since the trigramP, bigramP, unigramP functions have some associated - -- probabilities as well this results in linear smoothing between the unigram, bigram - -- and trigram models - trigramP : ({a,b,c} : Word) -> Trigram a b c -> Prob a b c ; - bigramP : ({a,b,c} : Word) -> Bigram a b -> Bigram b c -> Prob a b c ; - unigramP : ({a,b,c} : Word) -> Unigram a -> Unigram b -> Unigram c -> Prob a b c ; - -}
\ No newline at end of file |
