File: apertium-nno-nob.nob-nno.t2x

package info (click to toggle)
apertium-nno-nob 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 78,936 kB
  • sloc: xml: 3,028; sh: 381; makefile: 339; awk: 55; python: 17
file content (3908 lines) | stat: -rw-r--r-- 165,106 bytes parent folder | download
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
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
<?xml version="1.0" encoding="UTF-8"?>
<!-- -*- nxml -*- -->
<!-- TODO:
     * stop using GD, just check whether the determiner (or whatever) has some gender already
-->
<interchunk>

  <section-def-cats>
    <def-cat n="unknown">
      <cat-item tags="unknown"/>
    </def-cat>
    <def-cat n="any">
      <cat-item tags="*"/>
    </def-cat>
    <def-cat n="np">
      <cat-item tags="np.*"/>
    </def-cat>
    <def-cat n="np_prnnom_og">
      <cat-item tags="np.*"/>
      <cat-item tags="prn.*.nom"/>
      <cat-item tags="prn.*.nom.*"/>
      <cat-item lemma="og" tags="cnjcoo.clb"/>
      <cat-item lemma="og" tags="cnjcoo"/>
    </def-cat>
    <def-cat n="nom">
      <cat-item tags="n.*"/>
      <cat-item tags="np.*"/>
    </def-cat>
    <def-cat n="nom_advnom">
      <cat-item tags="n.*"/>
      <cat-item tags="np.*"/>
      <cat-item tags="adv.n.*"/>
    </def-cat>
    <def-cat n="nind">
      <cat-item tags="n.*.ind"/>
      <cat-item tags="n.*.ind.*"/>
    </def-cat>
    <def-cat n="nsplit">
      <cat-item tags="n.*.cmp-split"/>
      <cat-item tags="n.*.cmp-split.*"/>
    </def-cat>
    <def-cat n="nind_nogen">
      <cat-item tags="n.*.ind"/>
      <cat-item tags="n.*.ind.sl-nt"/>
      <cat-item tags="n.*.ind.sl-m"/>
      <cat-item tags="n.*.ind.sl-mf"/>
      <cat-item tags="n.*.ind.sl-f"/>
      <cat-item tags="n.*.ind.sl-nt.*"/>
      <cat-item tags="n.*.ind.sl-m.*"/>
      <cat-item tags="n.*.ind.sl-mf.*"/>
      <cat-item tags="n.*.ind.sl-f.*"/>
    </def-cat>
    <def-cat n="keepsin_nind">
      <cat-item tags="n.*.ind.keep-sin"/>
      <cat-item tags="n.*.ind.keep-sin.*"/>
      <cat-item tags="n.*.ind.*.keep-sin"/>
      <cat-item tags="n.*.ind.*.keep-sin.*"/>
    </def-cat>
    <def-cat n="nind_noadj">
      <cat-item lemma="nn" tags="n.*.ind"/>
      <cat-item lemma="nn" tags="n.*.ind.*"/>
      <cat-item lemma="n_n" tags="n.*.ind"/>   <!-- Sogn tingrett -->
      <cat-item lemma="cmp_n" tags="n.*.ind"/> <!-- kaffetingrett -->
      <cat-item lemma="cmp_n" tags="n.*.ind.*"/>
      <cat-item lemma="cmp_cmp_n" tags="n.*.ind"/>
      <cat-item lemma="cmp_cmp_n" tags="n.*.ind.*"/>
      <cat-item lemma="cmp_cmp_cmp_n" tags="n.*.ind"/>
      <cat-item lemma="cmp_cmp_cmp_n" tags="n.*.ind.*"/>
    </def-cat>
    <def-cat n="nplind">
      <cat-item tags="n.*.pl.ind"/>
      <cat-item tags="n.*.pl.ind.*"/>
    </def-cat>
    <def-cat n="nkeepgenx">
      <cat-item tags="n.*.keepgenx"/>
      <cat-item tags="n.*.keepgenx.*"/>
    </def-cat>
    <def-cat n="ndef">
      <cat-item tags="n.*.def"/>
      <cat-item tags="n.*.def.*"/>
    </def-cat>
    <def-cat n="ncmpsplit">
      <cat-item tags="n.*.ind.cmp-split"/>
      <cat-item tags="n.*.ind.cmp-split.*"/>
    </def-cat>
    <def-cat n="ndef_OR_np_agent">
      <cat-item tags="n.*.def"/>
      <cat-item tags="n.*.def.*"/>
      <cat-item tags="np.ant"/>
      <cat-item tags="np.ant.*"/>
      <cat-item tags="np.cog"/>
      <cat-item tags="np.cog.*"/>
      <cat-item tags="np.org"/>
      <cat-item tags="np.org.*"/>
      <cat-item tags="unknown"/>
    </def-cat>
    <def-cat n="n_OR_np_subj">
      <cat-item tags="*.@subj"/>
      <cat-item tags="*.@xubj"/>
      <cat-item tags="*.@subj.*"/>
      <cat-item tags="*.@xubj.*"/>
      <cat-item tags="unknown"/>
    </def-cat>
    <def-cat n="np_pers">
      <cat-item tags="np.ant"/>
      <cat-item tags="np.cog"/>
      <cat-item tags="np.ant.*"/>
      <cat-item tags="np.cog.*"/>
      <cat-item tags="unknown"/>
    </def-cat>
    <def-cat n="np_nonorg">
      <cat-item tags="np.ant"/>
      <cat-item tags="np.cog"/>
      <cat-item tags="np.top"/> <!-- so many toponyms allowed as cognomens -->
      <cat-item tags="np.ant.*"/>
      <cat-item tags="np.cog.*"/>
      <cat-item tags="np.top.*"/>
      <cat-item tags="unknown"/>
    </def-cat>
    <def-cat n="prep_gen">
      <cat-item lemma="gen-prep" tags="pr"/>
      <cat-item lemma="gen-prep" tags="det.*"/>
    </def-cat>
    <def-cat n="ngen">
      <cat-item tags="n.*.gen"/>
      <cat-item tags="n.*.gen.*"/>
      <cat-item tags="np.*.gen"/>
      <cat-item tags="np.*.gen.*"/>
    </def-cat>
    <def-cat n="nxgen">
      <cat-item tags="n.xpst.*.gen"/>
      <cat-item tags="n.xpsto.*.gen"/>
      <cat-item tags="n.xpsts.*.gen"/>
      <cat-item tags="n.xcomp.*.gen"/>
      <cat-item tags="n.xsup.*.gen"/>
      <cat-item tags="n.xpst.*.gen.*"/>
      <cat-item tags="n.xpsto.*.gen.*"/>
      <cat-item tags="n.xpsts.*.gen.*"/>
      <cat-item tags="n.xcomp.*.gen.*"/>
      <cat-item tags="n.xsup.*.gen.*"/>
    </def-cat>
    <def-cat n="ngendefORpl">
      <cat-item tags="n.*.def.gen"/>
      <cat-item tags="n.*.def.gen.*"/>
      <cat-item tags="n.*.pl.*.gen"/>
      <cat-item tags="n.*.pl.*.gen.*"/>
      <cat-item tags="n.*.sp.*.gen"/>
      <cat-item tags="n.*.sp.*.gen.*"/>
    </def-cat>
    <def-cat n="ngensgdef">
      <cat-item tags="n.*.sg.def.gen"/>
      <cat-item tags="n.*.sg.def.gen.*"/>
    </def-cat>
    <def-cat n="npldef">
      <cat-item tags="n.*.pl.def"/>
      <cat-item tags="n.*.pl.def.*"/>
      <cat-item tags="n.*.sp.def"/>
      <cat-item tags="n.*.sp.def.*"/>
    </def-cat>
    <def-cat n="detgen">
      <cat-item tags="det.*.gen"/>
      <cat-item tags="det.*.gen.*"/>
    </def-cat>
    <def-cat n="detind">
      <cat-item tags="det.*.ind"/>
      <cat-item tags="det.*.ind.*"/>
      <cat-item tags="det.*.sg"/>
      <cat-item tags="det.*.sg.*"/>
    </def-cat>
    <def-cat n="det">
      <cat-item tags="det.*"/>
    </def-cat>
    <def-cat n="det2adj">
      <cat-item lemma="det2adj" tags="adj.*"/>
    </def-cat>
    <def-cat n="detemph">
      <cat-item tags="det.emph.*"/>
    </def-cat>
    <def-cat n="detdemdef">
      <cat-item tags="det.dem.*.def"/>
      <cat-item tags="det.dem.*.def.*"/>
    </def-cat>
    <def-cat n="adv_OR_cm">
      <cat-item tags="cm"/>
      <cat-item tags="cm.*"/>
      <cat-item tags="adv"/>
      <cat-item tags="adv.*"/>
    </def-cat>
    <def-cat n="advladj">
      <cat-item tags="adj.*.nt.sg.ind"/>
      <cat-item tags="adv"/>
      <cat-item tags="adv.*"/>
    </def-cat>
    <def-cat n="anom_def">
      <cat-item lemma="adj_n"               tags="n.*.def.*"/>
      <cat-item lemma="adj_adj_n"           tags="n.*.def.*"/>
      <cat-item lemma="adj_adj_adj_n"       tags="n.*.def.*"/>
      <cat-item lemma="adj_cmp_n"             tags="n.*.def.*"/>
      <cat-item lemma="adj_adj_cmp_n"         tags="n.*.def.*"/>
      <cat-item lemma="adj_adj_adj_cmp_n"     tags="n.*.def.*"/>
      <cat-item lemma="adj_cmp_cmp_n"           tags="n.*.def.*"/>
      <cat-item lemma="adj_adj_cmp_cmp_n"       tags="n.*.def.*"/>
      <cat-item lemma="adj_adj_adj_cmp_cmp_n"   tags="n.*.def.*"/>
      <cat-item lemma="adj_cmp_cmp_cmp_n"         tags="n.*.def.*"/>
      <cat-item lemma="adj_adj_cmp_cmp_cmp_n"     tags="n.*.def.*"/>
      <cat-item lemma="adj_adj_adj_cmp_cmp_cmp_n" tags="n.*.def.*"/>
    </def-cat>
    <def-cat n="anom_ind">
      <cat-item lemma="adj_n"               tags="n.*.ind.*"/>
      <cat-item lemma="adj_adj_n"           tags="n.*.ind.*"/>
      <cat-item lemma="adj_adj_adj_n"       tags="n.*.ind.*"/>
      <cat-item lemma="adj_cmp_n"             tags="n.*.ind.*"/>
      <cat-item lemma="adj_adj_cmp_n"         tags="n.*.ind.*"/>
      <cat-item lemma="adj_adj_adj_cmp_n"     tags="n.*.ind.*"/>
      <cat-item lemma="adj_cmp_cmp_n"           tags="n.*.ind.*"/>
      <cat-item lemma="adj_adj_cmp_cmp_n"       tags="n.*.ind.*"/>
      <cat-item lemma="adj_adj_adj_cmp_cmp_n"   tags="n.*.ind.*"/>
      <cat-item lemma="adj_cmp_cmp_cmp_n"         tags="n.*.ind.*"/>
      <cat-item lemma="adj_adj_cmp_cmp_cmp_n"     tags="n.*.ind.*"/>
      <cat-item lemma="adj_adj_adj_cmp_cmp_cmp_n" tags="n.*.ind.*"/>
    </def-cat>
    <def-cat n="nom_sup">
      <cat-item tags="n.*.sup"/>
      <cat-item tags="n.*.sup.*"/>
    </def-cat>
    <def-cat n="prn">
      <cat-item tags="prn.*"/>
    </def-cat>
    <def-cat n="prn_nom">
      <cat-item tags="prn.*.nom"/>
      <cat-item tags="prn.*.nom.*"/>
    </def-cat>
    <def-cat n="prn_acc">
      <cat-item tags="prn.*.acc"/>
      <cat-item tags="prn.*.acc.*"/>
    </def-cat>
    <def-cat n="subj">
      <cat-item tags="*.@subj"/>
      <cat-item tags="*.@subj.*"/>
    </def-cat>
    <def-cat n="pasvsubj" c="If a subject is after a passive, assume the chunk before the passive was adverbial, meaning we need to move the main (non-aux) verb
                             We want to move a passive main verb past a single argument if we have ADVL PASV ARG.
                             Typically, the argument is a subject (though objects are also technically possible, though less likely).
                             We typically *don't* want to move past @xubj, since PASV XUBJ don't tend to come after ADVL
                             (e.g. «som.NOT_ADVL kalles.PASV. arkeologisk tre.XUBJ»)">
      <cat-item tags="*.@subj"/>
      <cat-item tags="*.@subj.*"/>
      <!-- <cat-item tags="*.@xubj"/> -->
      <cat-item tags="prn.*.nt.*"/>
      <cat-item tags="prn.*.nt"/>
      <cat-item tags="det.*.expl.*"/>
      <cat-item tags="det.*.expl"/>
      <cat-item tags="prn.pers.*.nom"/>
    </def-cat>
    <def-cat n="sin">
      <cat-item lemma="detsin" tags="det.pos.*"/>
    </def-cat>
    <def-cat n="cnjsub_som">
      <cat-item tags="cnjsub.som"/>
    </def-cat>
    <def-cat n="clb">
      <cat-item tags="cnjsub.clb"/>
      <cat-item tags="cnjcoo.clb"/>
      <cat-item tags="sent.clb"/>
      <cat-item tags="cnjsub.clb.*"/>
      <cat-item tags="cnjcoo.clb.*"/>
      <cat-item tags="sent.clb.*"/>
    </def-cat>
    <def-cat n="detpos_keep">
      <cat-item lemma="detpos-keep" tags="det.pos.*"/>
    </def-cat>
    <def-cat n="detpos">
      <cat-item tags="det.pos.*"/>
    </def-cat>
    <def-cat n="prnpos_detpos_ndef">
      <cat-item tags="prn.pos.*"/>
      <cat-item tags="det.pos.*"/>
      <cat-item tags="n.*.def"/>
      <cat-item tags="n.*.def.*"/>
    </def-cat>
    <def-cat n="detitg">
      <cat-item tags="det.itg.*"/>
    </def-cat>
    <def-cat n="detdem">
      <cat-item tags="det.dem.*"/>
    </def-cat>
    <def-cat n="detqnt">
      <cat-item tags="det.qnt.*"/>
    </def-cat>
    <def-cat n="detnonpos">
      <cat-item tags="det.def.*"/>
      <cat-item tags="det.dem.*"/>
      <!-- <cat-item tags="det.emph.*"/> -->
      <cat-item tags="det.itg.*"/>
      <cat-item tags="det.qnt.*"/>
    </def-cat>
    <def-cat n="detqntpl">
      <cat-item tags="det.qnt.*.pl"/>
      <cat-item tags="det.qnt.*.pl.*"/>
    </def-cat>
    <def-cat n="detqntpl_def">
      <cat-item tags="det.qnt.*.pl"/>
      <cat-item tags="det.qnt.*.pl.*"/>
      <cat-item tags="det.qnt.*.def"/>   <!-- ene→eine -->
      <cat-item tags="det.qnt.*.def.*"/> <!-- ene→eine -->
    </def-cat>
    <def-cat n="detqntunpl">
      <cat-item tags="det.qnt.un.pl"/>
      <cat-item tags="det.qnt.un.pl.*"/>
    </def-cat>
    <def-cat n="detall">
      <cat-item lemma="detall" tags="det.qnt.*.pl"/>
    </def-cat>
    <def-cat n="detsamtlige_def">
      <cat-item lemma="detsamtlige" tags="det.qnt.def.*.pl"/>
    </def-cat>
    <def-cat n="detenhver">
      <cat-item lemma="detenhver" tags="det.qnt.*"/>
    </def-cat>
    <def-cat n="deten">
      <cat-item lemma="deten" tags="det.qnt.*"/>
      <!-- <cat-item lemma="det" tags="det.qnt.*"/> -->
    </def-cat>

    <def-cat n="av_alle">
      <cat-item tags="pr.av alle"/>
    </def-cat>

    <def-cat n="vblex">
      <cat-item tags="vblex"/>
      <cat-item tags="vblex.*"/>
    </def-cat>
    <def-cat n="fv">
      <cat-item tags="vblex.pres"/>
      <cat-item tags="vblex.pres.*"/>
      <cat-item tags="vblex.pret"/>
      <cat-item tags="vblex.pret.*"/>
      <cat-item tags="vblex.imp"/>
      <cat-item tags="vblex.imp.*"/>
    </def-cat>
    <def-cat n="pr_OR_vblex">
      <cat-item tags="vblex"/>
      <cat-item tags="vblex.*"/>
      <cat-item tags="pr"/>
      <cat-item tags="pr.*"/>
    </def-cat>
    <def-cat n="aux">
      <cat-item lemma="aux" tags="vblex"/>
      <cat-item lemma="aux" tags="vblex.*"/>
    </def-cat>
    <def-cat n="auxpass" c="Auxiliary generated in t1x">
      <cat-item lemma="aux" tags="vblex.*.pasv"/>
    </def-cat>
    <def-cat n="infaux">
      <cat-item lemma="aux" tags="vblex.inf"/>
      <cat-item lemma="aux" tags="vblex.inf.*"/>
    </def-cat>
    <def-cat n="adv">
      <cat-item tags="adv"/>
      <cat-item tags="adv.*"/>
    </def-cat>
    <def-cat n="adv_unbound">
      <cat-item tags="adv.free-adv.*"/>
      <cat-item tags="adv.sent-adv.*"/>
      <cat-item tags="adv.free-adv"/>
      <cat-item tags="adv.sent-adv"/>
      <cat-item tags="adv.*.free-adv.*"/>
      <cat-item tags="adv.*.sent-adv.*"/>
      <cat-item tags="adv.*.free-adv"/>
      <cat-item tags="adv.*.sent-adv"/>
    </def-cat>
    <def-cat n="adv_unbound_OR_adjadv">
      <cat-item tags="adv.free-adv.*"/>
      <cat-item tags="adv.sent-adv.*"/>
      <cat-item tags="adv.free-adv"/>
      <cat-item tags="adv.sent-adv"/>
      <cat-item tags="adv.*.free-adv.*"/>
      <cat-item tags="adv.*.sent-adv.*"/>
      <cat-item tags="adv.*.free-adv"/>
      <cat-item tags="adv.*.sent-adv"/>
      <cat-item tags="adj.*.nt.sg.*"/>
    </def-cat>
    <def-cat n="adv_free">
      <cat-item tags="adv.free-adv"/>
      <cat-item tags="adv.free-adv.*"/>
      <cat-item tags="adv.*.free-adv"/>
      <cat-item tags="adv.*.free-adv.*"/>
    </def-cat>
    <def-cat n="adv_bound">
      <cat-item tags="adv.bound-adv"/>
      <cat-item tags="adv.bound-adv.*"/>
      <cat-item tags="adv.*.bound-adv"/>
      <cat-item tags="adv.*.bound-adv.*"/>
    </def-cat>
    <def-cat n="prearg_OR_arg">
      <cat-item tags="adv.bound-adv"/>
      <cat-item tags="adv.bound-adv.*"/>
      <cat-item tags="adv.*.bound-adv"/>
      <cat-item tags="adv.*.bound-adv.*"/>
      <cat-item tags="n.*"/>
      <cat-item tags="np.*"/>
      <cat-item tags="np.*"/>
      <cat-item tags="adj.*"/>
      <cat-item tags="det.*"/>
      <cat-item tags="pr"/>
      <cat-item tags="pr.*"/>
      <cat-item tags="part"/>
      <cat-item tags="part.*"/>
      <cat-item tags="cnjsub"/>
      <cat-item tags="cnjsub.*"/>
    </def-cat>
    <def-cat n="adjsg">
      <cat-item tags="adj.*.sg.*"/>
    </def-cat>
    <def-cat n="prenom">
      <cat-item tags="adv"/>
      <cat-item tags="adv.*"/>
      <cat-item tags="adj.*"/>
      <cat-item tags="det.*"/>
      <cat-item tags="pr"/>
      <cat-item tags="pr.*"/>
    </def-cat>
    <def-cat n="prenom_OR_nom">
      <cat-item tags="adv"/>
      <cat-item tags="adv.*"/>
      <cat-item tags="adj.*"/>
      <cat-item tags="det.*"/>
      <cat-item tags="pr"/>
      <cat-item tags="pr.*"/>
      <cat-item tags="n.*"/>
      <cat-item tags="np.*"/>
    </def-cat>
    <def-cat n="infm">
      <cat-item lemma="infm" tags="part"/>
      <cat-item lemma="infm" tags="part.*"/>
    </def-cat>
    <def-cat n="cnjcoo">
      <cat-item tags="cnjcoo"/>
      <cat-item tags="cnjcoo.*"/>
    </def-cat>
    <def-cat n="cnjcoo_not_clb">
      <cat-item tags="cnjcoo"/>
      <cat-item tags="cnjcoo.aa"/>
      <cat-item tags="cnjcoo.Aa"/>
      <cat-item tags="cnjcoo.AA"/>
    </def-cat>
    <def-cat n="lemq">
      <cat-item tags="vblex.lemq"/>
      <cat-item tags="vblex.lemq.*"/>
    </def-cat>
    <def-cat n="lemq-skip-n">
      <cat-item tags="vblex.lemq.lemq-skip-n"/>
      <cat-item tags="vblex.lemq.lemq-skip-n.*"/>
    </def-cat>
    <def-cat n="lemq-skip-obj">
      <cat-item tags="vblex.lemq.lemq-skip-obj"/>
      <cat-item tags="vblex.lemq.lemq-skip-obj.*"/>
      <cat-item tags="vblex.lemq.*.lemq-skip-obj.*"/>
    </def-cat>
    <def-cat n="adjpart">
      <cat-item tags="vblex.pp"/>
      <cat-item tags="adj.pp"/>
      <cat-item tags="adj.pp.*"/>
    </def-cat>
    <def-cat n="pp_np-movable">
      <cat-item tags="vblex.pp.np-movable"/>
      <cat-item tags="adj.pp.np-movable"/>
      <cat-item tags="adj.pp.*.np-movable"/>
    </def-cat>
    <def-cat n="pasv-pp">
      <cat-item lemma="adj2vblex" tags="vblex.pp"/>
      <cat-item lemma="adj2vblex" tags="adj.pp"/>
      <cat-item lemma="adj2vblex" tags="adj.pp.*"/>
    </def-cat>
    <def-cat n="prep_nhead">
      <cat-item tags="pr.*.nhead"/>
    </def-cat>
    <def-cat n="prep_av">
      <cat-item tags="pr.av"/>
    </def-cat>
    <def-cat n="prep_ifølge">
      <cat-item tags="pr.ifølge"/>
    </def-cat>
    <def-cat n="prep">
      <cat-item tags="pr.*"/>
      <cat-item tags="pr"/>
    </def-cat>
    <def-cat n="prep_som">
      <cat-item tags="pr.som"/>
      <cat-item tags="pr.som.*"/>
    </def-cat>
    <def-cat n="prep_ved">
      <cat-item tags="pr.ved"/>
      <cat-item tags="pr.ved.*"/>
    </def-cat>
    <def-cat n="sent">
      <cat-item tags="sent.*"/>
      <cat-item tags="sent"/>
    </def-cat>
    <def-cat n="cm">
      <cat-item tags="cm"/>
      <cat-item tags="cm.*"/>
    </def-cat>
    <def-cat n="cm-non-clb">
      <cat-item tags="cm"/>
      <cat-item tags="cm.aa"/>
    </def-cat>
    <def-cat n="needdet_adj_n">
      <cat-item lemma="needdet_adj_n" tags="n.*"/>
    </def-cat>
  </section-def-cats>

  <section-def-attrs>
    <def-attr n="a_nom">
      <attr-item tags="n"/>
      <attr-item tags="n.acr"/>
      <attr-item tags="np"/>
      <attr-item tags="np.top"/>
    </def-attr>
    <def-attr n="persona">
      <attr-item tags="p1"/>
      <attr-item tags="p2"/>
      <attr-item tags="p3"/>
    </def-attr>
    <def-attr n="a_verb">
      <attr-item tags="vblex"/>
      <attr-item tags="vblex.pstv"/>
    </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>
    <def-attr n="voice">
      <attr-item tags="pasv"/>
    </def-attr>
    <def-attr n="a_det">
      <attr-item tags="det"/>
      <attr-item tags="det.emph"/>
      <attr-item tags="det.dem"/>
      <attr-item tags="det.itg"/>
      <attr-item tags="det.qnt"/>
      <attr-item tags="det.qnt.neg"/>
      <attr-item tags="det.pos"/>
    </def-attr>
    <def-attr n="gen">
      <attr-item tags="m"/>
      <attr-item tags="mf"/>
      <attr-item tags="un"/>
      <attr-item tags="nt"/>
      <attr-item tags="f"/>
      <attr-item tags="GD"/>
    </def-attr>
    <def-attr n="gen_of_detsg" c="TODO: eine/andre/eigne har un">
      <attr-item tags="m"/>
      <attr-item tags="f"/>
      <attr-item tags="nt"/>
    </def-attr>
    <def-attr n="sl-gen">
      <attr-item tags="sl-m"/>
      <attr-item tags="sl-mf"/>
      <attr-item tags="sl-nt"/>
      <attr-item tags="sl-f"/>
    </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="cas">
      <attr-item tags="nom"/>
      <attr-item tags="gen"/>
      <attr-item tags="acc"/>
      <attr-item tags="CD"/>
    </def-attr>
    <def-attr n="a_casedrop" c="Mark that we'd like to drop gen-case in t3x">
      <attr-item tags="casedrop"/>
    </def-attr>
    <def-attr n="a_defdrop" c="Mark that we'd like to change defnes to ind in t3x">
      <attr-item tags="defdrop"/>
      <attr-item tags="gendefdrop"/> <!-- the object would like to drop the genitive's defnes -->
    </def-attr>
    <def-attr n="a_keepgenx" c="Mark that we'd like to keep gen-case of possessor (throw away prep)">
      <attr-item tags="keepgenx"/>
    </def-attr>
    <def-attr n="a_move-needs-det" c="Needs determiner when moved out of genitive">
      <attr-item tags="move-needs-det"/>
    </def-attr>
    <def-attr n="a_date">
      <attr-item tags="date"/>
    </def-attr>
    <def-attr n="a_cmp">
      <attr-item tags="cmp"/>
      <attr-item tags="cmp-split"/>
    </def-attr>
    <def-attr n="art">
      <attr-item tags="def"/>
      <attr-item tags="ind"/>
    </def-attr>
    <def-attr n="a_expl">
      <attr-item tags="expl"/>
    </def-attr>
    <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="n-movable">
      <attr-item tags="n-movable"/>
    </def-attr>
    <def-attr n="a_clb">
      <attr-item tags="clb"/>
    </def-attr>

    <def-attr n="gen_prep_override">
      <attr-item tags="pr_til"/>
      <attr-item tags="pr_av"/>
      <attr-item tags="pr_blant"/>
      <attr-item tags="pr_etter"/>
      <attr-item tags="pr_for"/>
      <attr-item tags="pr_frå"/>
      <attr-item tags="pr_før"/>
      <attr-item tags="pr_gjennom"/>
      <attr-item tags="pr_hos"/>
      <attr-item tags="pr_i"/>
      <attr-item tags="pr_med"/>
      <attr-item tags="pr_mellom"/>
      <attr-item tags="pr_mot"/>
      <attr-item tags="pr_om"/>
      <attr-item tags="pr_over"/>
      <attr-item tags="pr_per"/>
      <attr-item tags="pr_på"/>
      <attr-item tags="pr_rundt"/>
      <attr-item tags="pr_som"/>
      <attr-item tags="pr_uansett"/>
      <attr-item tags="pr_under"/>
      <attr-item tags="pr_unna"/>
      <attr-item tags="pr_ut"/>
      <attr-item tags="pr_ved"/>
    </def-attr>

  </section-def-attrs>


  <section-def-vars>
    <def-var n="caseFirstWord"/>
    <def-var n="det_gender"/>
    <def-var n="number_no_sp"/>
    <def-var n="adj_number"/>
    <def-var n="adj_gender"/>
    <def-var n="adj_defness"/>
    <def-var n="n_number"/>
    <def-var n="case"/>
    <def-var n="n_defness"/>
    <def-var n="lemh"/>
    <def-var n="pr_lemh"/>
    <def-var n="genpr"/>
    <def-var n="ana_gen"     c="nt or mf"/>
    <def-var n="ana_gen_m-f" c="m or f"/>
    <def-var n="ana_nbr"/>
    <def-var n="ana_temps" c="Last seen finite verb temps (pres/pret)"/>
    <def-var n="tmp"/>
  </section-def-vars>

  <section-def-lists>
    <def-list n="m_f_mf_GD">
      <list-item v="&lt;m&gt;"/>
      <list-item v="&lt;f&gt;"/>
      <list-item v="&lt;mf&gt;"/>
      <list-item v="&lt;GD&gt;"/>
      <list-item v="&lt;sl-m&gt;"/>
      <list-item v="&lt;sl-f&gt;"/>
      <list-item v="&lt;sl-mf&gt;"/>
      <list-item v="&lt;sl-GD&gt;"/>
    </def-list>
    <def-list n="nt_GD">
      <list-item v="&lt;nt&gt;"/>
      <list-item v="&lt;GD&gt;"/>
      <list-item v="&lt;sl-nt&gt;"/>
      <list-item v="&lt;sl-GD&gt;"/>
    </def-list>
  </section-def-lists>

  <section-def-macros>

    <!-- Macros which set concordance variables etc.: -->
    <def-macro n="switch_cases" npar="2"
               c="arg1: last word, which will be output first,
                  arg2: first word, which will be output last">
      <let><var n="caseFirstWord"/><get-case-from pos="1"><lit v="aa"/></get-case-from></let>
      <choose><when c="only if the last word was lower, do we switch cases">
        <test><equal><var n="caseFirstWord"/><lit v="aa"/></equal></test>
        <let><clip pos="1" part="lemh"/><get-case-from pos="2"><clip pos="1" part="lemh"/></get-case-from></let>
        <modify-case><clip pos="2" part="lemh"/><var n="caseFirstWord"/></modify-case>
      </when></choose>
    </def-macro>

    <def-macro n="get_case_from_detpos" npar="2">
      <!-- arg.1: possessed noun. arg.2: det.pos, gives typographic case -->
      <choose>
        <when>
          <test>
            <and>
              <equal><clip pos="2" part="lemh"/><lit v="De"/></equal>
              <equal><clip pos="2" part="a_det"/><lit-tag v="det.pos"/></equal>
              <equal><clip pos="2" part="persona"/><lit-tag v="p2"/></equal>
            </and>
          </test>
          <let><var n="lemh"/><clip pos="1" part="lemh"/></let>
        </when>
        <otherwise>
          <let><var n="lemh"/><get-case-from pos="2"><clip pos="1" part="lemh"/></get-case-from></let>
        </otherwise>
      </choose>
    </def-macro>
    <def-macro n="modify_case_detpos" npar="2">
      <!-- arg.1: possessed noun. arg.2: det.pos, gives typographic case
           Workaround for Polite forms.
      -->
      <choose>
        <when>
          <test><not>
            <and>
              <equal><clip pos="2" part="lemh"/><lit v="De"/></equal>
              <equal><clip pos="2" part="a_det"/><lit-tag v="det.pos"/></equal>
              <equal><clip pos="2" part="persona"/><lit-tag v="p2"/></equal>
            </and>
          </not></test>
          <modify-case><clip pos="2" part="lemh"/><clip pos="1" part="lemh"/></modify-case>
        </when>
      </choose>
    </def-macro>

    <def-macro n="set_det_gender1.n" npar="1"
               c="arg.1: noun. Sets variables for creating a new determiner.">

      <let><var n="number_no_sp"/><clip pos="1" part="nbr"/></let>
      <choose><when>
        <test><or>
          <equal><var n="number_no_sp"/><lit-tag v="sp"/></equal>
          <equal><var n="number_no_sp"/><lit v=""/></equal>
        </or></test>
        <let><var n="number_no_sp"/><lit-tag v="pl"/></let>
      </when></choose>
      <choose>
        <when>
          <test><equal><var n="number_no_sp"/><lit-tag v="sg"/></equal></test>
          <let><var n="det_gender"/><clip pos="1" part="gen"/></let>
          <choose>
            <when>
              <test><or>
                <equal><var n="det_gender"/><lit v=""/></equal>
                <and>
                  <equal><var n="number_no_sp"/><lit-tag v="sg"/></equal>
                  <!-- nb: this test doesn't work for eine/andre/eigne – but fortunately we don't create those from scratch: -->
                  <not><equal><clip pos="1" part="gen"/><clip pos="1" part="gen_of_detsg"/></equal></not>
                </and>
              </or></test>
              <let><var n="det_gender"/><lit-tag v="m"/></let>
            </when>
          </choose>
        </when>
        <otherwise>
          <let><var n="det_gender"/><lit-tag v="un"/></let>
        </otherwise>
      </choose>
    </def-macro>

    <def-macro n="modify_det_gender2.n.det" npar="2"
               c="arg.1: noun, arg.2: determiner">
      <choose>
        <when>
          <test><and>
            <not><equal><clip pos="1" part="gen"/><lit v=""/></equal></not>
            <or> <!-- only change gender of det for singular nouns *or* if det is «kva for ein (av)» -->
              <equal><clip pos="2" part="a_det"/><lit-tag v="det.itg"/></equal>
              <not><equal><clip pos="1" part="nbr"/><lit-tag v="pl"/></equal></not>
            </or>
            <not><equal><clip pos="2" part="nbr"/><lit-tag v="pl"/></equal></not>
          </and></test>
          <let><clip pos="2" part="gen"/><clip pos="1" part="gen"/></let>
        </when>
      </choose>
    </def-macro>

    <def-macro n="set_ana" npar="1"
               c="arg.1: noun or verb. Set vars for for later use by modify_pp_gender">
      <choose>
        <when>
          <test><equal><var n="ana_temps"/><lit v=""/></equal></test>
          <let><var n="ana_temps"/><lit-tag v="pres"/></let>
        </when>
      </choose>
      <choose>
        <when>
          <test><and>
            <not><equal><clip pos="1" part="temps"/><lit v=""/></equal></not>
            <not><equal><clip pos="1" part="temps"/><lit-tag v="pp"/></equal></not>
            <not><equal><clip pos="1" part="temps"/><lit-tag v="inf"/></equal></not>
          </and></test>
          <let><var n="ana_temps"/><clip pos="1" part="temps"/></let>
        </when>
      </choose>

      <choose>
        <when>
          <test><and>
            <or>
              <equal><clip pos="1" part="nbr"/><lit-tag v="sg"/></equal>
              <begins-with><clip pos="1" part="a_nom"/><lit-tag v="np"/></begins-with>
            </or>
            <or>
              <equal><clip pos="1" part="gen"/><lit-tag v="mf"/></equal>
              <equal><clip pos="1" part="gen"/><lit-tag v="m"/></equal>
              <equal><clip pos="1" part="gen"/><lit-tag v="f"/></equal>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
            </or>
          </and></test>
          <let><var n="ana_nbr"/><clip pos="1" part="nbr"/></let>
          <let><var n="ana_gen"/><clip pos="1" part="gen"/></let>
          <choose><when>
            <test><or>
              <equal><var n="ana_gen"/><lit-tag v="f"/></equal>
              <equal><var n="ana_gen"/><lit-tag v="m"/></equal>
            </or></test>
            <let><var n="ana_gen_m-f"/><var n="ana_gen"/></let>
            <let><var n="ana_gen"/><lit-tag v="mf"/></let>
          </when></choose>
        </when>
        <when>
          <test><and>
            <equal><clip pos="1" part="nbr"/><lit-tag v="pl"/></equal>
            <not><equal><clip pos="1" part="a_date"/><lit-tag v="date"/></equal></not>
          </and></test>
          <let><var n="ana_nbr"/><clip pos="1" part="nbr"/></let>
          <let><var n="ana_gen"/><lit v=""/></let>
        </when>
      </choose>
    </def-macro>

    <def-macro n="modify_pp_gen_nbr" npar="1"
               c="arg.1: adj.pp / vblex.pp
                  Does nothing for vblex.pp
                  Assumes set_ana only sets variable combinations that are OK for adj.pp's">
      <choose><when>
        <test><not><equal><var n="ana_nbr"/><lit v=""/></equal></not></test>
        <let><clip pos="1" part="nbr"/><var n="ana_nbr"/></let>
        <let><clip pos="1" part="gen"/><var n="ana_gen"/></let>
      </when></choose>
      <choose><when>
        <test><equal><clip pos="1" part="nbr"/><lit-tag v="pl"/></equal></test>
        <let><clip pos="1" part="art"/><lit v=""/></let>
        <let><clip pos="1" part="gen"/><lit v=""/></let>
      </when></choose>
    </def-macro>
    <def-macro n="modify_pp_gen_nbr_NOANA" npar="1"
               c="arg.1: adj.pp / vblex.pp
                  Does nothing for vblex.pp">
      <choose><when>
        <test><equal><clip pos="1" part="nbr"/><lit-tag v="pl"/></equal></test>
        <let><clip pos="1" part="art"/><lit v=""/></let>
        <let><clip pos="1" part="gen"/><lit v=""/></let>
      </when></choose>
    </def-macro>

    <def-macro n="modify_prn_gen" npar="1"
               c="arg.1: prn">
      <choose><when>
        <test><equal><clip pos="1" part="gen"/><lit-tag v="GD"/></equal></test>
        <choose>
          <when>
            <test><equal><var n="ana_gen_m-f"/><lit v=""/></equal></test>
            <let><clip pos="1" part="gen"/><lit-tag v="m"/></let>
          </when>
          <otherwise>
            <let><clip pos="1" part="gen"/><var n="ana_gen_m-f"/></let>
          </otherwise>
        </choose>
      </when></choose>
    </def-macro>

    <def-macro n="set_n_defness" npar="2"
               c="arg.1: noun, arg.2: determiner
                  Make sure we have double definiteness marking, eg.:
                  disse.def friheter.ind => desse.def fridomane.def
                  Check that numbers don't mismatch to protect from certain mis-taggings.">
      <choose>
        <when>
          <test>
            <and>
              <equal><clip pos="1" part="art"/><lit-tag v="ind"/></equal>
              <equal caseless="yes"><clip pos="2" part="lemh"/><lit v="detdd"/></equal>
              <not><or>
                <and><equal><clip pos="1" part="nbr"/><lit-tag v="pl"/></equal>
                     <equal><clip pos="2" part="nbr"/><lit-tag v="sg"/></equal></and>
                <and><equal><clip pos="2" part="nbr"/><lit-tag v="pl"/></equal>
                     <equal><clip pos="1" part="nbr"/><lit-tag v="sg"/></equal></and>
              </or></not>
            </and>
          </test>
          <let><clip pos="1" part="art"/><lit-tag v="def"/></let>
        </when>
      </choose>
    </def-macro>

    <!-- Output macros: -->
    <def-macro n="out_det3" npar="3"
               c="arg.1: adj_n/det chunk for out_det num/gen, arg.2: typ.case for out_det, arg.3: gives typ.case to arg1 adj/det
                  Outputs a space afterwards.">
      <call-macro n="set_det_gender1.n"><with-param pos="1"/></call-macro>
      <out>
        <chunk>
          <get-case-from pos="2"><lit v="det"/></get-case-from>
          <lit-tag v="det.dem"/>
          <var n="det_gender"/>
          <var n="number_no_sp"/>
          <lit v="{^"/>
          <get-case-from pos="2"><lit v="den"/></get-case-from>
          <lit-tag v="det.dem"/>
          <var n="det_gender"/>
          <var n="number_no_sp"/>
          <lit v="$}"/>
        </chunk>
        <b/>
      </out>
      <let><clip pos="1" part="lemh"/><get-case-from pos="3"><clip pos="1" part="lemh"/></get-case-from></let>
    </def-macro>

    <def-macro n="out_det" npar="2"
               c="arg.1: adj_n or det chunk, arg.2: gives typographic case to arg1 adj/det
                  Outputs a space afterwards.">
      <call-macro n="out_det3"><with-param pos="1"/><with-param pos="1"/><with-param pos="2"/></call-macro>
    </def-macro>

    <def-macro n="out_det_when_adjlike" npar="2"
               c="arg.1: adj_n or det chunk, arg.2: gives typographic case to adj/det
                  Outputs a space afterwards.">
      <call-macro n="set_det_gender1.n"><with-param pos="1"/></call-macro>
      <choose><when>
        <test><or>
          <begins-with caseless="yes"><clip pos="1" part="lemh"/><lit v="adj"/></begins-with>
          <begins-with caseless="yes"><clip pos="1" part="lemh"/><lit v="cmp_adj"/></begins-with>
          <begins-with caseless="yes"><clip pos="1" part="lemh"/><lit v="cmp_cmp_adj"/></begins-with>
          <begins-with caseless="yes"><clip pos="1" part="lemh"/><lit v="cmp_cmp_cmp_adj"/></begins-with>
          <begins-with caseless="yes"><clip pos="1" part="lemh"/><lit v="cmp_cmp_cmp_cmp_adj"/></begins-with>
          <equal><clip pos="1" part="a_move-needs-det"/><lit-tag v="move-needs-det"/></equal>
          <begins-with caseless="yes"><clip pos="1" part="tags"/><lit-tag v="det.qnt"/></begins-with>
        </or></test>
        <call-macro n="out_det"><with-param pos="1"/><with-param pos="2"/></call-macro>
      </when></choose>
    </def-macro>

    <def-macro n="out_ndef" npar="2"
               c="arg.1: possessed noun, arg.2: gives typographic case
                  Strip case, add definiteness.">
      <call-macro n="get_case_from_detpos">
        <with-param pos="1"/>
        <with-param pos="2"/>
      </call-macro>
      <let><clip pos="1" part="art"/><lit-tag v="def"/></let>
      <out>
        <chunk><clip pos="1" part="whole"/></chunk>
      </out>
    </def-macro>

    <def-macro n="out_sin" npar="1"
               c="arg.1: noun (possessor)">
      <call-macro n="set_det_gender1.n"><with-param pos="1"/></call-macro>
      <out><chunk>
        <lit v="det"/>
        <var n="det_gender"/>
        <var n="number_no_sp"/>
        <lit v="{^sin"/>
        <lit-tag v="det.pos"/>
        <var n="det_gender"/>
        <var n="number_no_sp"/>
        <lit v="$}"/>
      </chunk></out>
    </def-macro>

    <def-macro n="apply_gendefdrop" npar="2"
               c="arg.1: owner/ex-genitive noun, arg.2: owned noun
                  Turn gendefdrop on owned noun into defdrop on genitive noun">
      <choose><when>
        <test><equal><clip pos="2" part="a_defdrop"/><lit-tag v="gendefdrop"/></equal></test>
        <let><clip pos="1" part="tags"/><concat><clip pos="1" part="tags"/><lit-tag v="defdrop"/></concat></let>
        <let><clip pos="2" part="a_defdrop"/><lit v=""/></let>
      </when></choose>
    </def-macro>

    <def-macro n="out_bi-gen-prep" npar="2"
               c="arg.1: preposition, arg.2: owned noun">
      <let><var n="genpr"/><clip pos="2" part="gen_prep_override"/></let>
      <choose>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_til"/></equal></test><let><var n="pr_lemh"/><lit v="til"/></let></when>
        <!-- dev/genitive-prepositions: -->
        <when><test><equal><var n="genpr"/><lit-tag v="pr_attom"/></equal></test><let><var n="pr_lemh"/><lit v="attom"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_av"/></equal></test><let><var n="pr_lemh"/><lit v="av"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_bak"/></equal></test><let><var n="pr_lemh"/><lit v="bak"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_blant"/></equal></test><let><var n="pr_lemh"/><lit v="blant"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_enn"/></equal></test><let><var n="pr_lemh"/><lit v="enn"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_etter"/></equal></test><let><var n="pr_lemh"/><lit v="etter"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_for"/></equal></test><let><var n="pr_lemh"/><lit v="for"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_forutan"/></equal></test><let><var n="pr_lemh"/><lit v="forutan"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_fram"/></equal></test><let><var n="pr_lemh"/><lit v="fram"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_framfor"/></equal></test><let><var n="pr_lemh"/><lit v="framfor"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_frå"/></equal></test><let><var n="pr_lemh"/><lit v="frå"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_før"/></equal></test><let><var n="pr_lemh"/><lit v="før"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_gjennom"/></equal></test><let><var n="pr_lemh"/><lit v="gjennom"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_hjå"/></equal></test><let><var n="pr_lemh"/><lit v="hjå"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_hos"/></equal></test><let><var n="pr_lemh"/><lit v="hos"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_i"/></equal></test><let><var n="pr_lemh"/><lit v="i"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_ifølge"/></equal></test><let><var n="pr_lemh"/><lit v="ifølge"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_innan"/></equal></test><let><var n="pr_lemh"/><lit v="innan"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_innanfor"/></equal></test><let><var n="pr_lemh"/><lit v="innanfor"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_inni"/></equal></test><let><var n="pr_lemh"/><lit v="inni"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_kring"/></equal></test><let><var n="pr_lemh"/><lit v="kring"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_langs"/></equal></test><let><var n="pr_lemh"/><lit v="langs"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_med"/></equal></test><let><var n="pr_lemh"/><lit v="med"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_mellom"/></equal></test><let><var n="pr_lemh"/><lit v="mellom"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_mot"/></equal></test><let><var n="pr_lemh"/><lit v="mot"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_ned"/></equal></test><let><var n="pr_lemh"/><lit v="ned"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_om"/></equal></test><let><var n="pr_lemh"/><lit v="om"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_omkring"/></equal></test><let><var n="pr_lemh"/><lit v="omkring"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_ovanfor"/></equal></test><let><var n="pr_lemh"/><lit v="ovanfor"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_over"/></equal></test><let><var n="pr_lemh"/><lit v="over"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_overfor"/></equal></test><let><var n="pr_lemh"/><lit v="overfor"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_på"/></equal></test><let><var n="pr_lemh"/><lit v="på"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_rundt"/></equal></test><let><var n="pr_lemh"/><lit v="rundt"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_sidan"/></equal></test><let><var n="pr_lemh"/><lit v="sidan"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_som"/></equal></test><let><var n="pr_lemh"/><lit v="som"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_til"/></equal></test><let><var n="pr_lemh"/><lit v="til"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_under"/></equal></test><let><var n="pr_lemh"/><lit v="under"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_utan"/></equal></test><let><var n="pr_lemh"/><lit v="utan"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_utanfor"/></equal></test><let><var n="pr_lemh"/><lit v="utanfor"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_utanom"/></equal></test><let><var n="pr_lemh"/><lit v="utanom"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_ut"/></equal></test><let><var n="pr_lemh"/><lit v="ut"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_utover"/></equal></test><let><var n="pr_lemh"/><lit v="utover"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_utpå"/></equal></test><let><var n="pr_lemh"/><lit v="utpå"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_ved"/></equal></test><let><var n="pr_lemh"/><lit v="ved"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_via"/></equal></test><let><var n="pr_lemh"/><lit v="via"/></let></when>
        <when><test><equal><var n="genpr"/><lit-tag v="pr_åt"/></equal></test><let><var n="pr_lemh"/><lit v="åt"/></let></when>

        <otherwise><let><var n="pr_lemh"/><lit v=""/></let></otherwise>
      </choose>
      <choose>
        <when>
          <test><equal><var n="pr_lemh"/><lit v=""/></equal></test>
          <out><chunk><clip pos="1" part="whole"/></chunk></out>
        </when>
        <otherwise>
          <out>
            <chunk>
              <lit v="gen-prep"/>
              <lit-tag v="pr"/>
              <lit v="{^"/>
              <var n="pr_lemh"/>
              <lit-tag v="pr"/>
              <lit v="$}"/>
          </chunk></out>
        </otherwise>
      </choose>
    </def-macro>

  </section-def-macros>


  <section-rules>

    <rule comment="AV_ALLE N: av alle beslag → av alle beslaga">
      <pattern>
        <pattern-item n="av_alle"/>
        <pattern-item n="nind_noadj"/>
        <pattern-item n="pr_OR_vblex"/>
      </pattern>
      <action>
        <let><clip pos="2" part="art"/><lit-tag v="def"/></let>
        <let><clip pos="2" part="nbr"/><lit-tag v="pl.chunknum"/></let>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="NEEDDET_ADJ_N: britiske statsministeren => den britiske statsministeren
                   Needs to be before NDEF rule.">
      <pattern>
        <pattern-item n="needdet_adj_n"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="out_det"><with-param pos="1"/><with-param pos="1"/></call-macro>
        <let><clip pos="1" part="lemh"/><lit v="adj_n"/></let>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <!-- AUX PART rules -->

    <rule comment="INFM INFAUX ADJPART => INFM INFAUX ADJPART
                   å leses => å bli lest
                   Infinitive passives with an infinitive marker should keep the auxiliary.
                   Overrides below aux-deleting rule below (no infm => no aux needed)">
      <pattern>
        <pattern-item n="infm"/>
        <pattern-item n="infaux"/>
        <pattern-item n="adjpart"/>
      </pattern>
      <action>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="INFM ADV INFAUX => INFM ADV INFAUX ADJPART">
      <pattern>
        <pattern-item n="infm"/>
        <pattern-item n="adv"/>
        <pattern-item n="infaux"/>
        <pattern-item n="adjpart"/>
      </pattern>
      <action>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="INFM ADV ADV INFAUX ADJPART => INFM ADV ADV INFAUX ADJPART">
      <pattern>
        <pattern-item n="infm"/>
        <pattern-item n="adv"/>
        <pattern-item n="adv"/>
        <pattern-item n="infaux"/>
        <pattern-item n="adjpart"/>
      </pattern>
      <action>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="5" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <!-- AUXPASS ADJPART ADV* => AUXPASS ADV* ADJPART ADV*
         and AUX ADV* ADJPART => AUX ADV* ADJPART rules -->

    <rule comment="AUX ADJPART => AUX ADJPART">
      <pattern>
        <pattern-item n="aux"/>
        <pattern-item n="adjpart"/>
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="2"/></call-macro>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <b/>
          <chunk>
            <clip pos="2" part="whole"/>
          </chunk>
        </out>
      </action>
    </rule>

    <rule comment="AUX PASV-PP CNJCOO AUX PASV-PP → AUX PASV-PP CNJCOO PASV-PP">
      <pattern>
        <pattern-item n="aux"/>
        <pattern-item n="pasv-pp"/>
        <pattern-item n="cnjcoo"/>
        <pattern-item n="aux"/>
        <pattern-item n="pasv-pp"/>
      </pattern>
      <action>
        <choose><when c="Only drop aux if they're the same">
          <test><not><equal><clip pos="1" part="whole"/><clip pos="4" part="whole"/></equal></not></test>
          <reject-current-rule shifting="0"/>
        </when></choose>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="AUX PASV-PP PASVSUBJ => AUX PASVSUBJ PASV-PP
                   (Videre) påpekes det =1> (Vidare) blir påpeikt det =2> (Vidare) blir det påpeikt">
      <pattern>
        <pattern-item n="aux"/>
        <pattern-item n="pasv-pp"/>
        <pattern-item n="pasvsubj"/>
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="3"/></call-macro>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="AUX PASV-PP DET PASVSUBJ => AUX DET PASVSUBJ PASV-PP
                   noteres 4,5 prosent =1> blir notert 4,5 prosent =2> blir 4,5 prosent notert">
      <pattern>
        <pattern-item n="aux"/>      <!-- blir -->
        <pattern-item n="pasv-pp"/>  <!-- notert -->
        <pattern-item n="det"/>      <!-- 4,5 -->
        <pattern-item n="pasvsubj"/> <!-- prosent -->
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="4"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="AUX PASV-PP NGEN PASVSUBJ => AUX NGEN PASVSUBJ PASV-PP
                   utvides tilsynets ansvar =1> blir utvida tilsynets ansvar =2> blir tilsynets ansvar utvida">
      <pattern>
        <pattern-item n="aux"/>      <!-- blir -->
        <pattern-item n="pasv-pp"/>  <!-- utvida -->
        <pattern-item n="ngen"/>     <!-- tilsynets -->
        <pattern-item n="pasvsubj"/> <!-- ansvar -->
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="4"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="ADV_OR_CM AUX PASV-PP PREP_GEN NGEN NIND → ADV_OR_CM AUX NIND PREP_GEN N PASV-PP
                   Torsdag spilles klubbens oppgjer =1> Torsdag blir spelt til klubben oppgjer =2> Torsdag blir oppgjeret til klubben spelt
                   As above, but with genitive preposition rewriting;
                   restricted to run after adv or comma.">
      <pattern>
        <pattern-item n="adv_OR_cm"/> <!-- torsdag -->
        <pattern-item n="aux"/>       <!-- blir -->
        <pattern-item n="pasv-pp"/>   <!-- spilt -->
        <pattern-item n="prep_gen"/>  <!-- til -->
        <pattern-item n="ngen"/>      <!-- klubben -->
        <pattern-item n="nind"/>      <!-- oppgjer -->
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="3"/></call-macro>
        <call-macro n="set_ana"><with-param pos="6"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="6"/><with-param pos="5"/></call-macro>
        <call-macro n="apply_gendefdrop"><with-param pos="5"/><with-param pos="6"/></call-macro>

        <out><chunk><clip pos="1" part="whole"/></chunk><b/></out> <!-- Torsdag -->
        <out><chunk><clip pos="2" part="whole"/></chunk><b/></out> <!-- blir -->
        <call-macro n="out_det_when_adjlike"><with-param pos="6"/><with-param pos="5"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="6"/><with-param pos="5"/></call-macro> <!-- oppgjeret -->
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="4"/><with-param pos="6"/></call-macro> <!-- til-->
        <let><clip pos="5" part="art"/><lit v=""/></let> <!-- don't let postchunk alter defnes of previously-genitive phrase (important for conjunctions of ind+def, e.g. barn og unge) -->
        <out>
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk><b/> <!-- klubben -->
          <chunk><clip pos="3" part="whole"/></chunk> <!-- spelt -->
        </out>
      </action>
    </rule>
    <rule comment="AUX PASV-PP PASVSUBJ ADV_UNBOUND => AUX PASVSUBJ PASV-PP ADV_UNBOUND
                   (Videre) oppgis det ikke =1> (Vidare) blir oppgitt det ikkje =2> (Vidare) blir det ikkje oppgitt

                   «I en uttalelse på Twitter oppgis det ikke antall drepte eller sårede»">
      <pattern>
        <pattern-item n="aux"/>
        <pattern-item n="pasv-pp"/>
        <pattern-item n="pasvsubj"/>
        <pattern-item n="adv_unbound"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <call-macro n="modify_prn_gen"><with-param pos="3"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk> <b/>
          <chunk><clip pos="3" part="whole"/></chunk> <b/>
          <chunk><clip pos="4" part="whole"/></chunk> <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="AUX PASV-PP ADV_UNBOUND PASVSUBJ → AUX PASVSUBJ PASV-PP ADV_UNBOUND
                   [I Mexico] brukes i_dag gjenbruksvann → blir brukt i_dag gjenbruksvann → blir i_dag gjenbruksvatn brukt">
      <pattern>
        <pattern-item n="aux"/>
        <pattern-item n="pasv-pp"/>
        <pattern-item n="adv_unbound"/>
        <pattern-item n="pasvsubj"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="modify_prn_gen"><with-param pos="4"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk> <b/> <!-- blir -->
          <chunk><clip pos="3" part="whole"/></chunk> <b/> <!-- i dag -->
          <chunk><clip pos="4" part="whole"/></chunk> <b/> <!-- gjenbruksvatn -->
          <chunk><clip pos="2" part="whole"/></chunk>      <!-- brukt -->
        </out>
      </action>
    </rule>

    <rule comment="PASVSUBJ AUX PASV-PP ADV_UNBOUND CNJSUB → PASVSUBJ AUX ADV_UNBOUND PASV-PP CNJSUB
                   Den drives i dag som [jernbane] → Den blir driven i dag som → Den blir i dag driven som
                   With a following prep-phrase, our adverb is typically free to enter the verb phrase">
      <pattern>
        <pattern-item n="pasvsubj"/>    <!-- den -->
        <pattern-item n="aux"/>         <!-- blir -->
        <pattern-item n="pasv-pp"/>     <!-- driven-->
        <pattern-item n="adv_unbound"/> <!-- i dag -->
        <pattern-item n="prearg_OR_arg"/> <!-- som -->
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="modify_prn_gen"><with-param pos="1"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk> <b/> <!-- den -->
          <chunk><clip pos="2" part="whole"/></chunk> <b/> <!-- blir -->
          <chunk><clip pos="4" part="whole"/></chunk> <b/> <!-- i dag -->
          <chunk><clip pos="3" part="whole"/></chunk>      <!-- driven -->
          <!-- pos 5 is only matched, not output; instead we shift 4 words to let the next rules handle it -->
        </out>
        <reject-current-rule shifting="4"/>
      </action>
    </rule>
    <rule comment="AUXPASS ADJPART ADV_UNBOUND ARGUMENT → AUXPASS ADV_UNBOUND ADJPART ARGUMENT
                   tas kort sagt alvorlig 1→ blir teke kort sagt alvorleg 2→ blir kort sagt teke alvorleg
                   Free/sentence adverb occupies middle position
                   Assume adverb is free since right position has a verb argument (object/subject/bound adverb)">
      <pattern>
        <pattern-item n="auxpass"/>       <!-- blir -->
        <pattern-item n="adjpart"/>       <!-- teke -->
        <pattern-item n="adv_unbound"/>   <!-- kort sagt -->
        <pattern-item n="prearg_OR_arg"/> <!-- alvorleg -->
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/> <!-- blir -->
          <chunk><clip pos="3" part="whole"/></chunk><b/> <!-- kort sagt -->
          <chunk><clip pos="2" part="whole"/></chunk>     <!-- teken -->
          <!-- pos 4 is only matched, not output; instead we shift 3 words to let the next rules handle it -->
        </out>
        <reject-current-rule shifting="3"/>
      </action>
    </rule>
    <rule comment="AUXPASS ADJPART ifølge N ARGUMENT → AUXPASS ifølge N ADJPART ARGUMENT
                   defineres ifølge norsk lov som 1→ blir definert ifølge norsk lov som 2→ blir ifølge norsk lov definert som
                   Free/sentence adverb occupies middle position
                   Assume adverb is free since right position has a verb argument (object/subject/bound adverb)">
      <pattern>
        <pattern-item n="auxpass"/>       <!-- blir -->
        <pattern-item n="adjpart"/>       <!-- definert -->
        <pattern-item n="prep_ifølge"/>   <!-- ifølge -->
        <pattern-item n="nom"/>           <!-- norsk lov -->
        <pattern-item n="prearg_OR_arg"/> <!-- som -->
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/> <!-- blir -->
          <chunk><clip pos="3" part="whole"/></chunk><b/> <!-- ifølge -->
          <chunk><clip pos="4" part="whole"/></chunk><b/> <!-- norsk lov -->
          <chunk><clip pos="2" part="whole"/></chunk>     <!-- definert -->
          <!-- pos 5 is only matched, not output; instead we shift 4 words to let the next rules handle it -->
        </out>
        <reject-current-rule shifting="4"/>
      </action>
    </rule>
    <rule comment="AUXPASS ADJPART ADV_FREE → AUXPASS ADJPART ADV_FREE
                   boken leses i dag 1→ boka blir lesen i dag 2→ boka blir lesen i dag
                   If none of the rules which include an object had a match, the (non-sentence) adverb should stay in final position">
      <pattern>
        <pattern-item n="auxpass"/>
        <pattern-item n="adjpart"/>
        <pattern-item n="adv_free"/>
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/> <!-- blir -->
          <chunk><clip pos="2" part="whole"/></chunk><b/> <!-- lesen -->
          <chunk><clip pos="3" part="whole"/></chunk>     <!-- i dag -->
        </out>
      </action>
    </rule>
    <rule comment="AUXPASS ADJPART ADV_UNBOUND => AUXPASS ADV_UNBOUND ADJPART (sentence adverb)
                   boken leses ofte =1> boka blir lest ofte =2> boka blir ofte lest
                   auxpass are created in t1x; move adv's behind these
                   (No match if the aux was there originally, then we don't move any adverbs)
                   Not in list of free/bound adverb, so assume sentence adverb, which should go between">
      <pattern>
        <pattern-item n="auxpass"/>
        <pattern-item n="adjpart"/>
        <pattern-item n="adv_unbound"/>
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/> <!-- blir -->
          <chunk><clip pos="3" part="whole"/></chunk><b/> <!-- ofte -->
          <chunk><clip pos="2" part="whole"/></chunk>     <!-- lesen -->
        </out>
      </action>
    </rule>
    <rule comment="AUXPASS ADJPART LEMQ ADV_UNBOUND => AUXPASS ADV_UNBOUND ADJPART LEMQ
                   påberopes ofte =1> vert skulda på ofte =2> vert ofte skulda på
                   auxpass are created in t1x; move adv's behind these
                   (No match if the aux was there originally, then we don't move any adverbs)">
      <pattern>
        <pattern-item n="auxpass"/>
        <pattern-item n="adjpart"/>
        <pattern-item n="lemq"/>
        <pattern-item n="adv_unbound"/>
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="AUXPASS ADJPART ADV_UNBOUND ADV_UNBOUND => AUXPASS ADV_UNBOUND ADV_UNBOUND ADJPART
                   boken leses heller ofte =1> boka blir lest heller ofte =2> boka blir heller ofte lest
                   auxpass are created in t1x; move adv's behind these
                   (No match if the aux was there originally, then we don't move any adverbs)">
      <pattern>
        <pattern-item n="auxpass"/>
        <pattern-item n="adjpart"/>
        <pattern-item n="adv_unbound"/>
        <pattern-item n="adv_unbound"/>
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="AUXPASS ADJPART LEMQ ADV_UNBOUND ADV_UNBOUND => AUXPASS ADV_UNBOUND ADV_UNBOUND ADJPART LEMQ
                   påberopes heller ofte =1> vert skulda på heller ofte =2> vert heller ofte skulda på
                   auxpass are created in t1x; move adv_movable's behind these
                   (No match if the aux was there originally, then we don't move adv)">
      <pattern>
        <pattern-item n="auxpass"/>     <!-- blir -->
        <pattern-item n="adjpart"/>     <!-- skulda -->
        <pattern-item n="lemq"/>        <!-- på -->
        <pattern-item n="adv_unbound"/> <!-- heller -->
        <pattern-item n="adv_unbound"/> <!-- ofte -->
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>  <!-- blir -->
          <chunk><clip pos="4" part="whole"/></chunk><b/>  <!-- heller -->
          <b/> <!-- extra space since empty blank before lemq -->
          <chunk><clip pos="5" part="whole"/></chunk><b/>  <!-- ofte -->
          <chunk><clip pos="2" part="whole"/></chunk>      <!-- skulda -->
          <chunk><clip pos="3" part="whole"/></chunk>      <!-- på -->
        </out>
      </action>
    </rule>

    <rule comment="AUX ADV ADJPART => AUX ADV ADJPART
                   boken ble ofte lest =1> boka vart ofte lesen =2> boka vart ofte lesen
                   No movement (aux existed in bokmål)">
      <pattern>
        <pattern-item n="aux"/>
        <pattern-item n="adv"/>
        <pattern-item n="adjpart"/>
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="AUX ADV ADV ADJPART => AUX ADV ADV ADJPART
                   boken ble heller ofte lest =1> boka vart heller ofte lesen =2> boka vart heller ofte lesen
                   No movement (aux existed in bokmål)">
      <pattern>
        <pattern-item n="aux"/>
        <pattern-item n="adv"/>
        <pattern-item n="adv"/>
        <pattern-item n="adjpart"/>
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="4"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>



    <rule comment="AUXPASS ADJPART NDEF DETPOS => AUXPASS NDEF DETPOS ADJPART
                   reguleres bøkene dine =1> blir regulert bøkene dine =2> blir bøkene dine regulerte
                   auxpass are created in t1x
                   (No match if the aux was there originally, then we don't move anything)">
      <pattern>
        <pattern-item n="auxpass"/>
        <pattern-item n="pp_np-movable"/>
        <pattern-item n="ndef"/>
        <pattern-item n="detpos"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="AUXPASS ADJPART NDEF => AUXPASS NDEF ADJPART
                   (nå) reguleres bøkene =1> blir regulert bøkene =2> blir bøkene regulert
                   auxpass are created in t1x
                   (No match if the aux was there originally, then we don't move anything)">
      <pattern>
        <pattern-item n="auxpass"/>
        <pattern-item n="pp_np-movable"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <choose><when>
          <test><equal><clip pos="3" part="cas"/><lit-tag v="gen"/></equal></test>
          <reject-current-rule shifting="0"/>
        </when></choose>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="AUXPASS ADJPART NGEN NIND => AUXPASS NDEF NIND ADJPART
                   (nå) reguleres årets utgave =1> blir regulert årets utgave =2> blir årets utgave regulert">
      <pattern>
        <pattern-item n="auxpass"/>
        <pattern-item n="pp_np-movable"/>
        <pattern-item n="ngen"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="AUXPASS PP_NP-MOVABLE DET NDEF => AUXPASS DET NDEF PP_NP-MOVABLE
                   (nå) reguleres de sentrale bøkene =1> blir regulert de sentrale bøkene =2> blir de sentrale bøkene regulert
                   auxpass are created in t1x
                   (No match if the aux was there originally, then we don't move anything)">
      <!-- We need actual syntactical tagging to fix this in general: -->
      <!-- TODO: not for «denne veka/hausten», «(På) fredag», «(Ifølge) Nationen» -->
      <!-- TODO: not for MWE-verbs, not for «tildeles» -->
      <!-- TODO: not for inverted order (tildeles): 235765 Årets Peer Gynt-pris blir tildelt den nettbaserte TV-serien tildelt «Skam» og regissør Julie Andem. -->
      <!-- TODO: «denne typen<n> verktøy<n>» as one chunk? -->
      <pattern>
        <pattern-item n="auxpass"/>
        <pattern-item n="pp_np-movable"/>
        <pattern-item n="det"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk> <b/>
          <chunk><clip pos="3" part="whole"/></chunk> <b/>
          <chunk><clip pos="4" part="whole"/></chunk> <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="N AUXPASS ADJPART NDEF => N AUXPASS ADJPART NDEF
                   Overrides the AUXPASS ADJPART NDEF rule.
                   kroner øremerkes tiltaket =1> kroner blir øremerket tiltaket =2> kroner blir øremerket tiltaket
                   auxpass are created in t1x
                   (No match if the aux was there originally, then we don't move anything)">
      <pattern>
        <pattern-item n="nom"/>
        <pattern-item n="auxpass"/>
        <pattern-item n="adjpart"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <choose><when c="second noun is the subject">
          <test><equal><clip pos="4" part="a_syntax"/><lit-tag v="@subj"/></equal></test>
          <reject-current-rule shifting="0"/>
        </when></choose>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="N AUXPASS ADJPART DET NDEF => N AUXPASS ADJPART DET NDEF
                   Overrides the AUXPASS ADJPART DET NDEF rule.
                   (mens) avstemningen holdes den påfølgende onsdagen → (mens) avstemminga blir halden den følgjande onsdagen
                   auxpass are created in t1x
                   (No match if the aux was there originally, then we don't move anything)">
      <pattern>
        <pattern-item n="nom"/>
        <pattern-item n="auxpass"/>
        <pattern-item n="adjpart"/>
        <pattern-item n="det"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="5" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="PREP N AUXPASS PP_NP-MOVABLE NDEF => PREP N AUXPASS PP_NP-MOVABLE NDEF
                   Overrides the rules overriding AUXPASS ADJPART NDEF rules.
                   etter fremleggelsen beskyldes regjeringen =1> etter fremleggelsen blir regjeringen skulda =2> etter framlegginga blir regjeringen skulda
                   auxpass are created in t1x
                   (No match if the aux was there originally, then we don't move anything)">
      <pattern>
        <pattern-item n="prep"/>
        <pattern-item n="nom"/>
        <pattern-item n="auxpass"/>
        <pattern-item n="pp_np-movable"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="4"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="5" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="PREP N AUXPASS PP_NP-MOVABLE DET NDEF => PREP N AUXPASS DET NDEF PP_NP-MOVABLE
                   Overrides the rules overriding AUXPASS ADJPART DET NDEF rules">
      <pattern>
        <pattern-item n="prep"/>
        <pattern-item n="nom"/>
        <pattern-item n="auxpass"/>
        <pattern-item n="pp_np-movable"/>
        <pattern-item n="det"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="set_ana"><with-param pos="6"/></call-macro>
        <call-macro n="modify_pp_gen_nbr"><with-param pos="4"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="5" part="whole"/></chunk><b/>
          <chunk><clip pos="6" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="VBLEX => VBLEX">
      <pattern>
        <pattern-item n="vblex"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
        </out>
      </action>
    </rule>

    <rule comment="VBLEX LEMQ => VBLEX LEMQ
                   Don't output a space since lemq carries a space inside the chunk">
      <pattern>
        <pattern-item n="vblex"/>
        <pattern-item n="lemq"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <chunk>
            <clip pos="2" part="whole"/>
          </chunk>
        </out>
      </action>
    </rule>
    <rule comment="FV LEMQ ADV_UNBOUND => FV ADV_UNBOUND LEMQ
                   Push blanks one place up since lemq space is inside the chunk.">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="adv_unbound"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="FV LEMQ ADV_UNBOUND ADV_UNBOUND => FV ADV_UNBOUND ADV_UNBOUND LEMQ
                   Push blanks one place up since lemq space is inside the chunk.">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="adv_unbound"/>
        <pattern-item n="adv_unbound"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="FV LEMQ ifølge N => FV ifølge N LEMQ
                   Push blanks one place up since lemq space is inside the chunk.">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="prep_ifølge"/>
        <pattern-item n="nom"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="FV LEMQ NDEF NDEF => FV NDEF LEMQ NDEF
                   Push blanks one place up since lemq space is inside the chunk.">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="ndef"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="CLB ADV FV-ACTV LEMQ NDEF → CLB ADV FV-ACTV NDEF LEMQ
                   Push blanks one place up since lemq space is inside the chunk.
                   men nå bortfaller stillingen → men no fell stillinga bort">
      <pattern>
        <pattern-item n="clb"/>
        <pattern-item n="adv"/>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="ADV FV LEMQ NDEF → ADV FV NDEF LEMQ / ADV FV LEMQ NDEF
                   Push blanks one place up since lemq space is inside the chunk.
                   Without subj/obj tagging, changing order here becomes dangerous; we only want it to happen when ndef is subj.
                   So for now we only change order when adv is titlecase (likely subject because ndef early in sentence).
                   MOVE: Torsdag oppgav 19-åringen [sin forklaring] → Torsdag gav 19-åringen frå seg [si forklaring]
                   KEEP:  [De 50 millionene som] nå tilfaller forbundet [vil] → [Dei 50 millionane som] no fell forbundet til [vil]">
      <pattern>
        <pattern-item n="adv"/>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <choose>
          <when c="Only when upper case adverbs (first word of sent)">
            <test><or>
              <equal><clip pos="1" part="lemh"/><lit v="Adv"/></equal>
              <equal><clip pos="1" part="lemh"/><lit v="N"/></equal>
            </or></test>
            <out>
              <chunk><clip pos="1" part="whole"/></chunk>
              <b/>
              <chunk><clip pos="2" part="whole"/></chunk>
              <b/>      <!-- extra space since empty blank before lemq -->
              <b/>
              <chunk><clip pos="4" part="whole"/></chunk>
              <chunk><clip pos="3" part="whole"/></chunk>
            </out>
          </when>
          <otherwise c="No change of order">
            <out>
              <chunk><clip pos="1" part="whole"/></chunk>
              <b/>
              <chunk><clip pos="2" part="whole"/></chunk>
              <b/>
              <chunk><clip pos="3" part="whole"/></chunk>
              <b/>
              <chunk><clip pos="4" part="whole"/></chunk>
            </out>
          </otherwise>
      </choose>
      </action>
    </rule>

    <rule comment="ADV_OR_CM FV LEMQ NDEF SUBJ → ADV_OR_CM FV NDEF SUBJ LEMQ
                   Push blanks one place up since lemq space is inside the chunk.
                   , fortsatte leverandøren Unicon å selge betong.
                   ">
      <pattern>
        <pattern-item n="adv_OR_cm"/> <!-- , -->
        <pattern-item n="fv"/>        <!-- heldt -->
        <pattern-item n="lemq"/>      <!-- fram -->
        <pattern-item n="ndef"/>      <!-- leverandøren -->
        <pattern-item n="subj"/>      <!-- Unicon -->
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="ADV FV LEMQ ADV_UNBOUND NDEF → ADV FV ADV_UNBOUND NDEF LEMQ
                   Push blanks two places up since lemq space is inside the chunk.
                   Should be fairly safe compared to above rule (rarely do we have adv fv adv object)
                   Torsdag oppgav altså 19-åringen [sin forklaring] → Torsdag gav altså 19-åringen frå seg [si forklaring]">
      <pattern>
        <pattern-item n="adv"/>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="adv_unbound"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="FV LEMQ PRN_NOM => FV PRN_NOM LEMQ
                   Push blanks one place up since lemq space is inside the chunk.">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="prn_nom"/>
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="3"/></call-macro>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk>
            <clip pos="3" part="whole"/>
          </chunk>
          <chunk>
            <clip pos="2" part="whole"/>
          </chunk>
        </out>
      </action>
    </rule>
    <rule comment="FV LEMQ PRN_NOM ADV_UNBOUND => FV PRN_NOM ADV_UNBOUND LEMQ
                   Push blanks one place up since lemq space is inside the chunk.
                   [Da] fortsatte hun like_godt [karrieren] → heldt ho fram like godt → heldt ho like godt fram">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="prn_nom"/>
        <pattern-item n="adv_unbound"/>
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="3"/></call-macro>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="FV LEMQ PRN_NOM ADV_UNBOUND ADV_UNBOUND => FV PRN_NOM ADV_UNBOUND ADV_UNBOUND LEMQ
                   Push blanks one place up since lemq space is inside the chunk.
                   [Derfor] fraråder vi nå klart [å] → rår mot vi no klart → rår vi no klart mot">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="prn_nom"/>
        <pattern-item n="adv_unbound"/>
        <pattern-item n="adv_unbound"/>
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="3"/></call-macro>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="FV LEMQ PRN_ACC ADV_UNBOUND => FV PRN_ACC ADV_UNBOUND LEMQ
                   Push blanks one place up since lemq space is inside the chunk.
                   [men] utelukker det ikke → ser bort frå det ikkje → ser ikkje bort frå det">
      <pattern>
        <pattern-item n="fv"/> <!-- 1. ser -->
        <pattern-item n="lemq"/>  <!-- 2. bort frå -->
        <pattern-item n="prn_acc"/> <!-- 3. det -->
        <pattern-item n="adv_unbound"/> <!-- 4. ikkje -->
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="3"/></call-macro>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="ADV FV LEMQ PRN_NOM => ADV FV PRN_NOM LEMQ
                   Push blanks one place up since lemq space is inside the chunk.
                   da oppga han → då gav opp han → då gav han opp">
      <pattern>
        <pattern-item n="adv_unbound"/>
        <pattern-item n="fv"/>
        <pattern-item n="lemq"/>
        <pattern-item n="prn_nom"/>
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="4"/></call-macro>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="AUX ADV ADJPART FV LEMQ-SKIP-OBJ PRN_ACC => AUX ADV ADJPART FV PRN_ACC LEMQ-SKIP_OBJ
                   Push blanks one place up since lemq space is inside the chunk.">
      <pattern>
        <pattern-item n="aux"/>
        <pattern-item n="adv"/>
        <!-- TODO: where's the adjpart ?? -->
        <pattern-item n="fv"/>
        <pattern-item n="lemq-skip-obj"/>
        <pattern-item n="prn_acc"/>
      </pattern>
      <action>
        <call-macro n="modify_pp_gen_nbr_NOANA"><with-param pos="3"/></call-macro>
        <call-macro n="modify_prn_gen"><with-param pos="5"/></call-macro>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="VBLEX LEMQ-SKIP-OBJ PRN_ACC => VBLEX PRN_ACC LEMQ-SKIP_OBJ
                   Push blanks one place up since lemq space is inside the chunk.
                   å innlevere dem → å levere inn dei → å levere dei inn
                   (object pronouns are the exception where we move infinite lemq's)">
      <pattern>
        <pattern-item n="vblex"/>
        <pattern-item n="lemq-skip-obj"/>
        <pattern-item n="prn_acc"/>
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="3"/></call-macro>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="NP_PRNNOM_OG FV LEMQ-SKIP-N NDEF => NP_PRNNOM_OG FV LEMQ-SKIP-N NDEF
                   Override below rule
                   We want: Carlsen heldt fram sigersrekka, not *Carlsen heldt sigersrekka fram">
      <pattern>
        <pattern-item n="np_prnnom_og"/>
        <pattern-item n="fv"/>
        <pattern-item n="lemq-skip-n"/>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="FV LEMQ-SKIP-N NDEF_NP_PERS => FV NDEF_NP_PERS LEMQ-SKIP-N
                   - Søndag fortsatte kamphandlingene → Søndag heldt kamphandlingane fram
                   , fortsatte Ola → , heldt Ola fram">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq-skip-n"/>
        <pattern-item n="n_OR_np_subj"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="FV LEMQ-SKIP-N ADJ/ADV_UNBOUND SUBJ => FV ADJ/ADV_UNBOUND SUBJ LEMQ-SKIP-N
                   , fortsetter nemlig flyene [å lande] → , held nemleg flya fram med [å lande]">
      <pattern>
        <pattern-item n="fv"/>                    <!-- 1. held -->
        <pattern-item n="lemq-skip-n"/>           <!-- 2. # fram med -->
        <pattern-item n="adv_unbound_OR_adjadv"/> <!-- 3. nemleg/stadig -->
        <pattern-item n="n_OR_np_subj"/>          <!-- 4. flya -->
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="FV LEMQ-SKIP-N ADJ/ADV_UNBOUND SUBJ → FV SUBJ ADJ/ADV_UNBOUND LEMQ-SKIP-N
                   foregår det ikke [henrettelser] → går føre_seg det ikkje [avrettingar] → går det ikkje føre_seg [avrettingar]">
      <pattern>
        <pattern-item n="fv"/>                    <!-- 1. held -->
        <pattern-item n="lemq-skip-n"/>           <!-- 2. # fram med -->
        <pattern-item n="n_OR_np_subj"/>          <!-- 4. flya -->
        <pattern-item n="adv_unbound_OR_adjadv"/> <!-- 3. nemleg/stadig -->
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>


    <rule comment="FV LEMQ-SKIP-N DET NDEF_NP_PERS => FV DET NDEF_NP_PERS LEMQ-SKIP-N
                   , fortsetter den britiske mutasjonen → , held den britiske mutasjonen fram">
      <pattern>
        <pattern-item n="fv"/>            <!-- 1. held -->
        <pattern-item n="lemq-skip-n"/>      <!-- 2. fram -->
        <pattern-item n="det"/>              <!-- 3. den -->
        <pattern-item n="n_OR_np_subj"/>     <!-- 4. britiske mutasjonen -->
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="FV LEMQ-SKIP-N DET NDEF_NP_PERS ADV_UNBOUND => FV DET NDEF_NP_PERS ADV_UNBOUND LEMQ-SKIP-N
                   , fortsetter den britiske mutasjonen stadig → , held den britiske mutasjonen stadig fram">
      <pattern>
        <pattern-item n="fv"/>            <!-- 1. held -->
        <pattern-item n="lemq-skip-n"/>      <!-- 2. fram -->
        <pattern-item n="det"/>              <!-- 3. den -->
        <pattern-item n="n_OR_np_subj"/>     <!-- 4. britiske mutasjonen -->
        <pattern-item n="adv_unbound"/>      <!-- 5. stadig -->
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="FV LEMQ-SKIP-N NP_PERS NP_PERS => FV NP_PERS NP_PERS LEMQ-SKIP-N
                   Push blanks one place up since lemq space is inside the chunk.
                   , fortsatte Ola Hansen → , heldt Ola Hansen fram">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq-skip-n"/>
        <pattern-item n="np_pers"/>
        <pattern-item n="np_nonorg"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="FV LEMQ-SKIP-N NP_PERS NP_PERS NP_PERS => FV NP_PERS NP_PERS NP_PERS LEMQ-SKIP-N
                   Push blanks one place up since lemq space is inside the chunk.
                   , fortsatte Ole Andre Hansen → , heldt Ole Andre Hansen fram">
      <pattern>
        <pattern-item n="fv"/>
        <pattern-item n="lemq-skip-n"/>
        <pattern-item n="np_pers"/>
        <pattern-item n="np_nonorg"/>
        <pattern-item n="np_nonorg"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>      <!-- extra space since empty blank before lemq -->
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="ADV/CM AUX PP [DETEN] → ADV/CM FV ein [DETEN]
                   Neste år testes [en] → Neste år blir testa [ein] → Neste år blir det testa [ein]">
      <pattern>
        <pattern-item n="adv_OR_cm"/> <!-- 1. Neste år -->
        <pattern-item n="aux"/>       <!-- 2. blir -->
        <pattern-item n="pasv-pp"/>   <!-- 3. testa-->
        <pattern-item n="deten"/>     <!-- 4. en -->
      </pattern>
      <action>
        <choose><when c="Only at start of clause">
          <test><not><or>
            <equal><clip pos="1" part="lemh"/><lit v="Adv"/></equal>
            <equal><clip pos="1" part="lemh"/><lit v="cm"/></equal>
          </or></not></test>
          <reject-current-rule shifting="0"/>
        </when></choose>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <let><clip pos="3" part="nbr"/><lit-tag v="sg"/></let> <!-- samsvar med detexpl -->
        <let><clip pos="3" part="gen"/><lit-tag v="nt"/></let>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk><lit v="detexpl"/><lit-tag v="det.dem.nt.sg.expl.@subj"/><lit v="{^den"/><lit-tag v="det.dem.nt.sg.expl"/><lit v="$}"/></chunk>
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
        <reject-current-rule shifting="3"/> <!-- let the determiner be handled by following rules -->
      </action>
    </rule>

    <rule comment="ADV/CM AUX PP [QNT] → ADV/CM FV ein [QNT]
                   Neste år stoppes [de fleste] → Neste år blir stoppa [dei fleste] → Neste år stoppar ein [dei fleste]">
      <pattern>
        <pattern-item n="adv_OR_cm"/> <!-- 1. Neste år -->
        <pattern-item n="aux"/>       <!-- 2. blir -->
        <pattern-item n="pasv-pp"/>   <!-- 3. stoppa -->
        <pattern-item n="detqnt"/>    <!-- 4. dei fleste -->
      </pattern>
      <action>
        <choose><when c="Only at start of clause">
          <test><not><or>
            <equal><clip pos="1" part="lemh"/><lit v="Adv"/></equal>
            <equal><clip pos="1" part="lemh"/><lit v="cm"/></equal>
          </or></not></test>
          <reject-current-rule shifting="0"/>
        </when></choose>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <let><clip pos="3" part="nbr"/><lit-tag v="sg"/></let> <!-- samsvar med detexpl -->
        <let><clip pos="3" part="gen"/><lit-tag v="nt"/></let>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><lit v="vblex"/><lit-tag v="vblex"/><clip pos="2" part="temps"/><clip pos="3" part="chcontent"/></chunk>
          <b/>
          <chunk><lit v="prn"/><lit-tag v="prn.pers.p3.un.sg.nom.@subj"/><lit v="{^ein"/><lit-tag v="prn.pers.p3.un.sg.nom"/><lit v="$}"/></chunk>
        </out>
        <reject-current-rule shifting="3"/> <!-- let the determiner be handled by following rules -->
      </action>
    </rule>

    <rule comment="ADV/CM AUX PP [QNT] → ADV/CM FV ein [QNT]
                   Deretter føres [bronkoskopet, et fleksibelt rør,] → Deretter blir ført [bronkoskopet,] → Deretter fører ein [bronkoskopet,]">
      <pattern>
        <pattern-item n="adv_OR_cm"/> <!-- 1. Deretter -->
        <pattern-item n="aux"/>       <!-- 2. blir -->
        <pattern-item n="pasv-pp"/>   <!-- 3. ført -->
        <pattern-item n="ndef"/>      <!-- 4. bronkoskopet -->
        <pattern-item n="cm-non-clb"/> <!-- 5. , -->
        <pattern-item n="any"/>        <!-- 6. et -->
      </pattern>
      <action>
        <choose><when c="Only at start of clause, not before clb">
          <test><or>
            <not><or>
              <equal><clip pos="1" part="lemh"/><lit v="Adv"/></equal>
              <equal><clip pos="1" part="lemh"/><lit v="cm"/></equal>
            </or></not>
            <equal><clip pos="6" part="a_clb"/><lit-tag v="clb"/></equal> <!-- Derfor avsluttes etterforskningen, og saken henlegges. -->
          </or></test>
          <reject-current-rule shifting="0"/>
        </when></choose>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <let><clip pos="3" part="nbr"/><lit-tag v="sg"/></let> <!-- samsvar med detexpl -->
        <let><clip pos="3" part="gen"/><lit-tag v="nt"/></let>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><lit v="vblex"/><lit-tag v="vblex"/><clip pos="2" part="temps"/><clip pos="3" part="chcontent"/></chunk>
          <b/>
          <chunk><lit v="prn"/><lit-tag v="prn.pers.p3.un.sg.nom.@subj"/><lit v="{^ein"/><lit-tag v="prn.pers.p3.un.sg.nom"/><lit v="$}"/></chunk>
        </out>
        <reject-current-rule shifting="3"/> <!-- let the noun etc. be handled by following rules -->
      </action>
    </rule>

    <!-- Possessive noun phrases -->


    <!-- The regular possessive noun phrases, with more complex
         transfer operations.-->
    <rule comment="PREP_GEN NGEN: [til] mannens => mannens
                   Very heuristic fallback rule.
                   If we can't match with the below rules, drop the preposition and
                   leave it genitive.
                   A bit more fluent where eg. input is incomplete:
                   - mannens *sykkel => mannens *sykkel
                   - ektefellenes og deres aksjeforhold → ektefellanes og deira aksjeforhold">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <let><clip pos="2" part="a_casedrop"/><lit v=""/></let>
        <let><clip pos="2" part="a_defdrop"/><lit v=""/></let>
        <out>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="PREP_GEN DET: [til] det => det sin
                   Fallback, like above">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="det"/>
      </pattern>
      <action>
        <out>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
        </out>
        <call-macro n="out_sin"><with-param pos="2"/></call-macro>
        <!-- TODO: keep case instead? ie. strip the casedrop -->
      </action>
    </rule>
    <rule comment="DETNONPOS PREP_GEN NGEN: det [til] forfatterskapets => den forfattarskapen sin">
      <pattern>
        <pattern-item n="detnonpos"/>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <let><clip pos="3" part="a_casedrop"/><lit v=""/></let>
        <let><clip pos="3" part="a_defdrop"/><lit v=""/></let>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="NDEF: (lille) mennesket => (vesle) mennesket
                   Used to output a determiner with out_det_when_adj, but this lead to
                   some odd problems.">
      <pattern>
        <pattern-item n="ndef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="modify_case_detpos"><with-param pos="1"/><with-param pos="1"/></call-macro>
        <out>
          <chunk>
            <clip pos="1" part="whole"/>
          </chunk>
        </out>
      </action>
    </rule>

    <rule comment="PRNPOS_DETPOS_NDEF CNJCOO_NOT_CLB PREP_GEN NGEN
                   deres og ektefellenes avtaler → deira og til ektefellene avtalar → deira og ektefellenes avtalar
                   regjeringa og statens holdning → regjeringa og til staten haldning → regjeringa og statens haldning
                   Override below prep-moving rules.">
      <pattern>
        <pattern-item n="prnpos_detpos_ndef"/>
        <pattern-item n="cnjcoo_not_clb"/>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <let><clip pos="4" part="a_casedrop"/><lit v=""/></let>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="PREP_GEN NGEN NKEEPGENX: (for) hovedindeksens del → til hovudindeksen del → hovedindeksens del
                   Override below prep-moving rules.">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
        <pattern-item n="nkeepgenx"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <let><clip pos="2" part="a_casedrop"/><lit v=""/></let>
        <let><clip pos="3" part="a_keepgenx"/><lit v=""/></let>
        <out>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="PREP_GEN NGEN NIND CM NIND CNJCOO_NOT_CLB NIND: eldres interesser, rettigheter og behov → interessane, rettane og behova til eldre">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
        <pattern-item n="nind"/>
        <pattern-item n="cm"/>
        <pattern-item n="nind"/>
        <pattern-item n="cnjcoo_not_clb"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="7"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="3"/><with-param pos="2"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <out><chunk><clip pos="4" part="whole"/></chunk></out> <!-- cm -->
        <out><b/></out>
        <call-macro n="out_ndef"><with-param pos="5"/><with-param pos="2"/></call-macro>
        <out><b/></out>
        <out><chunk><clip pos="6" part="whole"/></chunk></out> <!-- cnjcoo -->
        <out><b/></out>                                        <!-- double <b/> since the one after the comma was empty -->
        <out><b/></out>
        <call-macro n="out_ndef"><with-param pos="7"/><with-param pos="2"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="1"/><with-param pos="7"/></call-macro>
        <out><b/></out>
        <out><chunk><clip pos="2" part="whole"/></chunk></out> <!-- ngen -->
      </action>
    </rule>

    <rule comment="PREP_GEN NGEN NIND: naboens bil => bilen til naboen
                              naboens røde bil => den røde bilen til naboen
                   nind makes sure we don't match 'min Per(np)' nor 'min bils(gen)'">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <call-macro n="apply_gendefdrop"><with-param pos="2"/><with-param pos="3"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="3"/><with-param pos="2"/></call-macro>

        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="1"/><with-param pos="3"/></call-macro>
        <let><clip pos="2" part="art"/><lit v=""/></let> <!-- don't let postchunk alter defnes of previously-genitive phrase (important for conjunctions of ind+def, e.g. barn og unge) -->
        <out><b/><chunk><clip pos="2" part="whole"/></chunk></out>
      </action>
    </rule>

    <rule comment="PREP_GEN NGEN NSPLIT CNJCOO NIND: naboens bil- og båtkvern => bil- og båtkvernen til naboen
                   verdens kraftigste informasjons- og kommunikasjonsteknologi => verdast kraftigaste informasjons- og kommunikasjonsteknologi
                   nind makes sure we don't match 'min Per(np)' nor 'min bils(gen)'">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
        <pattern-item n="nsplit"/>
        <pattern-item n="cnjcoo"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <call-macro n="apply_gendefdrop"><with-param pos="2"/><with-param pos="5"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
        </out>
        <call-macro n="out_ndef"><with-param pos="5"/><with-param pos="3"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="1"/><with-param pos="5"/></call-macro>
        <let><clip pos="2" part="art"/><lit v=""/></let> <!-- don't let postchunk alter defnes of previously-genitive phrase (important for conjunctions of ind+def, e.g. barn og unge) -->
        <out><b/><chunk><clip pos="2" part="whole"/></chunk></out>
      </action>
    </rule>

    <rule comment="DETQNT NDEF_OR_NP_PERS sin NIND: alle dagligvarekjedene sine program → alle daglegvarekjedene sine program
                   Also include unknowns: alle *alfdj sin måte → alle *alfdj sin måte

                   Hard to know which word «sin» belongs to, but typically the last one.">
      <pattern>
        <pattern-item n="detqnt"/>
        <pattern-item n="ndef_OR_np_agent"/>
        <pattern-item n="sin"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="NDEF_OR_NP_PERS sin NIND: dagligvarekjeden sin butikk → daglegvarekjeda sin butikk
                   Also include unknowns: *alfdj sin måte → *alfdj sin måte

                   Hard to know which word «sin» belongs to, but typically the last one.">
      <pattern>
        <pattern-item n="ndef_OR_np_agent"/>
        <pattern-item n="sin"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DET PREP_GEN NXGEN NIND: de rødgrønnes krig → krigen til dei raudgrøne">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="prep_gen"/>
        <pattern-item n="nxgen"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="4"/><with-param pos="1"/></call-macro>

        <call-macro n="out_ndef"><with-param pos="4"/><with-param pos="3"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="2"/><with-param pos="4"/></call-macro>
        <out><b/></out>
        <out><chunk><clip pos="1" part="whole"/></chunk></out>
        <out><b/></out>
        <out><chunk><clip pos="3" part="whole"/></chunk></out>
      </action>
    </rule>

    <rule comment="NDEF DETPOS_KEEP NIND: dagligvarekjeden sin første søndagsåpne butikk
                   detpos most likely applies to second noun phrase (frequently right, sometimes wrong!)">
      <pattern>
        <pattern-item n="ndef"/>
        <pattern-item n="detpos_keep"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="DETPOS_KEEP CNCJCOO DETPOS_KEEP NIND: din og min lommebok → di og mi lommebok">
      <pattern>
        <pattern-item n="detpos_keep"/>
        <pattern-item n="cnjcoo"/>
        <pattern-item n="detpos_keep"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="DETPOS_KEEP NIND: mot sin vilje => mot sin vilje
                   Override DETPOS NIND_NOGEN rule">
      <pattern>
        <pattern-item n="detpos_keep"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="DETPOS KEEPSIN_NIND: min klare og urikkelige overbevisning → mi klare og urikkelege overtying
                   Override DETPOS NIND_NOGEN rule">
      <pattern>
        <pattern-item n="detpos"/>
        <pattern-item n="keepsin_nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DETPOS NIND_NOGEN: min mor => mora mi
                                      ditt hus => huset ditt
                   nind_nogen makes sure we don't match 'min Per(np)' nor 'min bils(gen)' or 'våre dyrs beste'
                   Second example shows how determiners ..um..determine number.">
      <pattern>
        <pattern-item n="detpos"/>
        <pattern-item n="nind_nogen"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="2"/><with-param pos="1"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="2"/><with-param pos="1"/></call-macro>

        <call-macro n="modify_det_gender2.n.det"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <out>
          <b/>
          <chunk><clip pos="1" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="DETPOS DETQNT NIND_NOGEN: sine fire barn → dei fire barna sine">
      <pattern>
        <pattern-item n="detpos"/>
        <pattern-item n="detqntpl_def"/>
        <pattern-item n="nind_nogen"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="3"/><with-param pos="1"/></call-macro>

        <call-macro n="out_det"><with-param pos="3"/><with-param pos="1"/></call-macro>  <!-- dei -->
        <out><chunk><clip pos="2" part="whole"/></chunk><b/></out>                       <!-- fire -->
        <call-macro n="out_ndef"><with-param pos="3"/><with-param pos="1"/></call-macro> <!-- barna -->

        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <out><b/><chunk><clip pos="1" part="whole"/></chunk></out>                       <!-- sine -->
      </action>
    </rule>

    <rule comment="DETSAMTLIGE NIND_NOGEN: samtlige røde hus → alle dei raude husa
                                           samtlige hus → alle hus">
      <pattern>
        <pattern-item n="detsamtlige_def"/>
        <pattern-item n="nind_nogen"/>
      </pattern>
      <action>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
        </out>
        <choose>
          <when>
            <test><begins-with><clip pos="2" part="lem"/><lit v="NO"/></begins-with>
            </test>
            <call-macro n="set_ana"><with-param pos="2"/></call-macro>
            <out><chunk><clip pos="2" part="whole"/></chunk></out>
          </when>
          <otherwise>
            <call-macro n="set_ana"><with-param pos="2"/></call-macro>
            <call-macro n="out_det_when_adjlike"><with-param pos="2"/><with-param pos="2"/></call-macro>
            <call-macro n="out_ndef"><with-param pos="2"/><with-param pos="2"/></call-macro>
          </otherwise>
        </choose>
      </action>
    </rule>
    <rule comment="DETSAMTLIGE DETQNTUNPL NIND_NOGEN: samtlige 90 hus → alle dei 90 husa">
      <pattern>
        <pattern-item n="detsamtlige_def"/>
        <pattern-item n="detqntunpl"/>
        <pattern-item n="nind_nogen"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
        </out>
        <call-macro n="out_det_when_adjlike"><with-param pos="2"/><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
        </out>
        <call-macro n="out_ndef"><with-param pos="3"/><with-param pos="3"/></call-macro>
      </action>
    </rule>
    <rule comment="DETSAMTLIGE NGEN NIND_NOGEN: samtlige av landets hus → alle i landet hus → alle husa i landet">
      <pattern>
        <pattern-item n="detsamtlige_def"/>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
        <pattern-item n="nind_nogen"/>
      </pattern>
      <action>
        <let><clip pos="4" part="nbr"/><lit-tag v="pl"/></let>
        <let><clip pos="4" part="tags"/><concat><clip pos="4" part="tags"/><lit-tag v="chunknum"/></concat></let>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
        </out>
        <call-macro n="out_det_when_adjlike"><with-param pos="4"/><with-param pos="2"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="4"/><with-param pos="2"/></call-macro>
        <out>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>


    <rule comment="PREP_GEN NGEN PREP_GEN NGEN NIND: [på] kjøkkenets [til] katts snute => snuten til katten på kjøkkenet">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
	<pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="5"/><with-param pos="2"/></call-macro>
        <call-macro n="apply_gendefdrop"><with-param pos="2"/><with-param pos="5"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="5"/><with-param pos="2"/></call-macro>

        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="3"/><with-param pos="5"/></call-macro> <!-- 5=_snuten_ til katten -->
        <out><b/></out>
        <call-macro n="out_det_when_adjlike"><with-param pos="4"/><with-param pos="4"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="4"/><with-param pos="4"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="1"/><with-param pos="4"/></call-macro> <!-- 4=_katten_ på kjøkkenet -->
        <out><b/></out>
        <call-macro n="out_det_when_adjlike"><with-param pos="2"/><with-param pos="2"/></call-macro>
        <out><chunk><clip pos="2" part="whole"/></chunk></out>
      </action>
    </rule>
    <rule comment="DETPOS PREP_GEN NGEN NIND: min [til] katts snute => snuten til katten min
                                     (but not *'min din snute')">
      <pattern>
	<pattern-item n="detpos"/>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
	<pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <call-macro n="apply_gendefdrop"><with-param pos="3"/><with-param pos="4"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="4"/><with-param pos="1"/></call-macro>

        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="2"/><with-param pos="4"/></call-macro> <!-- 4=_snuten_ til katten -->
        <out><b/></out>
        <call-macro n="out_det_when_adjlike"><with-param pos="3"/><with-param pos="3"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="3"/><with-param pos="3"/></call-macro>

        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <out>
          <b/>
          <chunk><clip pos="1" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="PREP_GEN NGEN DETNONPOS NIND:
                   toppens mange hunder =1> på toppen mange hunder =2> dei mange hundane på toppen
                   nind makes sure we don't match 'min Per(np)' nor 'min bils(gen)'">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
        <pattern-item n="detnonpos"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <call-macro n="apply_gendefdrop"><with-param pos="2"/><with-param pos="4"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
        </out>
        <call-macro n="out_ndef"><with-param pos="4"/><with-param pos="4"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="1"/><with-param pos="4"/></call-macro> <!-- 4=_hundane_ på toppen -->
        <out><b/></out>
        <out><chunk><clip pos="2" part="whole"/></chunk></out>
      </action>
    </rule>
    <rule comment="PREP_GEN NGEN DETQNTPL NPL ANOM_IND:
                   prinsens tre dager lange reise =1> til prinsen tre dager lange reise =2> den tre dagar lange reisa til prinsen">
      <pattern>
        <pattern-item n="prep_gen"/> <!--1 til-->
        <pattern-item n="ngen"/>     <!--2 prinsen -->
        <pattern-item n="detqntpl"/> <!--3 tre -->
        <pattern-item n="nplind"/>   <!--4 dager -->
        <pattern-item n="anom_ind"/> <!--5 lange reise-->
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <call-macro n="apply_gendefdrop"><with-param pos="2"/><with-param pos="5"/></call-macro>

        <call-macro n="out_det3"><with-param pos="5"/><with-param pos="3"/><with-param pos="5"/></call-macro>
        <modify-case><clip pos="3" part="lemh"/><lit v="aa"/></modify-case>
        <out>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
          <b/>
        </out>
        <call-macro n="out_ndef"><with-param pos="5"/><with-param pos="5"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="1"/><with-param pos="5"/></call-macro> <!-- 5=_reise_ -->
        <out><b/></out>
        <out><chunk><clip pos="2" part="whole"/></chunk></out>
      </action>
    </rule>

    <rule comment="sin DETEMPH PREP_GEN NGEN NIND: sin egen administrasjons innsats → innsatsen til sin egen administrasjon">
      <pattern>
        <pattern-item n="sin"/>
        <pattern-item n="detemph"/>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <call-macro n="out_det_when_adjlike"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="5"/><with-param pos="1"/></call-macro>

        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="2"/></call-macro>
        <out>
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="PREP_GEN NGEN DETEMPH NIND: naboens egen bil => naboen sin eigen bil
                                          naboens egne røde bil => naboen sin eigne raude bil
                                          naboens egne røde biler => naboen sin eigne raude bilar
                                          naboens eget fly => naboen sitt eige fly
                                          klubbens egen nettside => klubbben si eiga nettside
                   nind makes sure we don't match 'min Per(np)' nor 'min bils(gen)'">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngen"/>
        <pattern-item n="detemph"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="set_det_gender1.n"><with-param pos="4"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="3"/></call-macro>
        <out>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk>               <!-- Introducing Garpegenitiv: -->
            <lit v="detsin"/>
            <lit-tag v="det.pos"/>
            <var n="det_gender"/>
            <var n="number_no_sp"/>
            <lit v="{^"/>
                <lit v="sin"/>
                <lit-tag v="det.pos"/>
                <var n="det_gender"/>
                <var n="number_no_sp"/>
            <lit v="$}"/>
          </chunk>
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DETALL PREP_GEN NGENSGDEF NPLIND: alle [til] kommunen idrettslag => alle [dei] idrettslaga til kommunen">
      <pattern>
	<pattern-item n="detall"/>
	<pattern-item n="prep_gen"/>
	<pattern-item n="ngensgdef"/>
	<pattern-item n="nplind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <out><chunk><clip pos="1" part="whole"/></chunk><b/></out>
        <call-macro n="out_det_when_adjlike"><with-param pos="4"/><with-param pos="2"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="4"/><with-param pos="4"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="2"/><with-param pos="4"/></call-macro>
        <out><b/><chunk><clip pos="3" part="whole"/></chunk></out>
      </action>
    </rule>
    <rule comment="DETQNTPL PREP_GEN NGENSGDEF NPLIND: mange [til] kommunen idrettslag => [dei] mange idrettslaga til kommunen
                   As above rule, but opposite order of out_det_when_adjlike and detqntpl">
      <pattern>
	<pattern-item n="detqntpl"/>
	<pattern-item n="prep_gen"/>
	<pattern-item n="ngensgdef"/>
	<pattern-item n="nplind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="out_det_when_adjlike"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <out><chunk><clip pos="1" part="whole"/></chunk><b/></out>
        <call-macro n="out_ndef"><with-param pos="4"/><with-param pos="4"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="2"/><with-param pos="4"/></call-macro>
        <out><b/><chunk><clip pos="3" part="whole"/></chunk></out>
      </action>
    </rule>
    <rule comment="DETNONPOS PREP_GEN NGEN NIND: en [til] katts snute => snuten til ein katt">
      <pattern>
	<pattern-item n="detnonpos"/>
	<pattern-item n="prep_gen"/>
	<pattern-item n="ngen"/>
	<pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <call-macro n="apply_gendefdrop"><with-param pos="3"/><with-param pos="4"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="4"/><with-param pos="1"/></call-macro>

        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="2"/><with-param pos="4"/></call-macro>
        <let><clip pos="3" part="art"/><lit v=""/></let> <!-- don't let postchunk alter defnes of previously-genitive phrase (important for conjunctions of ind+def, e.g. barn og unge) -->
        <out><b/><chunk><clip pos="1" part="whole"/></chunk></out>
        <out><b/><chunk><clip pos="3" part="whole"/></chunk></out>
      </action>
    </rule>
    <rule comment="DETNONPOS DETNONPOS PREP_GEN NGEN NIND: den forrige [til] Lamaens bil => bilen til den forrige Lamaen">
      <pattern>
	<pattern-item n="detnonpos"/>
	<pattern-item n="detnonpos"/>
	<pattern-item n="prep_gen"/>
	<pattern-item n="ngen"/>
	<pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <call-macro n="apply_gendefdrop"><with-param pos="4"/><with-param pos="5"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="5"/><with-param pos="1"/></call-macro>

        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="2"/></call-macro>
        <out><b/></out>
        <call-macro n="out_bi-gen-prep"><with-param pos="3"/><with-param pos="5"/></call-macro>
        <out><b/><chunk><clip pos="1" part="whole"/></chunk></out>
        <out><b/><chunk><clip pos="2" part="whole"/></chunk></out>
        <out><b/><chunk><clip pos="4" part="whole"/></chunk></out>
      </action>
    </rule>

    <rule comment="PREP_GEN NGENDEForPL NIND PREP_NHEAD
                   næringslivets tillit til de rådende myndigheter → til næringslivet tillita de rådende myndigheter → tillita næringslivet har til dei rådande styresmaktene
                   drop the prep_gen from t1x and rewrite with «har»">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngendefORpl"/>
        <pattern-item n="nind"/>
        <pattern-item n="prep_nhead"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="3"/><with-param pos="2"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <call-macro n="out_ndef"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <out>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk>
            <lit v="vblex"/>
            <lit-tag v="vblex"/>
            <var n="ana_temps"/>
            <lit v="{^ha"/>
            <lit-tag v="vblex"/>
            <var n="ana_temps"/>
            <lit v="$}"/>
          </chunk>
          <b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="PREP_GEN NGENDEForPL DETNONPOS NIND PREP_NHEAD
                   senterets 13 millioner i → til senteret 13 millioner i → de 13 millioner senteret har
                   drop the prep_gen from t1x and rewrite with «har»">
      <pattern>
        <pattern-item n="prep_gen"/>
        <pattern-item n="ngendefORpl"/>
        <pattern-item n="detnonpos"/>
        <pattern-item n="nind"/>
        <pattern-item n="prep_nhead"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <call-macro n="switch_cases"><with-param pos="3"/><with-param pos="2"/></call-macro>

        <call-macro n="out_det_when_adjlike"><with-param pos="3"/><with-param pos="2"/></call-macro>
        <out>
          <chunk><clip pos="3" part="whole"/></chunk>
          <b/>
        </out>
        <call-macro n="out_ndef"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <out>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk>
            <lit v="vblex"/>
            <lit-tag v="vblex"/>
            <var n="ana_temps"/>
            <lit v="{^ha"/>
            <lit-tag v="vblex"/>
            <var n="ana_temps"/>
            <lit v="$}"/>
          </chunk>
          <b/>
          <chunk><clip pos="5" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="NDEF DETPOS: jenten min => jenta mi">
      <pattern>
        <pattern-item n="ndef"/>
        <pattern-item n="detpos"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="1"/><with-param pos="2"/></call-macro>
        <let><clip pos="1" part="gen_prep_override"/><lit v=""/></let>
        <let><clip pos="1" part="tags"/><concat><clip pos="1" part="tags"/><lit-tag v="po_sin"/></concat></let> <!-- notify t3x that we have a post-possessive -->
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DETENHVER NOM: enhver sak → alle sak → alle saker
                   (Override general DET NOM rule)">
      <pattern>
        <pattern-item n="detenhver"/>
        <pattern-item n="nom_advnom"/>
      </pattern>
      <action>
        <let><clip pos="2" part="nbr"/><clip pos="1" part="nbr"/></let>
        <let><clip pos="2" part="tags"/><concat><clip pos="2" part="tags"/><lit-tag v="chunknum"/></concat></let>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <choose><when c="only set ana based on det if no ana, or if n is def">
          <test><or>
            <equal><var n="ana_nbr"/><lit v=""/></equal>
            <equal><clip pos="2" part="art"/><lit-tag v="def"/></equal>
          </or></test>
          <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        </when></choose>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="DETENHVER NOM AUX ADJSG: enhver aksjon er uakseptabel → alle sak er uakseptabel → alle saker er uakseptable">
      <pattern>
        <pattern-item n="detenhver"/>
        <pattern-item n="nom_advnom"/>
        <pattern-item n="aux"/>
        <pattern-item n="adjsg"/>
      </pattern>
      <action>
        <let><clip pos="2" part="nbr"/><clip pos="1" part="nbr"/></let>
        <let><clip pos="2" part="tags"/><concat><clip pos="2" part="tags"/><lit-tag v="chunknum"/></concat></let>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <choose><when c="only set ana based on det if no ana, or if n is def">
          <test><or>
            <equal><var n="ana_nbr"/><lit v=""/></equal>
            <equal><clip pos="2" part="art"/><lit-tag v="def"/></equal>
          </or></test>
          <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        </when></choose>

        <let><clip pos="4" part="nbr"/><clip pos="1" part="nbr"/></let>
        <let><clip pos="4" part="tags"/><concat><clip pos="4" part="tags"/><lit-tag v="chunknum"/></concat></let>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="DETENHVER NOM AUX ADJSG: enhver aksjon vil være uakseptabel → alle sak vil vere uakseptabel → alle saker vil vere uakseptable">
      <pattern>
        <pattern-item n="detenhver"/>
        <pattern-item n="nom_advnom"/>
        <pattern-item n="aux"/>
        <pattern-item n="aux"/>
        <pattern-item n="adjsg"/>
      </pattern>
      <action>
        <let><clip pos="2" part="nbr"/><clip pos="1" part="nbr"/></let>
        <let><clip pos="2" part="tags"/><concat><clip pos="2" part="tags"/><lit-tag v="chunknum"/></concat></let>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <choose><when c="only set ana based on det if no ana, or if n is def">
          <test><or>
            <equal><var n="ana_nbr"/><lit v=""/></equal>
            <equal><clip pos="2" part="art"/><lit-tag v="def"/></equal>
          </or></test>
          <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        </when></choose>

        <let><clip pos="5" part="nbr"/><clip pos="1" part="nbr"/></let>
        <let><clip pos="5" part="tags"/><concat><clip pos="5" part="tags"/><lit-tag v="chunknum"/></concat></let>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="5" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DET NOM: en kvinne => ei kvinne
		            hvilken jente => kva for ei jente
			    egne hus => eigne hus
			    et Norge => eit Noreg
                            dette hus => dette huset
	           np får ikkje noko tal i den siste.">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="nom"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette kjernen' etc.
                   and don't use gender from first part of split compounds:
                   «Den(m) narkotika-(nt) [og korrupsjonsdømte politimannen(m)]">
            <test><or>
              <and>
                <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
                <not><equal><clip pos="2" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
              </and>
              <not><equal><clip pos="2" part="a_cmp"/><lit v=""/></equal></not>
            </or></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <call-macro n="set_n_defness"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>


    <rule comment="ved DETDEM ADJ_NOM: ved den minste lyd → ved den minste lyd
	           La stå som ubestemt her">
      <pattern>
        <pattern-item n="prep_ved"/>
        <pattern-item n="detdem"/>
        <pattern-item n="nom_sup"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette kjernen' etc.
                   and don't use gender from first part of split compounds:
                   «Den(m) narkotika-(nt) [og korrupsjonsdømte politimannen(m)]">
            <test><or>
              <and>
                <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
                <not><equal><clip pos="2" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
              </and>
              <not><equal><clip pos="2" part="a_cmp"/><lit v=""/></equal></not>
            </or></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="2" part="whole"/></chunk>
          <b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>


    <rule comment="DET ADVLADJ ANOM_DEF: det sterkt høyreorienterte nettstedet → den sterkt høgreorienterte nettstaden">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="advladj"/>
        <pattern-item n="anom_def"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette kjernen' etc.">
            <test><and>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
              <not><equal><clip pos="3" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
            </and></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <!-- pos=2 is adverbial, so no gender change -->
        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <call-macro n="set_n_defness"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DET ADV NOM: et meget stort antall => ei særs stor mengd">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="adv"/>
        <pattern-item n="nom"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette kjernen' etc.">
            <test><and>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
              <not><equal><clip pos="3" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
            </and></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <call-macro n="set_n_defness"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <choose>
          <when c="en ubevoktet planovergang → en planovergang uten tilsyn">
            <test><equal><clip pos="2" part="n-movable"/><lit-tag v="n-movable"/></equal></test>
            <out>
              <chunk><clip pos="1" part="whole"/></chunk><b/>
              <chunk><clip pos="3" part="whole"/></chunk><b/>
              <chunk><clip pos="2" part="whole"/></chunk>
            </out>
          </when>
          <otherwise>
            <out>
              <chunk><clip pos="1" part="whole"/></chunk><b/>
              <chunk><clip pos="2" part="whole"/></chunk><b/>
              <chunk><clip pos="3" part="whole"/></chunk>
            </out>
          </otherwise>
        </choose>
      </action>
    </rule>

    <rule comment="DET ADVLADJ ADVLADJ NOM: en hardt presset Theresa May → ei hardt pressa Theresa May">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="advladj"/>
        <pattern-item n="advladj"/>
        <pattern-item n="nom"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette kjernen' etc.">
            <test><and>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
              <not><equal><clip pos="4" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
            </and></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <call-macro n="set_n_defness"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <choose>
          <when c="en ubevoktet planovergang → en planovergang uten tilsyn">
            <test><equal><clip pos="2" part="n-movable"/><lit-tag v="n-movable"/></equal></test>
            <out>
              <chunk><clip pos="1" part="whole"/></chunk><b/>
              <chunk><clip pos="3" part="whole"/></chunk><b/>
              <chunk><clip pos="4" part="whole"/></chunk><b/>
              <chunk><clip pos="2" part="whole"/></chunk>
            </out>
          </when>
          <otherwise>
            <out>
              <chunk><clip pos="1" part="whole"/></chunk><b/>
              <chunk><clip pos="2" part="whole"/></chunk><b/>
              <chunk><clip pos="3" part="whole"/></chunk><b/>
              <chunk><clip pos="4" part="whole"/></chunk>
            </out>
          </otherwise>
        </choose>
      </action>
    </rule>

    <rule comment="DET NCMPSPLIT CNJCOO ANOM_DEF: den narkotika- og korrupsjonstiltalte mannen">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="ncmpsplit"/>
        <pattern-item n="cnjcoo"/>
        <pattern-item n="anom_def"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <call-macro n="set_n_defness"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DET DETDEMDEF NOM: det samme nettstedet → den same nettstaden">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="detdemdef"/>
        <pattern-item n="nom"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette kjernen' etc.">
            <test><and>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
              <not><equal><clip pos="3" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
            </and></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <!-- pos=2 needs no gender change -->
        <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <call-macro n="set_n_defness"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DETITG DETQNT PREP_SOM ADV NOM: et hvilket som helst norsk hjem → ein kva som helst norsk heim
                   Agree gender.">
      <pattern>
        <pattern-item n="detqnt"/>
        <pattern-item n="detitg"/>
        <pattern-item n="prep_som"/>
        <pattern-item n="adv"/>
        <pattern-item n="nom"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette kjernen' etc.">
            <test><and>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
              <not><equal><clip pos="5" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
            </and></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="5"/><with-param pos="2"/></call-macro>
        <call-macro n="set_n_defness"><with-param pos="5"/><with-param pos="2"/></call-macro>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <call-macro n="set_n_defness"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="5" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DETITG PR_AV NOM: hvilken av de to utleveringsbegjæringene → kva for eit av dei to utleveringskrava">
      <pattern>
        <pattern-item n="detitg"/>  <!--1-->
        <pattern-item n="prep_av"/> <!--2-->
        <pattern-item n="detdem"/>  <!--3-->
        <pattern-item n="detqnt"/>  <!--4-->
        <pattern-item n="nom"/>     <!--5-->
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette kjernen' etc.">
            <test><and>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
              <not><equal><clip pos="5" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
            </and></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <call-macro n="set_n_defness"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="5" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DET2ADJ NOM: (som) en hvilken som helst annen sak → (som) alle andre sak → (som) alle andre saker">
      <pattern>
        <pattern-item n="det2adj"/>
        <pattern-item n="nom_advnom"/>
      </pattern>
      <action>
        <let><clip pos="2" part="nbr"/><clip pos="1" part="nbr"/></let>
        <let><clip pos="2" part="tags"/><concat><clip pos="2" part="tags"/><lit-tag v="chunknum"/></concat></let>
        <call-macro n="modify_det_gender2.n.det"><with-param pos="2"/><with-param pos="1"/></call-macro>
        <choose><when c="only set ana based on det if no ana, or if n is def">
          <test><or>
            <equal><var n="ana_nbr"/><lit v=""/></equal>
            <equal><clip pos="2" part="art"/><lit-tag v="def"/></equal>
          </or></test>
          <call-macro n="set_ana"><with-param pos="2"/></call-macro>
        </when></choose>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="NIND CNJSUB_som: bomullspinner som → bomullspinnar som
                   set_ana even if indefinite if following word is 'som'">
      <pattern>
        <pattern-item n="nind"/>
        <pattern-item n="cnjsub_som"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="NOM: synspunkt
                   Just set_ana">
      <pattern>
        <pattern-item n="nom"/>
      </pattern>
      <action>
        <choose><when c="only set ana based on det if no ana, or if n is def">
          <test><or>
            <equal><var n="ana_nbr"/><lit v=""/></equal>
            <equal><clip pos="1" part="art"/><lit-tag v="def"/></equal>
          </or></test>
          <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        </when></choose>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DETIND DETIND NIND: en annen kvinne => ei anna kvinne">
      <pattern>
        <pattern-item n="detind"/>
        <pattern-item n="detind"/>
        <pattern-item n="nind"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <choose><when c="don't change gender for 'det andre kvinner' etc.">
          <test>
            <or>
              <and>
                <in><clip pos="1" part="gen"/><list n="nt_GD"/></in>
                <in><clip pos="3" part="sl-gen"/><list n="nt_GD"/></in>
              </and>
              <and>
                <in><clip pos="1" part="gen"/><list n="m_f_mf_GD"/></in>
                <in><clip pos="3" part="sl-gen"/><list n="m_f_mf_GD"/></in>
              </and>
            </or>
          </test>
          <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="1"/></call-macro>
        </when></choose>
        <choose><when c="don't change gender for 'den eget kvinner' etc.">
          <test>
            <or>
              <and>
                <in><clip pos="2" part="gen"/><list n="nt_GD"/></in>
                <in><clip pos="3" part="sl-gen"/><list n="nt_GD"/></in>
              </and>
              <and>
                <in><clip pos="2" part="gen"/><list n="m_f_mf_GD"/></in>
                <in><clip pos="3" part="sl-gen"/><list n="m_f_mf_GD"/></in>
              </and>
            </or>
          </test>
          <call-macro n="modify_det_gender2.n.det"><with-param pos="3"/><with-param pos="2"/></call-macro>
        </when></choose>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DET PREP_AV NPLDEF: en av kvinnene => ei av kvinnene">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="prep_av"/>
        <pattern-item n="npldef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="3"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette av kjernen' etc.">
            <test><and>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
              <not><equal><clip pos="3" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
            </and></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <choose c="can't use modify_det_gender2.n.det since that disallows plural nouns">
          <when>
            <test><and>
              <not><equal><clip pos="3" part="gen"/><lit v=""/></equal></not>
              <not><equal><clip pos="1" part="nbr"/><lit-tag v="pl"/></equal></not>
            </and></test>
            <let><clip pos="1" part="gen"/><clip pos="3" part="gen"/></let>
          </when>
        </choose>
        <call-macro n="set_n_defness"><with-param pos="3"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DET PREP_AV DETDEM NPLDEF: en av de siste kvinnene => ei av dei siste kvinnene">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="prep_av"/>
        <pattern-item n="detdem"/>
        <pattern-item n="npldef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="4"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette av kjernen' etc.">
            <test><and>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
              <not><equal><clip pos="4" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
            </and></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <choose c="can't use modify_det_gender2.n.det since that disallows plural nouns">
          <when>
            <test><and>
              <not><equal><clip pos="4" part="gen"/><lit v=""/></equal></not>
              <not><equal><clip pos="1" part="nbr"/><lit-tag v="pl"/></equal></not>
            </and></test>
            <let><clip pos="1" part="gen"/><clip pos="4" part="gen"/></let>
          </when>
        </choose>
        <call-macro n="set_n_defness"><with-param pos="4"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DET PREP_AV DETDEM DETQNT NPLDEF: en av de tre siste kvinnene => ei av dei tre siste kvinnene">
      <pattern>
        <pattern-item n="det"/>
        <pattern-item n="prep_av"/>
        <pattern-item n="detdem"/>
        <pattern-item n="detqnt"/>
        <pattern-item n="npldef"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="5"/></call-macro>
        <choose>
          <when c="don't change gender for '(er) dette av kjernen' etc.">
            <test><and>
              <equal><clip pos="1" part="gen"/><lit-tag v="nt"/></equal>
              <not><equal><clip pos="5" part="sl-gen"/><lit-tag v="sl-nt"/></equal></not>
            </and></test>
            <reject-current-rule shifting="0"/>
          </when>
        </choose>
        <choose c="can't use modify_det_gender2.n.det since that disallows plural nouns">
          <when>
            <test><and>
              <not><equal><clip pos="5" part="gen"/><lit v=""/></equal></not>
              <not><equal><clip pos="1" part="nbr"/><lit-tag v="pl"/></equal></not>
            </and></test>
            <let><clip pos="1" part="gen"/><clip pos="5" part="gen"/></let>
          </when>
        </choose>
        <call-macro n="set_n_defness"><with-param pos="5"/><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk><b/>
          <chunk><clip pos="3" part="whole"/></chunk><b/>
          <chunk><clip pos="4" part="whole"/></chunk><b/>
          <chunk><clip pos="5" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DETQNT CNJSUB_som: noe som betegnes → noko som blir karakterisert[sg]
                   set_ana on det">
      <pattern>
        <pattern-item n="detqnt"/>
        <pattern-item n="cnjsub_som"/>
      </pattern>
      <action>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk><b/>
          <chunk><clip pos="2" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="DET">
      <pattern>
        <pattern-item n="det"/>
      </pattern>
      <action>
        <choose><when c="only set ana based on det if no ana, or if det is expl">
          <test><or>
            <equal><var n="ana_nbr"/><lit v=""/></equal>
            <equal><clip pos="1" part="a_expl"/><lit-tag v="expl"/></equal>
          </or></test>
          <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        </when></choose>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
        </out>
      </action>
    </rule>
    <rule comment="PRN">
      <pattern>
        <pattern-item n="prn"/>
      </pattern>
      <action>
        <call-macro n="modify_prn_gen"><with-param pos="1"/></call-macro>
        <call-macro n="set_ana"><with-param pos="1"/></call-macro>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
        </out>
      </action>
    </rule>

    <rule comment="SENT">
      <pattern>
        <pattern-item n="sent"/>
      </pattern>
      <action>
        <let><var n="ana_nbr"/><lit v=""/></let>
        <let><var n="ana_gen"/><lit v=""/></let>
        <out>
          <chunk><clip pos="1" part="whole"/></chunk>
        </out>
      </action>
    </rule>

  </section-rules>
</interchunk>