|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
def change_str_to_gen(argument):
arg_type, attributes_strs = get_arg_parts(argument.text_rep)
attributes_strs = ['gen' if attr_str=='str' else attr_str for attr_str in attributes_strs]
arg_obj = parse_argument_parts(arg_type, attributes_strs) #arg_data_to_arg(arg_model, attributes_strs)
return arg_obj
def verb_to_noun_conversion(frame):
frame_realizations = [frame_to_rule_format(frame)]
# subj{np(str)} + obj{np(str)} ==> {np(gen)} -- zarówno z subj, jak i z obj
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': None},
{'from': ur'^obj\{np\(str\)\}$', 'to': ur'{np(gen)}'}], frame_realizations)
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{np(gen)}'},
{'from': ur'^obj\{np\(str\)\}$', 'to': None}], frame_realizations)
# subj{np(str)} + obj{ncp(str,int)} ==> {ncp(gen,int)} -- zarówno z subj, jak i z obj
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': None},
{'from': ur'^obj\{ncp\(str,int(.*)\)\}$', 'to': ur'{ncp(gen,int[.*])}'}], frame_realizations)
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{ncp(gen,int[.*])}'},
{'from': ur'^obj\{ncp\(str,int(.*)\)\}$', 'to': None}], frame_realizations)
# subj{np(str)} + obj{ncp(str,że)} ==> {ncp(gen,że)} -- zarówno z subj, jak i z obj
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': None},
{'from': ur'^obj\{ncp\(str,że\)\}$', 'to': ur'{ncp(gen,że)}'}], frame_realizations)
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{ncp(gen,że)}'},
{'from': ur'^obj\{ncp\(str,że\)\}$', 'to': None}], frame_realizations)
# subj{np(str)} + obj{ncp(str,żeby)} ==> {ncp(gen,żeby)} -- zarówno z subj, jak i z obj
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': None},
{'from': ur'^obj\{ncp\(str,żeby\)\}$', 'to': ur'{ncp(gen,żeby)}'}], frame_realizations)
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{ncp(gen,żeby)}'},
{'from': ur'^obj\{ncp\(str,żeby\)\}$', 'to': None}], frame_realizations)
# subj{np(str)} + obj{np(str)} ==> {possp} + {prepnp(dla,gen)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{np\(str\)\}$', 'to': ur'{prepnp(dla,gen)}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,że)} ==> {possp} + {prepncp(dla,gen,że)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,że\)\}$', 'to': ur'{prepncp(dla,gen,że)}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,int)} ==> {possp} + {prepncp(dla,gen,int)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,int(.*)\)\}$', 'to': ur'{prepncp(dla,gen,int[.*])}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,żeby)} ==> {possp} + {prepncp(dla,gen,żeby)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,żeby\)\}$', 'to': ur'{prepncp(dla,gen,żeby)}'}], frame_realizations)
# subj{np(str)} + obj{np(str)} ==> {possp} + {prepnp(o,loc)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{np\(str\)\}$', 'to': ur'{prepnp(o,loc)}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,int)} ==> {possp} + {prepncp(o,loc,int)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,int(.*)\)\}$', 'to': ur'{prepncp(o,loc,int[.*])}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,że)} ==> {possp} + {prepncp(o,loc,że)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,że\)\}$', 'to': ur'{prepncp(o,loc,że)}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,żeby)} ==> {possp} + {prepncp(o,loc,żeby)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,żeby\)\}$', 'to': ur'{prepncp(o,loc,żeby)}'}], frame_realizations)
# subj{np(str)} + obj{np(str)} ==> {possp} + {prepnp(na,acc)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{np\(str\)\}$', 'to': ur'{prepnp(na,acc)}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,int)} ==> {possp} + {prepncp(na,acc,int)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,int(.*)\)\}$', 'to': ur'{prepncp(na,acc,int[.*])}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,że)} ==> {possp} + {prepncp(na,acc,że)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,że\)\}$', 'to': ur'{prepncp(na,acc,że)}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,żeby)} ==> {possp} + {prepncp(na,acc,żeby)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,żeby\)\}$', 'to': ur'{prepncp(na,acc,żeby)}'}], frame_realizations)
# subj{np(str)} + obj{np(str)} ==> {possp} + {prepnp(na,loc)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{np\(str\)\}$', 'to': ur'{prepnp(na,loc)}'}], frame_realizations)
# subj{np(str)} + obj{np(str)} ==> {possp} + {prepnp(nad,inst)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{np\(str\)\}$', 'to': ur'{prepnp(nad,inst)}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,int)} ==> {possp} + {prepncp(nad,inst,int)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,int(.*)\)\}$', 'to': ur'{prepncp(nad,inst,int[.*])}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,że)} ==> {possp} + {prepncp(nad,inst,że)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,że\)\}$', 'to': ur'{prepncp(nad,inst,że)}'}], frame_realizations)
# subj{np(str)} + obj{ncp(str,żeby)} ==> {possp} + {prepncp(nad,inst,żeby)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(str,żeby\)\}$', 'to': ur'{prepncp(nad,inst,żeby)}'}], frame_realizations)
# subj{np(str)} + {np(dat)} ==> {possp} + {prepnp(dla,gen)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^\{np\(dat\)\}$', 'to': ur'{prepnp(dla,gen)}'}], frame_realizations)
# subj{np(str)} + {ncp(dat,int))} ==> {possp} + {prepncp(dla,gen,int)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^\{ncp\(dat,int(.*)\)\}$', 'to': ur'{prepncp(dla,gen,int[.*])}'}], frame_realizations)
# subj{np(str)} + {np(gen)} ==> {possp} + {prepnp(na,acc)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^\{np\(gen\)\}$', 'to': ur'{prepnp(na,acc)}'}], frame_realizations)
# subj{np(str)} + {ncp(gen,int)} ==> {possp} + {prepncp(na,acc,int)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^\{ncp\(gen,int(.*)\)\}$', 'to': ur'{prepncp(na,acc,int[.*])}'}], frame_realizations)
# subj{np(str)} + {ncp(gen,że)} ==> {possp} + {prepncp(na,acc,że)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^\{ncp\(gen,że\)\}$', 'to': ur'{prepncp(na,acc,że)}'}], frame_realizations)
# subj{np(str)} + {ncp(gen,żeby)} ==> {possp} + {prepnp(na,acc,żeby)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^\{ncp\(gen,żeby\)\}$', 'to': ur'{prepnp(na,acc,żeby)}'}], frame_realizations)
# subj{np(str)} + obj{np(inst)} ==> {possp} + {np(inst)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{np\(inst\)\}$', 'to': ur'{np(inst)}'}], frame_realizations)
# subj{np(str)} + obj{np(inst)} ==> {possp} + {prepnp(nad,inst)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{np\(inst\)\}$', 'to': ur'{prepnp(nad,inst)}'}], frame_realizations)
# subj{np(str)} + obj{ncp(inst,int)} ==> {possp} + {prepncp(nad,inst,int)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^obj\{ncp\(inst,int(.*)\)\}$', 'to': ur'{prepncp(nad,inst,int[.*])}'}], frame_realizations)
# subj{np(str)} + {prepnp(z,gen)} (się) ==> {possp} + {prepnp(z,gen)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{possp}'},
{'from': ur'^\{prepnp\(z,gen\)\}$', 'to': ur'{prepnp(z,gen)}'}], frame_realizations)
# subj{np(str)} + {prepnp(z,gen)} (się) ==> new_position{prepnp(między,inst)}
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': None},
{'from': ur'^\{prepnp\(z,gen\)\}$', 'to': None}],
frame_realizations, position_to_add=[ur'{prepnp(między,inst)}'])
return frame_realizations
def verb_to_adj_conversion(frame):
frame_realizations = [frame_to_rule_format(frame)]
# subj{np(str)} + obj{np(str)} ==> {prepnp(dla,gen)} -- z subj
convert([{'from': ur'^subj\{np\(str\)\}$', 'to': ur'{prepnp(dla,gen)}'},
{'from': ur'^obj\{np\(str\)\}$', 'to': None}], frame_realizations)
return frame_realizations
|