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
|
incomplete concrete NounScand of Noun =
CatScand ** open CommonScand, ResScand, Prelude in {
flags optimize=all_subs ;
-- The rule defines $Det Quant Num Ord CN$ where $Det$ is empty if
-- it is the definite article ($DefSg$ or $DefPl$) and both $Num$ and
-- $Ord$ are empty and $CN$ is not adjectivally modified
-- ($AdjCN$). Thus we get $huset$ but $de fem husen$, $det gamla huset$.
lin
DetCN det cn =
let
g = cn.g ;
m = cn.isMod ;
dd = case <det.det,detDef,m> of {
<DDef Def, Indef, True> => DDef Indef ;
<d,_,_> => d
}
in {
s = \\c => det.s ! m ! g ++
cn.s ! det.n ! dd ! caseNP c ;
a = agrP3 g det.n
} ;
UsePN pn = {
s = \\c => pn.s ! caseNP c ;
a = agrP3 pn.g Sg
} ;
UsePron p = p ;
PredetNP pred np = {
s = \\c => pred.s ! np.a.gn ++ np.s ! c ;
a = np.a
} ;
PPartNP np v2 = {
s = \\c => np.s ! c ++ v2.s ! (VI (VPtPret (agrAdj np.a.gn DIndef) Nom)) ;
a = np.a
} ;
AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s ;
a = np.a
} ;
DetQuantOrd quant num ord = {
s = \\b,g => quant.s ! num.n ! b ! (orB b num.isDet) ! g ++
num.s ! g ++ ord.s ;
sp = \\b,g => quant.s ! num.n ! b ! (orB b num.isDet) ! g ++
num.s ! g ++ ord.s ;
n = num.n ;
det = quant.det
} ;
DetQuant quant num =
let
md : Bool -> Bool = \b -> case quant.det of {
DDef _ => orB b num.isDet ;
DIndef => num.isDet ;
_ => False
}
in {
s = \\b,g => quant.s ! num.n ! b ! md b ! g ++
num.s ! g ;
sp = \\b,g => quant.sp ! num.n ! b ! md b ! g ++
num.s ! g ;
n = num.n ;
det = quant.det
} ;
DetNP det =
let
g = Neutr ; ----
m = True ; ---- is this needed for other than Art?
in {
s = \\c => det.sp ! m ! g ;
a = agrP3 g det.n
} ;
PossPron p = {
s,sp = \\n,_,_,g => p.s ! NPPoss (gennum g n) ;
det = DDef Indef
} ;
NumCard c = c ** {isDet = True} ;
NumSg = {s = \\_ => [] ; isDet = False ; n = Sg} ;
NumPl = {s = \\_ => [] ; isDet = False ; n = Pl} ;
NumDigits nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
OrdDigits nu = {s = nu.s ! NOrd SupWeak} ;
NumNumeral nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
OrdNumeral nu = {s = nu.s ! NOrd SupWeak} ;
AdNum adn num = {s = \\g => adn.s ++ num.s ! g ; isDet = True ; n = num.n} ;
OrdSuperl a = {
s = case a.isComp of {
True => "mest" ++ a.s ! AF (APosit (Weak Sg)) Nom ;
_ => a.s ! AF (ASuperl SupWeak) Nom
} ;
isDet = True
} ;
DefArt = {
s = \\n,bm,bn,g => if_then_Str (orB bm bn) (artDef (gennum g n)) [] ;
sp = \\n,bm,bn,g => artDef (gennum g n) ;
det = DDef Def
} ;
IndefArt = {
s = table {
Sg => \\_,bn,g => if_then_Str bn [] (artIndef ! g) ;
Pl => \\_,bn,_ => []
} ;
sp = table {
Sg => \\_,bn,g => artIndef ! g ;
Pl => \\_,bn,_ => detIndefPl
} ;
det = DIndef
} ;
MassNP cn = {
s = \\c => cn.s ! Sg ! DIndef ! caseNP c ;
a = agrP3 cn.g Sg
} ;
UseN, UseN2 = \noun -> {
s = \\n,d,c => noun.s ! n ! specDet d ! c ;
---- part app wo c shows editor bug. AR 8/7/2007
g = noun.g ;
isMod = False
} ;
Use2N3 f = {
s = f.s ;
g = f.g ;
c2 = f.c2 ;
isMod = False
} ;
Use3N3 f = {
s = f.s ;
g = f.g ;
c2 = f.c3 ;
isMod = False
} ;
-- The genitive of this $NP$ is not correct: "sonen till mig" (not "migs").
ComplN2 f x = {
s = \\n,d,c => f.s ! n ! specDet d ! Nom ++ f.c2.s ++ x.s ! accusative ;
g = f.g ;
isMod = False
} ;
ComplN3 f x = {
s = \\n,d,c => f.s ! n ! d ! Nom ++ f.c2.s ++ x.s ! accusative ;
g = f.g ;
c2 = f.c3 ;
isMod = False
} ;
AdjCN ap cn = let g = cn.g in {
s = \\n,d,c =>
preOrPost ap.isPre
(ap.s ! agrAdj (gennum g n) d)
(cn.s ! n ! d ! c) ;
g = g ;
isMod = True
} ;
RelCN cn rs = let g = cn.g in {
s = \\n,d,c => cn.s ! n ! d ! c ++ rs.s ! agrP3 g n ;
g = g ;
isMod = cn.isMod
} ;
RelNP np rs = {
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
a = np.a ;
isMod = np.isMod
} ;
AdvCN cn sc = let g = cn.g in {
s = \\n,d,c => cn.s ! n ! d ! c ++ sc.s ;
g = g ;
isMod = cn.isMod
} ;
SentCN cn sc = let g = cn.g in {
s = \\n,d,c => cn.s ! n ! d ! c ++ sc.s ;
g = g ;
isMod = cn.isMod
} ;
ApposCN cn np = let g = cn.g in {
s = \\n,d,c => cn.s ! n ! d ! Nom ++ np.s ! NPNom ; --c
g = g ;
isMod = cn.isMod
} ;
}
|