-
Notifications
You must be signed in to change notification settings - Fork 0
/
sva.rm
85 lines (80 loc) · 1.47 KB
/
sva.rm
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "eng.rm"
#include "util.rm"
// this is a demonstration of subject-verb agreement using non-local binding
import cap from util;
import noun_singular,noun_plural from eng;
import verb_trans_past,verb_intrans_past from eng;
top: cap[s] "\n";
s: clause ".";
_: " ";
clause: (person=) (number=) np["subject"] _ vp["trans"|"intrans"];
np[sense]:
(^number="1"|"2") (
(^person="3") util.an[art _ noun] |
(^person="1"|"2"|"3") pronoun[sense]
)
(paren|2);
paren:
" (who " (person=) (number=) np["subject"] _ v["trans"] ")";
noun:
number >(
"1" % noun_singular
"2" % noun_plural
);
art:
number >(
"1" % ("a"|"the")
"2" % "the"
);
pronoun[sense]:
sense >(
"subject" % subj_pronoun
"object" % obj_pronoun
);
subj_pronoun:
number >(
"1" % (person >(
"1" % ("I")
"2" % ("you")
"3" % ("he"|"she"|"it"))
) "2" % (person >(
"1" % ("we")
"2" % ("you")
"3" % ("they"))
)
);
obj_pronoun:
number >(
"1" % (person >(
"1" % ("me")
"2" % ("you")
"3" % ("him"|"her"|"it"))
) "2" % (person >(
"1" % ("us")
"2" % ("you")
"3" % ("them"))
)
);
v[trans]:
tohave _ trans >(
"intrans" % verb_intrans_past
"trans" % verb_trans_past
);
vp[trans]:
v[trans] (
trans >(
"trans" % (_ np["object"])
)
);
tohave:
number >(
"1" % (person >(
"1" % "have"
"2" % "have"
"3" % "has")
) "2" % (person >(
"1" % "have"
"2" % "have"
"3" % "have")
)
);