summaryrefslogtreecommitdiff
path: root/transfer/examples/aggregation/English.gf
blob: 53199787bbd266501409e199bf9518e05e9a6800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
concrete English of Abstract = {

lincat 
  VP = {s : Num => Str} ;
  NP, Conj = {s : Str ; n : Num} ;

lin
  Pred np vp = ss (np.s ++ vp.s ! np.n) ;
  ConjS c A  B = ss (A.s ++ c.s ++ B.s) ;
  ConjVP c A  B = {s = \\n => A.s ! n ++ c.s ++ B.s ! n} ;
  ConjNP c A  B = {s = A.s ++ c.s ++ B.s ; n = c.n} ;
  
  John = pn "John" ;
  Mary = pn "Mary" ;
  Bill = pn "Bill" ;
  Walk = vp "walk" ;
  Run  = vp "run" ;
  Swim = vp "swim" ;

  And = {s = "and" ; n = Pl} ;
  Or = pn "or" ;

param
  Num = Sg | Pl ;

oper
  vp : Str -> {s : Num => Str} = \run -> {
    s = table {
      Sg => run + "s" ;
      Pl => run
      }
    } ;

  pn : Str -> {s : Str ; n : Num} = \bob -> {
    s = bob ;
    n = Sg
    } ;

  ss : Str -> {s : Str} = \s -> {s = s} ;

}