-
Notifications
You must be signed in to change notification settings - Fork 5
/
mtr.tdl
104 lines (83 loc) · 2.35 KB
/
mtr.tdl
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
;;; Hey, emacs(1), this is -*- Mode: TDL; Package: LKB; -*- got it?
;;;
;;; first shot of minimal type hierarchy for paraphrasing transfer rules.
;;;
;;;
;;; minimal hierarchy of variable types, using the new (R)MRS naming scheme.
;;;
u := *top* & [ SCRATCH scratch ].
h := u.
i := u.
e := i.
x := i.
;;;
;;; to check for `arity' in MTRs, maybe we need an `anti-'variable type
;;;
a := u.
;;;
;;; the scratch slot in variables: used during transfer to control application
;;; of rules, e.g. the rules that introduce selected preposition EPs in the ERG
;;; accomodation phase which would otherwise be cyclic, i.e. the rule would
;;; fire on its own output (since it does not consume anything).
;;;
scratch := *top*.
test := scratch.
complete := scratch.
flags := *top* &
[ OPTIONAL luk,
EQUAL list,
SUBSUME list,
TRIGGER string ].
mrs_transfer_rule := *top* &
[ FILTER mrs,
CONTEXT mrs,
INPUT mrs,
OUTPUT mrs,
FLAGS flags ].
generator_rule := mrs_transfer_rule &
[ INPUT.RELS <! !> ].
monotonic_mtr := mrs_transfer_rule &
[ CONTEXT.HOOK [ LTOP #h, INDEX #i ],
INPUT.HOOK [ LTOP #h, INDEX #i ],
OUTPUT.HOOK [ LTOP #h, INDEX #i ] ].
monotonic_omtr := monotonic_mtr & optional_mtr.
optional_mtr := mrs_transfer_rule &
[ FLAGS.OPTIONAL + ].
;;;
;;; a few `special-purpose' types, transfer operators in a sense
;;;
+upcase+ := string.
+downcase+ := string.
;;;
;;; general rule types
;;;
arg0e_gr := generator_rule &
[ CONTEXT [ RELS <! [ ARG0 #e & event ] !> ],
FLAGS.EQUAL < #e > ].
arg0e-1x_gr := generator_rule &
[ CONTEXT [ RELS <! [ ARG0 #e & event, ARG1 #i ] !> ],
FLAGS.EQUAL < #e, #i > ].
arg0e-2x_gr := generator_rule &
[ CONTEXT [ RELS <! [ ARG0 #e & event, ARG2 #i ] !> ],
FLAGS.EQUAL < #e, #i > ].
arg0e-3x_gr := generator_rule &
[ CONTEXT [ RELS <! [ ARG0 #e & event, ARG3 #i ] !> ],
FLAGS.EQUAL < #e, #i > ].
;;;
;;; Idiom Implementation (CH 060804)
;;;
np_v_idiom_mtr := monotonic_mtr &
[ INPUT.RELS <! [ LBL handle,
ARG0 event,
ARG1 ref-ind,
ARG2 ref-ind & #arg2 ],
[ LBL handle,
ARG0 #arg2 ] !>,
OUTPUT.RELS <! !> ].
np_a_idiom_mtr := monotonic_mtr &
[ INPUT.RELS <! [ LBL handle,
ARG0 event,
ARG1 ref-ind & #arg1 ],
[ LBL handle,
ARG0 #arg1 ] !>,
OUTPUT.RELS <! !> ].