diff options
| author | aarne <aarne@cs.chalmers.se> | 2005-12-06 12:39:36 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2005-12-06 12:39:36 +0000 |
| commit | a6dc94435648dfeeb10a691a1fd6d3ad2f6dd154 (patch) | |
| tree | f09c361d6bdfaa30d8c28206da29702db6debde5 /transfer | |
| parent | 54671579f56112271c9f96783d2e9e8a447e9f51 (diff) | |
opers in cnc
Diffstat (limited to 'transfer')
| -rw-r--r-- | transfer/examples/aggregation/English.gf | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/transfer/examples/aggregation/English.gf b/transfer/examples/aggregation/English.gf index 21da16b23..53199787b 100644 --- a/transfer/examples/aggregation/English.gf +++ b/transfer/examples/aggregation/English.gf @@ -1,18 +1,41 @@ concrete English of Abstract = { -pattern - Pred np vp = np ++ vp ; - ConjS c A B = A ++ c ++ B ; - ConjVP c A B = A ++ c ++ B ; - ConjNP c A B = A ++ c ++ B ; +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 = "John" ; - Mary = "Mary" ; - Bill = "Bill" ; - Walk = "walks" ; - Run = "runs" ; - Swim = "swims" ; - - And = "and" ; - Or = "or" ; + 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} ; + } |
