summaryrefslogtreecommitdiff
path: root/examples/peacekeeping/PeaceCatI.gf
blob: 312bc1b1e2711d21d5dc02ad23bb1d279b2d5a3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 
    } ;

}