-
Notifications
You must be signed in to change notification settings - Fork 9
/
apertium-nno-nob.nob-nno.refsyn.t1x
680 lines (651 loc) · 25.4 KB
/
apertium-nno-nob.nob-nno.refsyn.t1x
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
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
<?xml version="1.0" encoding="utf-8"?>
<transfer>
<!-- This applies the currrent @subj tag to the "ref" side of passive lu's
and strips syntax tags from the tl/sl sides.
To understand what this does, look at the "simple rules" at the end of the file first.
The rules in the beginning handle more exceptional situations
(e.g. subjects to the right of their verbs, or tags spread across det+adj)
-->
<section-def-cats>
<def-cat n="any">
<cat-item tags="*"/>
<cat-item tags=""/>
</def-cat>
<def-cat n="cm">
<cat-item tags="cm"/>
<cat-item tags="cm.*"/>
</def-cat>
<def-cat n="cm-clb">
<cat-item tags="cm.clb"/>
<cat-item tags="cm.clb.*"/>
</def-cat>
<def-cat n="pr">
<cat-item tags="pr"/>
<cat-item tags="pr.*"/>
</def-cat>
<def-cat n="infm">
<cat-item lemma="å" tags="part.*"/>
</def-cat>
<def-cat n="subj">
<cat-item tags="*.@subj"/>
<cat-item tags="*.@subj.*"/>
</def-cat>
<def-cat n="subj_OR_xubj">
<cat-item tags="*.@subj"/>
<cat-item tags="*.@subj.*"/>
<cat-item tags="*.@xubj"/>
<cat-item tags="*.@xubj.*"/>
</def-cat>
<def-cat n="obj_OR_s-pred">
<cat-item tags="*.@obj"/>
<cat-item tags="*.@obj.*"/>
<cat-item tags="*.@s-pred"/>
<cat-item tags="*.@s-pred.*"/>
<cat-item tags="*.@←p-utfyll"/> <!-- Tallet@subjOuter på hvor mange@subjInner som friskmeldes@refInner publiseres@refOuter snart -->
<cat-item tags="*.@←p-utfyll.*"/>
</def-cat>
<def-cat n="adj.un.sp.subj">
<cat-item tags="adj.*.un.sp.*.@subj"/>
<cat-item tags="adj.*.un.sp.*.@subj.*"/>
<cat-item tags="adj.un.sp.*.@subj"/>
<cat-item tags="adj.un.sp.*.@subj.*"/>
<cat-item tags="adj.*.un.sp.*.@xubj"/>
<cat-item tags="adj.*.un.sp.*.@xubj.*"/>
<cat-item tags="adj.un.sp.*.@xubj"/>
<cat-item tags="adj.un.sp.*.@xubj.*"/>
</def-cat>
<def-cat n="adj">
<cat-item tags="adj.*"/>
</def-cat>
<def-cat n="adj.pp">
<cat-item tags="adj.pp.*"/>
</def-cat>
<def-cat n="adj.pp.opred">
<cat-item tags="adj.pp.*.@o-pred"/>
</def-cat>
<def-cat n="lexadj">
<cat-item tags="adj.pst.*"/>
<cat-item tags="adj.comp.*"/>
<cat-item tags="adj.sup.*"/>
<cat-item tags="adj.sint.*"/>
</def-cat>
<def-cat n="n.ind.nonsubj_som_er" c="Specifically for elided-«som er» rule">
<cat-item tags="n.*.ind.*.@obj"/>
<cat-item tags="n.*.ind.*.@i-obj"/>
<cat-item tags="n.*.ind.*.@s-pred"/>
<!-- <cat-item tags="n.*.ind.@adv"/> «Tre personer.pl ble mandag.sg.@adv drept.pl!» -->
<cat-item tags="n.*.ind.*.@←p-utfyll"/>
<cat-item tags="n.*.ind.*.@subst→"/>
<!-- <cat-item tags="n.*.ind.@←subst"/> «antall.sg mottakere.pl.@←subst justert.sg!» -->
<cat-item tags="n.*.ind.*.@laus-np"/>
</def-cat>
<def-cat n="cmp">
<cat-item tags="*.cmp"/>
<cat-item tags="*.cmp.*"/>
<cat-item tags="*.cmp-split"/>
<cat-item tags="*.cmp-split.*"/>
</def-cat>
<def-cat n="fv">
<cat-item tags="*.@fv"/>
<cat-item tags="*.@fv.*"/>
</def-cat>
<def-cat n="cnjcoo">
<cat-item tags="cnjcoo"/>
<cat-item tags="cnjcoo.*"/>
</def-cat>
<def-cat n="cnjsub">
<cat-item tags="cnjsub"/>
<cat-item tags="cnjsub.*"/>
</def-cat>
<def-cat n="adv_OR_detR_OR_cmp">
<cat-item tags="adv"/> <!-- NOT @adv – don't want to match head of adverbial clause here, just lone adverbs -->
<cat-item tags="adv.*"/>
<cat-item tags="*.@det→"/>
<cat-item tags="*.@det→.*"/>
<cat-item tags="*.cmp"/>
</def-cat>
<def-cat n="detR">
<cat-item tags="*.@det→"/>
<cat-item tags="*.@det→.*"/>
</def-cat>
<def-cat n="adjR_OR_cmp">
<cat-item tags="*.@adj→"/>
<cat-item tags="*.@adj→.*"/>
<cat-item tags="adj.*.@adv→"/>
<cat-item tags="adj.*.@adv→.*"/>
<cat-item tags="*.cmp"/>
</def-cat>
<def-cat n="sent">
<cat-item tags="sent.*"/>
<cat-item tags="sent"/>
</def-cat>
<def-cat n="sent_OR_at.clb">
<cat-item tags="sent.*"/>
<cat-item tags="sent"/>
<cat-item lemma="at" tags="cnjcoo.clb"/>
<cat-item lemma="at" tags="cnjcoo.clb.*"/>
<cat-item lemma="og at" tags="cnjcoo.clb"/>
<cat-item lemma="og at" tags="cnjcoo.clb.*"/>
</def-cat>
</section-def-cats>
<section-def-attrs>
<def-attr n="a_syntax">
<attr-item tags="@fv"/>
<attr-item tags="@iv"/>
<attr-item tags="@subj"/>
<attr-item tags="@xubj"/>
<attr-item tags="@obj"/>
<attr-item tags="@i-obj"/>
<attr-item tags="@s-pred"/>
<attr-item tags="@o-pred"/>
<attr-item tags="@adv"/>
<attr-item tags="@adv→"/>
<attr-item tags="@←adv"/>
<attr-item tags="@app"/>
<attr-item tags="@tittel"/>
<attr-item tags="@det→"/>
<attr-item tags="@←det"/>
<attr-item tags="@subst→"/>
<attr-item tags="@←subst"/>
<attr-item tags="@←p-utfyll"/>
<attr-item tags="@interj"/>
<attr-item tags="@adj→"/>
<attr-item tags="@kon"/>
<attr-item tags="@laus-np"/>
<attr-item tags="@←sbu"/>
<attr-item tags="@←sbu-rel"/>
<attr-item tags="@s-gr"/>
</def-attr>
<def-attr n="a_prop">
<attr-item tags="cog"/>
<attr-item tags="ant"/>
<attr-item tags="org"/>
<attr-item tags="top"/>
<attr-item tags="al"/>
<attr-item tags="attr"/>
<attr-item tags="cgguess"/>
<attr-item tags="guess"/>
</def-attr>
<def-attr n="gen">
<attr-item tags="m"/>
<attr-item tags="mf"/>
<attr-item tags="nt"/>
<attr-item tags="f"/>
<attr-item tags="un"/>
<attr-item tags="GD"/>
</def-attr>
<def-attr n="nbr">
<attr-item tags="sg"/>
<attr-item tags="pl"/>
<attr-item tags="sp"/>
<attr-item tags="ND"/>
</def-attr>
<def-attr n="temps">
<attr-item tags="inf"/>
<attr-item tags="imp"/>
<attr-item tags="pres"/>
<attr-item tags="pret"/>
<attr-item tags="pp"/>
</def-attr>
</section-def-attrs>
<section-def-vars>
<def-var n="cur_subj"/>
<def-var n="prev_subj"/>
<def-var n="cur_subj_lexadj"/>
<def-var n="prev_subj_lexadj"/>
<def-var n="lexadj_ref"/>
<def-var n="fv_after_xubj"/>
</section-def-vars>
<section-def-lists>
<def-list n="plural_nouns" c="pp gets plural even though noun is singular">
<list-item v="antall"/>
<list-item v="hundre"/>
<list-item v="tusen"/>
<list-item v="million"/>
<list-item v="milliard"/>
</def-list>
</section-def-lists>
<section-def-macros>
<def-macro n="set_cur_subj" npar="1">
<let><var n="fv_after_xubj"/><lit v=""/></let>
<let><var n="prev_subj"/><var n="cur_subj"/></let>
<let><var n="prev_subj_lexadj"/><var n="cur_subj_lexadj"/></let>
<let><var n="cur_subj"/><clip pos="1" side="tl" part="whole"/></let>
<choose>
<when c="Word changed gender to or from nt, or word is plural">
<test>
<or>
<and>
<not><equal><clip pos="1" side="sl" part="gen"/><clip pos="1" side="tl" part="gen"/></equal></not>
<or>
<equal><clip pos="1" side="sl" part="gen"/><lit-tag v="nt"/></equal>
<equal><clip pos="1" side="tl" part="gen"/><lit-tag v="nt"/></equal>
</or>
</and>
<equal><clip pos="1" side="tl" part="nbr"/><lit-tag v="pl"/></equal>
</or>
</test>
<let><var n="cur_subj_lexadj"/><var n="cur_subj"/></let>
</when>
<otherwise>
<let><var n="cur_subj_lexadj"/><lit v=""/></let>
</otherwise>
</choose>
</def-macro>
</section-def-macros>
<section-rules>
<!-- ***** Exceptional rules first: subjects after verbs + relative clause/subordination subjects ***** -->
<!-- SHIFTING RULES (postsubj: use a following subject) -->
<rule c="«selges kuene» – handle a following (non-relative) subject">
<pattern>
<pattern-item n="fv"/>
<pattern-item n="subj"/>
</pattern>
<action>
<call-macro n="set_cur_subj"><with-param pos="2"/></call-macro>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/><lit-tag v="postsubj"/> <!-- notify t1x that we can place participle after a subject -->
</lu>
</out>
<reject-current-rule shifting="yes"/> <!-- only output first pattern, then move one word -->
</action>
</rule>
<rule c="«selges nok kuene» – handle a following subject with intervening adv/det/cmp">
<pattern>
<pattern-item n="fv"/>
<pattern-item n="adv_OR_detR_OR_cmp"/>
<pattern-item n="subj"/>
</pattern>
<action>
<call-macro n="set_cur_subj"><with-param pos="3"/></call-macro>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/><lit-tag v="postsubj"/> <!-- notify t1x that we can place participle after a subject -->
</lu>
</out>
<reject-current-rule shifting="yes"/> <!-- only output first pattern, then move one word -->
</action>
</rule>
<rule c="«selges de fine kuene» – handle a following subject with intervening det+adj">
<pattern>
<pattern-item n="fv"/>
<pattern-item n="detR"/>
<pattern-item n="adjR_OR_cmp"/>
<pattern-item n="subj"/>
</pattern>
<action>
<call-macro n="set_cur_subj"><with-param pos="4"/></call-macro>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/><lit-tag v="postsubj"/> <!-- notify t1x that we can place participle after a subject -->
</lu>
</out>
<reject-current-rule shifting="yes"/> <!-- only output first pattern, then move one word -->
</action>
</rule>
<rule c="«selges de mest omstridte kuene» – handle a following subject with intervening det+adj">
<pattern>
<pattern-item n="fv"/>
<pattern-item n="detR"/>
<pattern-item n="adjR_OR_cmp"/>
<pattern-item n="adjR_OR_cmp"/>
<pattern-item n="subj"/>
</pattern>
<action>
<call-macro n="set_cur_subj"><with-param pos="5"/></call-macro>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/><lit-tag v="postsubj"/> <!-- notify t1x that we can place participle after a subject -->
</lu>
</out>
<reject-current-rule shifting="yes"/> <!-- only output first pattern, then move one word -->
</action>
</rule>
<!-- /SHIFTING RULES -->
<rule c="Ungendered adjective-subject takes gender/number from preceding determiner
«Den første beskrives som …»
«Da må tjenester til barn og unge være de siste som skaleres ned eller stenges.»
">
<pattern>
<pattern-item n="detR"/>
<pattern-item n="adj.un.sp.subj"/>
</pattern>
<action>
<call-macro n="set_cur_subj"><with-param pos="1"/></call-macro>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<let><clip pos="2" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="2" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="ref" part="whole"/>
</lu>
<b/>
<lu>
<clip pos="2" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="2" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/>
</lu>
</out>
</action>
</rule>
<rule c="Nominal adjective keeps gender/number (ignore preceding subject)
«10.700 sysselsatte»">
<pattern>
<pattern-item n="detR"/>
<pattern-item n="adj.pp"/>
</pattern>
<action>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<let><clip pos="2" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="2" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/>
</lu>
<b/>
<lu>
<clip pos="2" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="2" side="tl" part="whole"/>
<lit v="/"/>
<clip pos="2" side="ref" part="whole"/>
</lu>
</out>
</action>
</rule>
<rule c="Nominal adjective keeps gender/number (ignore preceding subject)
«de blåkledde»">
<pattern>
<pattern-item n="detR"/>
<pattern-item n="cmp"/>
<pattern-item n="adj.pp"/>
</pattern>
<action>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<let><clip pos="2" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="2" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<let><clip pos="3" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="3" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/>
</lu>
<b/>
<lu>
<clip pos="2" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="2" side="tl" part="whole"/>
<lit v="/"/>
<clip pos="2" side="ref" part="whole"/>
</lu>
<b/>
<lu>
<clip pos="3" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="3" side="tl" part="whole"/>
<lit v="/"/>
<clip pos="3" side="ref" part="whole"/>
</lu>
</out>
</action>
</rule>
<rule c="NIND.NONSUBJ ADJPP.OPRED (elided «som er»)
This rule assumes there's a hidden «som er» between noun and participle.
«Dette kommer fram i en rapport.n.ind utarbeidet.adj.pp av FHI»
If this rule doesn't hit, ensure the adj.pp gets tagged @o-pred by nob.syn.rlx!">
<pattern>
<pattern-item n="n.ind.nonsubj_som_er"/>
<pattern-item n="adj.pp.opred"/>
</pattern>
<action>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<let><clip pos="2" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="2" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
</lu>
<b/>
</out>
<choose><when c="antall drepte; tusen arresterte">
<test><in><clip pos="1" side="sl" part="lemh"/><list n="plural_nouns"/></in></test>
<let><clip pos="1" side="tl" part="nbr"/><lit-tag v="pl"/></let>
</when></choose>
<out>
<lu>
<clip pos="2" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="2" side="tl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
</lu>
</out>
</action>
</rule>
<rule c="«uforsvarlig å» – nt when agreeing with infinitive-clause
Both lexical and pp.">
<pattern>
<pattern-item n="adj"/>
<pattern-item n="infm"/>
</pattern>
<action>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<let><clip pos="2" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="2" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<clip pos="2" side="tl" part="whole"/>
</lu>
<b/>
<lu>
<clip pos="2" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="2" side="tl" part="whole"/>
<lit v="/"/>
<clip pos="2" side="tl" part="whole"/>
</lu>
</out>
</action>
</rule>
<!-- ***** The simple rules: Store, Clear, Apply ***** -->
<rule c="Found a subject, store it in variable">
<pattern>
<pattern-item n="subj_OR_xubj"/>
</pattern>
<action>
<call-macro n="set_cur_subj"><with-param pos="1"/></call-macro>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/>
</lu>
</out>
</action>
</rule>
<rule c="Clear the prev- and current-subject variables on sentence end or ‘that’">
<pattern>
<pattern-item n="sent_OR_at.clb"/>
</pattern>
<action>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/>
</lu>
</out>
<let><var n="prev_subj"/><lit v=""/></let>
<let><var n="cur_subj"/><lit v=""/></let>
<let><var n="prev_subj_lexadj"/><lit v=""/></let>
<let><var n="cur_subj_lexadj"/><lit v=""/></let>
<let><var n="fv_after_xubj"/><lit v=""/></let>
</action>
</rule>
<!-- TODO: also switch on seeing «og som», as in «plattformen som de fire partiene forhandlet frem, og som ble godkjent» -->
<rule c="Switch to prev subject variable on clause boundary comma. Unconditionally skips to next rule without outputting.">
<pattern>
<pattern-item n="cm-clb"/>
</pattern>
<action>
<choose><when>
<test><not><equal><var n="prev_subj"/><lit v=""/></equal></not></test>
<let><var n="cur_subj"/><var n="prev_subj"/></let>
<let><var n="cur_subj_lexadj"/><var n="prev_subj_lexadj"/></let>
<let><var n="prev_subj"/><lit v=""/></let>
<let><var n="prev_subj_lexadj"/><lit v=""/></let>
<let><var n="fv_after_xubj"/><lit v=""/></let>
</when></choose>
<reject-current-rule shifting="0"/>
</action>
</rule>
<rule c="Switch to prev subject variable on second finite verb if cur is @xubj. Unconditionally skips to next rule without outputting.">
<pattern>
<pattern-item n="fv"/>
</pattern>
<action>
<choose>
<when c="Seeing the first finite verb after an @xubj, set fv_after_xubj to 'seen'">
<test><and>
<not><equal><var n="fv_after_xubj"/><lit v="seen"/></equal></not>
<ends-with><var n="cur_subj"/><lit-tag v="@xubj"/></ends-with>
</and></test>
<let><var n="fv_after_xubj"/><lit v="seen"/></let>
</when>
<when c="Seeing the second finite verb after an @xubj, switch to previous subject and clear fv_after_xubj">
<test><and>
<equal><var n="fv_after_xubj"/><lit v="seen"/></equal>
<ends-with><var n="cur_subj"/><lit-tag v="@xubj"/></ends-with>
</and></test>
<let><var n="fv_after_xubj"/><lit v=""/></let>
<let><var n="cur_subj"/><var n="prev_subj"/></let>
<let><var n="cur_subj_lexadj"/><var n="prev_subj_lexadj"/></let>
<let><var n="prev_subj"/><lit v=""/></let>
<let><var n="prev_subj_lexadj"/><lit v=""/></let>
</when></choose>
<reject-current-rule shifting="0"/>
</action>
</rule>
<rule c="«og som»: Override switching back to prev subject variable / require another fv before switching back. Unconditionally skips to next rule without outputting.">
<pattern>
<pattern-item n="cnjcoo"/>
<pattern-item n="cnjsub"/>
</pattern>
<action>
<choose><when>
<test><equal><var n="fv_after_xubj"/><lit v="seen"/></equal></test>
<let><var n="fv_after_xubj"/><lit v=""/></let>
</when></choose>
<reject-current-rule shifting="0"/>
</action>
</rule>
<rule c="Lexical/non-pp adj special handling: Only add ref (only agree) if @s-pred and subject gender changed to/from nt or number is pl:
Ie. not for adverbial usage like
- Tallene er sterkt@adv dominert
- Det vi har fått til teknologisk">
<pattern>
<pattern-item n="lexadj"/>
</pattern>
<action>
<choose>
<when c="We only want refsyn if predicative, otherwise ensure it's empty since this is a lexical adjective.">
<test><equal><clip pos="1" side="tl" part="a_syntax"/><lit-tag v="@s-pred"/></equal></test>
<let><var n="lexadj_ref"/><var n="cur_subj_lexadj"/></let>
</when>
<otherwise>
<let><var n="lexadj_ref"/><lit v=""/></let>
</otherwise>
</choose>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="lexadj_ref"/>
</lu>
</out>
</action>
</rule>
<rule c="Add the current subject to the ref field of the lexical unit, clear syntax tags">
<pattern>
<pattern-item n="any"/>
</pattern>
<action>
<let><clip pos="1" side="tl" part="a_syntax"/><lit v=""/></let>
<let><clip pos="1" side="sl" part="a_syntax"/><lit v=""/></let> <!-- preprocess-transfer gives a mistaken warning – this does have effect -->
<out>
<lu>
<clip pos="1" side="sl" part="whole"/>
<lit v="/"/>
<clip pos="1" side="tl" part="whole"/>
<lit v="/"/>
<var n="cur_subj"/>
</lu>
</out>
</action>
</rule>
</section-rules>
</transfer>