summaryrefslogtreecommitdiff
path: root/transfer/examples/reflexive/English.gf
blob: 73fa00e91a4c558c65026103bf944af5f2d4aaf6 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
concrete English of Abstract = {

lincat 
  S = { s : Str } ;
  V2 = {s : Num => Str} ;
  Conj = {s : Str ; n : Num} ;
  NP = {s : Str ; n : Num; g : Gender} ;

lin
  PredV2 v s o = ss (s.s ++ v.s ! s.n ++ o.s) ;
  ReflV2 v s = ss (s.s ++ v.s ! s.n ++ self ! s.n ! s.g) ;
  -- FIXME: what is the gender of "Mary or Bill"?
  ConjNP c A B = {s = A.s ++ c.s ++ B.s ; n = c.n; g = A.g } ; 
  
  John = pn Masc "John" ;
  Mary = pn Fem "Mary" ;
  Bill = pn Masc "Bill" ;
  See = regV2 "see" ;
  Whip = regV2 "whip" ;

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

param
  Num = Sg | Pl ;
  Gender = Neutr | Masc | Fem ;

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

  self : Num => Gender => Str =
    table {
      Sg => table {
	     Neutr => "itself";
	     Masc  => "himself";
	     Fem   => "herself"
	};
      Pl => \\g => "themselves"
    };

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

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

}