summaryrefslogtreecommitdiff
path: root/examples/regulus/toy0/no-resource/Toy0Eng.gf
blob: 977fb09c544840fc617283249ed47e84214f4900 (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
concrete Toy0Eng of Toy0 = {

param
  Number = Sg | Pl ;

lincat
  Spec = {s : Str ; n : Number} ;
  Noun = {s : Number => Str} ;
  NP = {s : Str} ;

lin
  SpecNoun spec noun = {s = spec.s ++ noun.s ! spec.n} ;

  One = {s = "one" ; n = Sg} ;
  Two = {s = "two" ; n = Pl} ;

  Felis = regNoun "cat" ;
  Canis = regNoun "dog" ;

oper
  regNoun : Str -> {s : Number => Str} = \s -> {
    s = table {
      Sg => s ;
      Pl => s + "s"
      }
    } ;
}