diff options
| author | bringert <bringert@cs.chalmers.se> | 2006-04-21 21:53:20 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2006-04-21 21:53:20 +0000 |
| commit | 10bf3b1d9fda0cada5fb85c4bb803dfb46714948 (patch) | |
| tree | 42f8749b5c0b2b7d4f94daf38ad0efe50d475ede /examples/peacekeeping/PeaceCatI.gf | |
| parent | 9a51ac6ebf70056c5d74d190aebab032d7a8d4c9 (diff) | |
Moved punctuation to a separate field, to allow spoken language grammars to omit it. Created top-level spoken language grammars. (all in peacekeeping)
Diffstat (limited to 'examples/peacekeeping/PeaceCatI.gf')
| -rw-r--r-- | examples/peacekeeping/PeaceCatI.gf | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/examples/peacekeeping/PeaceCatI.gf b/examples/peacekeeping/PeaceCatI.gf index 9b19b319b..312bc1b1e 100644 --- a/examples/peacekeeping/PeaceCatI.gf +++ b/examples/peacekeeping/PeaceCatI.gf @@ -1,6 +1,22 @@ -incomplete concrete PeaceCatI of PeaceCat = Cat ** open Cat in { +incomplete concrete PeaceCatI of PeaceCat = + Cat ** open Lang, PeaceRes, Prelude in { lincat MassN = N ; + Phrase = { s : Str; p : Punct } ; + PhraseWritten = { s : Str } ; + PhraseSpoken = { s : Str } ; + + lin + Written x = mkWritten x.s x.p ; + Spoken x = { s = x.s } ; + + oper + mkWritten : Str -> Punct -> { s : Str } ; + mkWritten x p = case p of { + FullStop => { s = x ++ "." } ; --TFullStop (ss s) TEmpty ; + QuestMark => { s = x ++ "?" } ; --TQuestMark (ss s) TEmpty ; + ExclMark => { s = x ++ "!" } --TExclMark (ss s) TEmpty + } ; }
\ No newline at end of file |
