forked from GitHub/gf-core
opers in cnc
This commit is contained in:
@@ -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 ;
|
||||
|
||||
John = "John" ;
|
||||
Mary = "Mary" ;
|
||||
Bill = "Bill" ;
|
||||
Walk = "walks" ;
|
||||
Run = "runs" ;
|
||||
Swim = "swims" ;
|
||||
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} ;
|
||||
|
||||
And = "and" ;
|
||||
Or = "or" ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user