1
0
forked from GitHub/gf-core
Files
gf-core/transfer/examples/aggregation/English.gf
2005-12-06 12:39:36 +00:00

42 lines
754 B
Plaintext

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} ;
}