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
|
--# -path=.:../abstract:../../prelude
--1 The Top-Level Russian Resource Grammar
--
-- Janna Khegai 2003
-- on the basis of code for other languages by Aarne Ranta
--
-- This is the Russian concrete syntax of the multilingual resource
-- grammar. Most of the work is done in the file $syntax.RusU.gf$.
-- However, for the purpose of documentation, we make here explicit the
-- linearization types of each category, so that their structures and
-- dependencies can be seen.
-- Another substantial part is the linearization rules of some
-- structural words.
--
-- The users of the resource grammar should not look at this file for the
-- linearization rules, which are in fact hidden in the document version.
-- They should use $resource.Abs.gf$ to access the syntactic rules.
-- This file can be consulted in those, hopefully rare, occasions in which
-- one has to know how the syntactic categories are
-- implemented. The parameter types are defined in $types.RusU.gf$.
concrete ResRus of ResAbs = open Prelude, Syntax in {
flags
coding=utf8 ;
startcat=Phr ;
lexer=text ;
unlexer=text ;
lincat
N = CommNoun ;
-- = {s : SubstForm => Str ; g : Gender ; anim : Animacy } ;
CN = CommNounPhrase ;
-- = {s : Number => Case => Str; g : Gender; anim : Animacy} ;
NP = NounPhrase ;
-- = { s : PronForm => Str ; n : Number ; p : Person ;
-- g: Gender ; anim : Animacy ; pron: Bool} ;
PN = ProperName ;
-- = {s : Case => Str ; g : Gender ; anim : Animacy} ;
Adj1 = Adjective ;
-- = {s : AdjForm => Str} ;
Det = Determiner ;
-- = Adjective ** { n: Number; c : Case } ;
Adj2 = AdjCompl ;
-- = Adjective ** Complement ;
AdjDeg = AdjDegr ;
-- = {s : Degree => AdjForm => Str} ;
AP = AdjPhrase ;
-- = Adjective ** {p : IsPostfixAdj} ;
Fun = Function ;
-- = CommNounPhrase ** Complement ;
Fun2 = Function ** {s3 : Preposition; c2: Case} ;
V = Verb ;
-- = {s : VF => Str ; t: Tense ; a : Aspect ; v: Voice} ;
VP = VerbPhrase ;
-- = Verb ** {s2 : Str ; s3 : Gender => Number => Str ;
-- negBefore: Bool} ;
TV = TransVerb ;
-- = Verb ** {s2 : Preposition ; c: Case } ;
V3 = TransVerb ** {s4 : Preposition; c2: Case} ;
VS = SentenceVerb ;
-- = Verb ;
AdV = Adverb ;
-- = {s : Str} ;
S = Sentence ;
-- = {s : Str} ;
Slash = SentenceSlashNounPhrase ;
-- = Sentence ** Complement ;
RP = RelPron ;
-- = {s : GenNum => Case => Animacy => Str} ;
RC = RelClause ;
-- = RelPron ;
IP = IntPron ;
-- = NounPhrase ;
Qu = Question ;
-- = {s : QuestForm => Str} ;
Imp = Imperative ;
-- = { s: Gender => Number => Str } ;
Phr = Utterance ;
-- = {s : Str} ;
Text = {s : Str} ;
Conj = Conjunction ;
-- = {s : Str ; n : Number} ;
ConjD = ConjunctionDistr ;
-- = {s1,s2 : Str ; n : Number} ;
ListS = ListSentence ;
-- = {s1,s2 : Mode => Str} ;
ListAP = ListAdjPhrase ;
-- = {s1,s2 : AdjForm => Str ; p : Bool} ;
ListNP = ListNounPhrase ;
-- = { s1,s2 : PronForm => Str ; g: Gender ; anim : Animacy ;
-- n : Number ; p : Person ; pron : Bool } ;
--.
lin
UsePN = nameNounPhrase ;
ComplAdj = complAdj ;
PredVP = predVerbPhrase ;
PosTV = complTransVerb True ;
NegTV = complTransVerb False ;
AdjP1 = adj2adjPhrase ;
ModAdj = modCommNounPhrase ;
PosA = predAdjective True ;
NegA = predAdjective False ;
UseN = noun2CommNounPhrase ;
ModGenOne = npGenDet Sg ;
ModGenMany = npGenDet Pl ;
UseFun = funAsCommNounPhrase ;
AppFun = appFunComm ;
PositAdjP = positAdjPhrase ;
ComparAdjP = comparAdjPhrase ;
SuperlNP = superlNounPhrase ;
DetNP = detNounPhrase ;
IndefOneNP = indefNounPhrase Sg ;
IndefManyNP = indefNounPhrase Pl ;
DefOneNP = defNounPhrase Sg ;
DefManyNP = defNounPhrase Pl ;
PosV = predVerb True ;
NegV = predVerb False ;
PosCN = predCommNoun True ;
NegCN = predCommNoun False ;
PosNP = predNounPhrase True ;
NegNP = predNounPhrase False ;
PosVS = complSentVerb True ;
NegVS = complSentVerb False ;
AdvVP = adVerbPhrase ;
LocNP = locativeNounPhrase ;
AdvCN = advCommNounPhrase ;
-- AdvAP = advAdjPhrase ;
PosSlashTV = slashTransVerb True ;
NegSlashTV = slashTransVerb False ;
IdRP = identRelPron ;
FunRP = funRelPron ;
RelVP = relVerbPhrase ;
RelSlash = relSlash ;
ModRC = modRelClause ;
RelSuch = relSuch ;
WhoOne = intPronKto Sg ;
WhoMany = intPronKto Pl ;
WhatOne = intPronChto Sg ;
WhatMany = intPronChto Pl ;
FunIP = funIntPron ;
NounIPOne = nounIntPron Sg ;
NounIPMany = nounIntPron Pl ;
QuestVP = questVerbPhrase ;
IntVP = intVerbPhrase ;
IntSlash = intSlash ;
QuestAdv = questAdverbial ;
ImperVP = imperVerbPhrase ;
IndicPhrase = indicUtt ;
QuestPhrase = interrogUtt ;
ImperOne = imperUtterance Masc Sg ;
ImperMany = imperUtterance Masc Pl ;
--AdvS = advSentence ;
TwoS = twoSentence ;
ConsS = consSentence ;
ConjS = conjunctSentence ;
ConjDS = conjunctDistrSentence ;
TwoAP = twoAdjPhrase ;
ConsAP = consAdjPhrase ;
ConjAP = conjunctAdjPhrase ;
ConjDAP = conjunctDistrAdjPhrase ;
TwoNP = twoNounPhrase ;
ConsNP = consNounPhrase ;
ConjNP = conjunctNounPhrase ;
ConjDNP = conjunctDistrNounPhrase ;
SubjS = subjunctSentence ;
SubjImper = subjunctImperative ;
SubjQu = subjunctQuestion ;
PhrNP = useNounPhrase ;
PhrOneCN = useCommonNounPhrase Sg ;
PhrManyCN = useCommonNounPhrase Pl ;
PhrIP ip = postfixSS "?" ip ;
PhrIAdv ia = postfixSS "?" ia ;
OnePhr p = p ;
ConsPhr = cc2 ;
INP = pron2NounPhrase pronYa Animate;
ThouNP = pron2NounPhrase pronTu Animate;
HeNP = pron2NounPhrase pronOn Animate;
SheNP = pron2NounPhrase pronOna Animate;
WeNP = pron2NounPhrase pronMu Animate;
YeNP = pron2NounPhrase pronVu Animate;
YouNP = pron2NounPhrase pronVu Animate;
TheyNP = pron2NounPhrase pronOni Animate;
EveryDet = kazhdujDet ** {n = Sg ; c= Nom} ;
AllDet = vseDetPl ** {n = Pl; c= Nom} ;
WhichDet = kotorujDet ** {n = Sg; c= Nom} ; -- a singular version only
MostDet = bolshinstvoDet ** {n = Pl; c= Gen} ;
HowIAdv = ss "как" ;
WhenIAdv = ss "когда" ;
WhereIAdv = ss "где" ;
WhyIAdv = ss "почему" ;
AndConj = ss "и" ** {n = Pl} ;
OrConj = ss "или" ** {n = Sg} ;
BothAnd = sd2 "как" [", так"] ** {n = Pl} ;
EitherOr = sd2 "либо" [", либо"] ** {n = Sg} ;
-- In case of "neither.. no" expression double negation is not
-- only possible, but also required in Russian.
-- There is no means of control for this however in the resource grammar.
NeitherNor = sd2 "ни" [", ни"] ** {n = Sg} ;
IfSubj = ss "если" ;
WhenSubj = ss "когда" ;
PhrYes = ss ["да ."] ;
PhrNo = ss ["нет ."] ;
VeryAdv = ss "очень" ;
TooAdv = ss "слишком" ;
OtherwiseAdv = ss "иначе" ;
ThereforeAdv = ss "следовательно" ;
} ;
|