mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-30 10:28:53 -06:00
Add files via upload
This commit is contained in:
@@ -7,31 +7,35 @@ flags coding=utf8 ;
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
PositA a = { s = a.s!Posit; p = False};
|
PositA a = { s = a.s!Posit ; p = a.p ; preferShort = a.preferShort};
|
||||||
-- Comparative forms are used with an object of comparison, as
|
-- Comparative forms are used with an object of comparison, as
|
||||||
-- adjectival phrases ("больше тебя").
|
-- adjectival phrases ("больше тебя").
|
||||||
|
|
||||||
ComparA bolshoj tu =
|
ComparA bolshoj tu =
|
||||||
{s = \\af => bolshoj.s ! Compar ! af ++ tu.s ! (mkPronForm Gen Yes NonPoss) ;
|
{s = \\af => bolshoj.s ! Compar ! af ++ tu.s ! (mkPronForm Gen Yes NonPoss) ;
|
||||||
p = True
|
p = True ;
|
||||||
|
preferShort = PrefShort
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---- AR 17/12/2008
|
---- AR 17/12/2008
|
||||||
UseComparA bolshoj =
|
UseComparA bolshoj =
|
||||||
{s = \\af => bolshoj.s ! Compar ! af ;
|
{s = \\af => bolshoj.s ! Compar ! af ;
|
||||||
p = True
|
p = True ;
|
||||||
|
preferShort = PrefShort
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---- AR 17/12/2008
|
---- AR 17/12/2008
|
||||||
CAdvAP ad ap np = let adp = ad.s in { ---- should be ad.p
|
CAdvAP ad ap np = let adp = ad.s in { ---- should be ad.p
|
||||||
s = \\af => ad.s ++ ap.s ! af ++ adp ++ np.s ! (mkPronForm Gen Yes NonPoss) ;
|
s = \\af => ad.s ++ ap.s ! af ++ adp ++ np.s ! (mkPronForm Gen Yes NonPoss) ;
|
||||||
p = True ----?
|
p = True ; ----?
|
||||||
|
preferShort = ap.preferShort
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---- AR 17/12/2008
|
---- AR 17/12/2008
|
||||||
AdjOrd a = {
|
AdjOrd a = {
|
||||||
s = a.s ;
|
s = a.s ;
|
||||||
p = True ---- ?
|
p = True ; ---- ?
|
||||||
|
preferShort = PrefFull
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
@@ -39,28 +43,33 @@ flags coding=utf8 ;
|
|||||||
ComplA2 vlublen tu =
|
ComplA2 vlublen tu =
|
||||||
{s = \\af => vlublen.s !Posit! af ++ vlublen.c2.s ++
|
{s = \\af => vlublen.s !Posit! af ++ vlublen.c2.s ++
|
||||||
tu.s ! (mkPronForm vlublen.c2.c No NonPoss) ;
|
tu.s ! (mkPronForm vlublen.c2.c No NonPoss) ;
|
||||||
p = True
|
p = True ;
|
||||||
|
preferShort = vlublen.preferShort
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ReflA2 vlublen =
|
ReflA2 vlublen =
|
||||||
{s = \\af => vlublen.s !Posit! af ++ vlublen.c2.s ++ sam.s ! vlublen.c2.c;
|
{s = \\af => vlublen.s !Posit! af ++ vlublen.c2.s ++ sam.s ! vlublen.c2.c;
|
||||||
p = True
|
p = True ;
|
||||||
|
preferShort = vlublen.preferShort
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SentAP vlublen sent=
|
SentAP vlublen sent=
|
||||||
{s = \\af => vlublen.s ! af ++ [", "] ++ sent.s;
|
{s = \\af => vlublen.s ! af ++ [", "] ++ sent.s;
|
||||||
p = True
|
p = True ;
|
||||||
|
preferShort = vlublen.preferShort
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
AdAP ada ap = {
|
AdAP ada ap = {
|
||||||
s = \\af => ada.s ++ ap.s ! af ;
|
s = \\af => ada.s ++ ap.s ! af ;
|
||||||
p = True
|
p = True ;
|
||||||
|
preferShort = ap.preferShort
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UseA2 a = {
|
UseA2 a = {
|
||||||
s = \\af => a.s ! Posit ! af ;
|
s = \\af => a.s ! Posit ! af ;
|
||||||
p = True
|
p = True ;
|
||||||
|
preferShort = a.preferShort
|
||||||
} ;
|
} ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
|
|||||||
|
|
||||||
-- Adjective
|
-- Adjective
|
||||||
|
|
||||||
AP = {s : AdjForm => Str; p : IsPostfixAdj} ;
|
AP = {s : AdjForm => Str ; p : IsPostfixAdj ; preferShort : ShortFormPreference} ;
|
||||||
|
|
||||||
-- Noun
|
-- Noun
|
||||||
|
|
||||||
CN = {s : NForm => Str; g : Gender; anim : Animacy} ;
|
CN = {nounpart : NForm => Str; relcl : Number => Case => Str; g : Gender; anim : Animacy} ;
|
||||||
NP = { s : PronForm => Str ; n : Number ; p : Person ;
|
NP = { s : PronForm => Str ; n : Number ; p : Person ;
|
||||||
g: PronGen ; anim : Animacy ; pron: Bool} ;
|
g: PronGen ; anim : Animacy ; pron: Bool} ;
|
||||||
Pron = { s : PronForm => Str ; n : Number ; p : Person ;
|
Pron = { s : PronForm => Str ; n : Number ; p : Person ;
|
||||||
@@ -59,12 +59,13 @@ concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
|
|||||||
-- like "mnogo"
|
-- like "mnogo"
|
||||||
-- The determined noun has the case parameter specific for the determiner
|
-- The determined noun has the case parameter specific for the determiner
|
||||||
|
|
||||||
Det = {s : AdjForm => Str; n: Number; g: PronGen; c: Case; size: Size} ;
|
Det = {s : Case => Animacy => Gender => Str; n: Number; g: PronGen; c: Case; size: Size} ;
|
||||||
Predet, Quant = {s : AdjForm => Str; g: PronGen; c: Case; size: Size} ;
|
Predet, Quant = {s : AdjForm => Str; g: PronGen; c: Case; size: Size} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
Num, Numeral, Card = {s : Gender => Animacy => Case => Str ; n : Number ; size: Size} ;
|
Num = {s : Gender => Animacy => Case => Str ; n : Number ; size: Size} ;
|
||||||
|
Numeral, Card = {s : Gender => Animacy => Case => Str ; n : Number ; size: Size} ;
|
||||||
Digits = {s : Str ; n : Number ; size: Size} ; ----
|
Digits = {s : Str ; n : Number ; size: Size} ; ----
|
||||||
|
|
||||||
-- Structural
|
-- Structural
|
||||||
@@ -85,7 +86,7 @@ concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
|
|||||||
-- VV = {s : VVForm => Str ; isAux : Bool} ;
|
-- VV = {s : VVForm => Str ; isAux : Bool} ;
|
||||||
|
|
||||||
Ord = {s : AdjForm => Str} ;
|
Ord = {s : AdjForm => Str} ;
|
||||||
A = {s : Degree => AdjForm => Str} ;
|
A = {s : Degree => AdjForm => Str ; p : IsPostfixAdj ; preferShort : ShortFormPreference} ;
|
||||||
A2 = A ** {c2 : Complement} ;
|
A2 = A ** {c2 : Complement} ;
|
||||||
|
|
||||||
-- Substantives moreover have an inherent gender.
|
-- Substantives moreover have an inherent gender.
|
||||||
|
|||||||
@@ -16,8 +16,17 @@ concrete ConjunctionRus of Conjunction =
|
|||||||
p = xs.p ; pron = xs.pron ; anim = xs.anim ;
|
p = xs.p ; pron = xs.pron ; anim = xs.anim ;
|
||||||
g = xs.g } ;
|
g = xs.g } ;
|
||||||
|
|
||||||
|
ConjAP or xs =
|
||||||
ConjAP c xs = conjunctDistrTable AdjForm c xs ** {p = xs.p} ;
|
{s = \\af => case af of {
|
||||||
|
AF c a gn => or.s1++ xs.s1 ! AF c a gn ++ or.s2 ++ xs.s2 ! AF c a gn ;
|
||||||
|
AFShort gn => case xs.preferShort of {
|
||||||
|
PrefShort => or.s1++ xs.s1 ! AFShort gn ++ or.s2 ++ xs.s2 ! AFShort gn ;
|
||||||
|
_ => or.s1++ xs.s1 ! AF Nom Inanimate gn ++ or.s2 ++ xs.s2 ! AF Nom Inanimate gn} ;
|
||||||
|
AdvF => or.s1++ xs.s1 ! AdvF ++ or.s2 ++ xs.s2 ! AdvF
|
||||||
|
} ;
|
||||||
|
p = xs.p ;
|
||||||
|
preferShort = xs.preferShort
|
||||||
|
} ;
|
||||||
|
|
||||||
---- AR 17/12/2008
|
---- AR 17/12/2008
|
||||||
ConjRS c xs = conjunctDistrTable3 GenNum Case Animacy c xs ** {p = xs.p} ;
|
ConjRS c xs = conjunctDistrTable3 GenNum Case Animacy c xs ** {p = xs.p} ;
|
||||||
@@ -36,10 +45,9 @@ concrete ConjunctionRus of Conjunction =
|
|||||||
anim = conjAnim x.anim xs.anim ;
|
anim = conjAnim x.anim xs.anim ;
|
||||||
p = conjPerson xs.p x.p; pron = conjPron xs.pron x.pron} ;
|
p = conjPerson xs.p x.p; pron = conjPron xs.pron x.pron} ;
|
||||||
|
|
||||||
ConsAP x xs = consTable AdjForm comma xs x ** {p = andB xs.p x.p} ;
|
ConsAP x xs = consTable AdjForm comma xs x ** {p = andB xs.p x.p ; preferShort = selectAPForm x.preferShort xs.preferShort} ;
|
||||||
|
|
||||||
|
BaseAP x y = twoTable AdjForm x y ** {p = andB x.p y.p ; preferShort = selectAPForm x.preferShort y.preferShort} ;
|
||||||
BaseAP x y = twoTable AdjForm x y ** {p = andB x.p y.p} ;
|
|
||||||
|
|
||||||
BaseNP x y = twoTable PronForm x y ** {n = conjNumber x.n y.n ;
|
BaseNP x y = twoTable PronForm x y ** {n = conjNumber x.n y.n ;
|
||||||
g = conjPGender x.g y.g ; p = conjPerson x.p y.p ;
|
g = conjPGender x.g y.g ; p = conjPerson x.p y.p ;
|
||||||
@@ -49,7 +57,12 @@ concrete ConjunctionRus of Conjunction =
|
|||||||
BaseRS x y = twoTable3 GenNum Case Animacy x y ** {c = y.c} ;
|
BaseRS x y = twoTable3 GenNum Case Animacy x y ** {c = y.c} ;
|
||||||
ConsRS xs x = consrTable3 GenNum Case Animacy comma xs x ** {c = xs.c} ;
|
ConsRS xs x = consrTable3 GenNum Case Animacy comma xs x ** {c = xs.c} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
selectAPForm : ShortFormPreference -> ShortFormPreference -> ShortFormPreference = \sfp1,sfp2 ->
|
||||||
|
case <sfp1,sfp2> of
|
||||||
|
{<PrefShort, PrefShort> => PrefShort ;
|
||||||
|
_ => PrefFull
|
||||||
|
} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = {s1,s2 : Str} ;
|
[S] = {s1,s2 : Str} ;
|
||||||
@@ -60,7 +73,7 @@ concrete ConjunctionRus of Conjunction =
|
|||||||
anim : Animacy ; n : Number ; p : Person ; pron : Bool } ;
|
anim : Animacy ; n : Number ; p : Person ; pron : Bool } ;
|
||||||
-- The structure is the same as for sentences. The result is a prefix adjective
|
-- The structure is the same as for sentences. The result is a prefix adjective
|
||||||
-- if and only if all elements are prefix.
|
-- if and only if all elements are prefix.
|
||||||
[AP] = {s1,s2 : AdjForm => Str ; p : Bool} ;
|
[AP] = {s1,s2 : AdjForm => Str ; p : Bool ; preferShort : ShortFormPreference} ;
|
||||||
|
|
||||||
---- AR 17/12/2008
|
---- AR 17/12/2008
|
||||||
[RS] = {s1,s2 : GenNum => Case => Animacy => Str} ;
|
[RS] = {s1,s2 : GenNum => Case => Animacy => Str} ;
|
||||||
|
|||||||
@@ -826,9 +826,6 @@ oper eEnd_Decl: Str -> CommNoun = \vs ->
|
|||||||
AdvF => stem + "е"
|
AdvF => stem + "е"
|
||||||
} } ;
|
} } ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vseDetPl: Adjective = extAdjFromSubst (eEnd_Decl "вс") ;
|
vseDetPl: Adjective = extAdjFromSubst (eEnd_Decl "вс") ;
|
||||||
extAdjFromSubst: CommNoun -> Adjective = \ vse ->
|
extAdjFromSubst: CommNoun -> Adjective = \ vse ->
|
||||||
{s = \\af => vse.s ! NF (numAF af) (caseAF af) plg } ;
|
{s = \\af => vse.s ! NF (numAF af) (caseAF af) plg } ;
|
||||||
@@ -1391,4 +1388,146 @@ oper ProperName : Type = {s : Case => Str ; g : Gender ; anim : Animacy} ;
|
|||||||
(Prepos _) => lubercy + "ах" };
|
(Prepos _) => lubercy + "ах" };
|
||||||
g = Neut ; anim = anim };
|
g = Neut ; anim = anim };
|
||||||
|
|
||||||
|
oper aRegHardWorstCase : AdjStress -> AdjType -> Str -> Str -> Str -> Str -> Str -> Adjective = \stress, at, stem, shortMasc, shortFem, shortNeut, shortPl ->
|
||||||
|
let i = iAfter stem in
|
||||||
|
let o = case stress of {
|
||||||
|
EndStress => "о" ;
|
||||||
|
StemStress => oAfter stem } in
|
||||||
|
{ s = table {
|
||||||
|
AF Nom _ (GSg Masc) => stem + case stress of {
|
||||||
|
EndStress => "ой";
|
||||||
|
StemStress => iAfter stem + "й" } ;
|
||||||
|
AF Nom _ (GSg Neut) => stem + o+"е";
|
||||||
|
AF Gen _ (GSg (Masc|Neut)) => stem + o+"го";
|
||||||
|
AF Dat _ (GSg (Masc|Neut)) => stem + o+"му";
|
||||||
|
AF Acc Inanimate (GSg Masc) => stem + i+"й";
|
||||||
|
AF Acc Animate (GSg Masc) => stem + o+"го";
|
||||||
|
AF Acc _ (GSg Neut) => stem + o+"е";
|
||||||
|
AF Inst _ (GSg (Masc|Neut)) => stem + i+"м";
|
||||||
|
AF (Prepos _) _ (GSg (Masc|Neut)) => stem + o+"м";
|
||||||
|
|
||||||
|
AF Nom _ (GSg Fem) => stem + "ая";
|
||||||
|
AF Acc _ (GSg Fem) => stem + "ую";
|
||||||
|
AF _ _ (GSg Fem) => stem + o+"й";
|
||||||
|
|
||||||
|
AF Nom _ GPl => stem + i+"е";
|
||||||
|
AF Acc Inanimate GPl => stem + i+"е";
|
||||||
|
AF Acc Animate GPl => stem + i+"х";
|
||||||
|
AF Gen _ GPl => stem + i+"х";
|
||||||
|
AF Inst _ GPl => stem + i+"ми";
|
||||||
|
AF Dat _ GPl => stem + i+"м";
|
||||||
|
AF (Prepos _) _ GPl => stem + i+"х";
|
||||||
|
|
||||||
|
AFShort (GSg Masc) => shortMasc ;
|
||||||
|
AFShort (GSg Fem) => shortFem ;
|
||||||
|
AFShort (GSg Neut) => shortNeut ;
|
||||||
|
AFShort GPl => shortPl ;
|
||||||
|
|
||||||
|
AdvF => stem + o
|
||||||
|
} } ;
|
||||||
|
|
||||||
|
-- Liza Zimina 04/2018: to make correct short forms of adjectives
|
||||||
|
|
||||||
|
oper aRegSoftWorstCase : AdjType -> Str -> Str -> Str -> Str -> Str -> Adjective = \at, stem, shortMasc, shortFem, shortNeut, shortPl ->
|
||||||
|
{ s = table {
|
||||||
|
AF Nom _ (GSg Masc) => stem + "ий" ;
|
||||||
|
AF Nom _ (GSg Neut) => stem + "ее";
|
||||||
|
AF Gen _ (GSg (Masc|Neut)) => stem + "его";
|
||||||
|
AF Dat _ (GSg (Masc|Neut)) => stem + "ему";
|
||||||
|
AF Acc Inanimate (GSg Masc) => stem + "ий";
|
||||||
|
AF Acc Animate (GSg Masc) => stem + "его";
|
||||||
|
AF Acc _ (GSg Neut) => stem + "ее";
|
||||||
|
AF Inst _ (GSg (Masc|Neut)) => stem + "им";
|
||||||
|
AF (Prepos _) _ (GSg (Masc|Neut)) => stem + "ем";
|
||||||
|
|
||||||
|
AF Nom _ (GSg Fem) => stem + "яя";
|
||||||
|
AF Acc _ (GSg Fem) => stem + "юю";
|
||||||
|
AF _ _ (GSg Fem) => stem + "ей";
|
||||||
|
|
||||||
|
AF Nom _ GPl => stem + "ие";
|
||||||
|
AF Acc Inanimate GPl => stem + "ие";
|
||||||
|
AF Acc Animate GPl => stem + "их";
|
||||||
|
AF Gen _ GPl => stem + "их";
|
||||||
|
AF Inst _ GPl => stem + "ими";
|
||||||
|
AF Dat _ GPl => stem + "им";
|
||||||
|
AF (Prepos _) _ GPl => stem + "их";
|
||||||
|
|
||||||
|
AFShort (GSg Masc) => shortMasc ;
|
||||||
|
AFShort (GSg Fem) => shortFem ;
|
||||||
|
AFShort (GSg Neut) => shortNeut ;
|
||||||
|
AFShort GPl => shortPl ;
|
||||||
|
AdvF => stem + "е"
|
||||||
|
} } ;
|
||||||
|
|
||||||
|
oper aRegHardFull : AdjStress -> AdjType -> Str -> Adjective = \stress, at, stem ->
|
||||||
|
let i = iAfter stem in
|
||||||
|
let o = case stress of {
|
||||||
|
EndStress => "о" ;
|
||||||
|
StemStress => oAfter stem } in
|
||||||
|
{ s = table {
|
||||||
|
AF Nom _ (GSg Masc) => stem + case stress of {
|
||||||
|
EndStress => "ой";
|
||||||
|
StemStress => iAfter stem + "й" } ;
|
||||||
|
AF Nom _ (GSg Neut) => stem + o+"е";
|
||||||
|
AF Gen _ (GSg (Masc|Neut)) => stem + o+"го";
|
||||||
|
AF Dat _ (GSg (Masc|Neut)) => stem + o+"му";
|
||||||
|
AF Acc Inanimate (GSg Masc) => stem + i+"й";
|
||||||
|
AF Acc Animate (GSg Masc) => stem + o+"го";
|
||||||
|
AF Acc _ (GSg Neut) => stem + o+"е";
|
||||||
|
AF Inst _ (GSg (Masc|Neut)) => stem + i+"м";
|
||||||
|
AF (Prepos _) _ (GSg (Masc|Neut)) => stem + o+"м";
|
||||||
|
|
||||||
|
AF Nom _ (GSg Fem) => stem + "ая";
|
||||||
|
AF Acc _ (GSg Fem) => stem + "ую";
|
||||||
|
AF _ _ (GSg Fem) => stem + o+"й";
|
||||||
|
|
||||||
|
AF Nom _ GPl => stem + i+"е";
|
||||||
|
AF Acc Inanimate GPl => stem + i+"е";
|
||||||
|
AF Acc Animate GPl => stem + i+"х";
|
||||||
|
AF Gen _ GPl => stem + i+"х";
|
||||||
|
AF Inst _ GPl => stem + i+"ми";
|
||||||
|
AF Dat _ GPl => stem + i+"м";
|
||||||
|
AF (Prepos _) _ GPl => stem + i+"х";
|
||||||
|
|
||||||
|
AFShort (GSg Masc) => stem + case stress of {
|
||||||
|
EndStress => "ой";
|
||||||
|
StemStress => iAfter stem + "й" } ;
|
||||||
|
AFShort (GSg Fem) => stem + "ая";
|
||||||
|
AFShort (GSg Neut) => stem + o+"е";
|
||||||
|
AFShort GPl => stem + i+"е";
|
||||||
|
|
||||||
|
AdvF => stem + o
|
||||||
|
} } ;
|
||||||
|
|
||||||
|
oper aRegSoftFull : AdjType -> Str -> Adjective = \at, stem ->
|
||||||
|
{ s = table {
|
||||||
|
AF Nom _ (GSg Masc) => stem + "ий" ;
|
||||||
|
AF Nom _ (GSg Neut) => stem + "ее";
|
||||||
|
AF Gen _ (GSg (Masc|Neut)) => stem + "его";
|
||||||
|
AF Dat _ (GSg (Masc|Neut)) => stem + "ему";
|
||||||
|
AF Acc Inanimate (GSg Masc) => stem + "ий";
|
||||||
|
AF Acc Animate (GSg Masc) => stem + "его";
|
||||||
|
AF Acc _ (GSg Neut) => stem + "ее";
|
||||||
|
AF Inst _ (GSg (Masc|Neut)) => stem + "им";
|
||||||
|
AF (Prepos _) _ (GSg (Masc|Neut)) => stem + "ем";
|
||||||
|
|
||||||
|
AF Nom _ (GSg Fem) => stem + "яя";
|
||||||
|
AF Acc _ (GSg Fem) => stem + "юю";
|
||||||
|
AF _ _ (GSg Fem) => stem + "ей";
|
||||||
|
|
||||||
|
AF Nom _ GPl => stem + "ие";
|
||||||
|
AF Acc Inanimate GPl => stem + "ие";
|
||||||
|
AF Acc Animate GPl => stem + "их";
|
||||||
|
AF Gen _ GPl => stem + "их";
|
||||||
|
AF Inst _ GPl => stem + "ими";
|
||||||
|
AF Dat _ GPl => stem + "им";
|
||||||
|
AF (Prepos _) _ GPl => stem + "их";
|
||||||
|
|
||||||
|
AFShort (GSg Masc) => stem + "ий" ;
|
||||||
|
AFShort (GSg Fem) => stem + "яя";
|
||||||
|
AFShort (GSg Neut) => stem + "ее";
|
||||||
|
AFShort GPl => stem + "ие";
|
||||||
|
|
||||||
|
AdvF => stem + "е"
|
||||||
|
} } ;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,30 +5,31 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
flags optimize=all_subs ; coding=utf8 ;
|
flags optimize=all_subs ; coding=utf8 ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
DetCN kazhduj okhotnik = {
|
DetCN kazhduj okhotnik = {
|
||||||
s = \\c => case kazhduj.size of {
|
s = \\c => case kazhduj.size of {
|
||||||
nom =>
|
nom =>
|
||||||
kazhduj.s ! AF (extCase c) okhotnik.anim (gennum okhotnik.g Sg) ++
|
kazhduj.s ! extCase c ! okhotnik.anim ! okhotnik.g ++
|
||||||
okhotnik.s ! NF kazhduj.n (extCase c) nom ;
|
okhotnik.nounpart ! NF Sg (extCase c) nom ++ okhotnik.relcl ! kazhduj.n ! (extCase c) ;
|
||||||
nompl =>
|
nompl =>
|
||||||
kazhduj.s ! AF (extCase c) okhotnik.anim (gennum okhotnik.g Pl) ++
|
kazhduj.s ! extCase c ! okhotnik.anim ! okhotnik.g ++
|
||||||
okhotnik.s ! NF kazhduj.n (extCase c) nompl ;
|
okhotnik.nounpart ! NF kazhduj.n (extCase c) nompl ++ okhotnik.relcl ! kazhduj.n ! (extCase c) ;
|
||||||
sgg =>
|
sgg =>
|
||||||
case c of {
|
case c of {
|
||||||
PF Nom _ _ =>
|
PF Nom _ _ =>
|
||||||
kazhduj.s ! AF Nom okhotnik.anim (gennum okhotnik.g kazhduj.n) ++
|
kazhduj.s ! Nom ! okhotnik.anim ! okhotnik.g ++
|
||||||
okhotnik.s ! NF Sg Gen sgg;
|
okhotnik.nounpart ! NF Sg Gen sgg ++ okhotnik.relcl ! kazhduj.n ! (extCase c) ;
|
||||||
_ =>
|
_ =>
|
||||||
kazhduj.s ! AF (extCase c) okhotnik.anim (gennum okhotnik.g kazhduj.n) ++
|
kazhduj.s ! extCase c ! okhotnik.anim ! okhotnik.g ++
|
||||||
okhotnik.s ! NF Pl (extCase c) sgg } ;
|
okhotnik.nounpart ! NF Pl (extCase c) sgg ++ okhotnik.relcl ! kazhduj.n ! (extCase c)} ;
|
||||||
plg =>
|
plg =>
|
||||||
case c of {
|
case c of {
|
||||||
PF Nom _ _ =>
|
PF Nom _ _ =>
|
||||||
kazhduj.s ! AF Nom okhotnik.anim (gennum okhotnik.g kazhduj.n) ++
|
kazhduj.s ! Nom ! okhotnik.anim ! okhotnik.g ++
|
||||||
okhotnik.s ! NF Pl Gen plg ;
|
okhotnik.nounpart ! NF Pl Gen plg ++ okhotnik.relcl ! kazhduj.n ! (extCase c) ;
|
||||||
_ =>
|
_ =>
|
||||||
kazhduj.s ! AF (extCase c) okhotnik.anim (gennum okhotnik.g kazhduj.n) ++
|
kazhduj.s ! extCase c ! okhotnik.anim ! okhotnik.g ++
|
||||||
okhotnik.s ! NF Pl (extCase c) plg }
|
okhotnik.nounpart ! NF Pl (extCase c) plg ++ okhotnik.relcl ! kazhduj.n ! (extCase c)}
|
||||||
};
|
};
|
||||||
n = kazhduj.n ;
|
n = kazhduj.n ;
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
@@ -79,7 +80,7 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
g = Neut ; ----
|
g = Neut ; ----
|
||||||
anim = Inanimate ;
|
anim = Inanimate ;
|
||||||
in {
|
in {
|
||||||
s = \\c => kazhduj.s ! AF (extCase c) anim (gennum g kazhduj.n) ;
|
s = \\c => kazhduj.s ! extCase c ! anim ! g ;
|
||||||
n = kazhduj.n ;
|
n = kazhduj.n ;
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
pron = False;
|
pron = False;
|
||||||
@@ -87,21 +88,6 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
anim = anim
|
anim = anim
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuantOrd quant num ord = {
|
|
||||||
s = \\af => quant.s !af ++ num.s ! (genAF af) ! (animAF af) ! (caseAF af) ++ ord.s!af ;
|
|
||||||
n = num.n ;
|
|
||||||
g = quant.g;
|
|
||||||
c = quant.c;
|
|
||||||
size = quant.size
|
|
||||||
} ;
|
|
||||||
|
|
||||||
DetQuant quant num = {
|
|
||||||
s = \\af => quant.s !af ++ num.s ! (genAF af) ! (animAF af) ! (caseAF af);
|
|
||||||
n = num.n ;
|
|
||||||
g = quant.g;
|
|
||||||
c = quant.c;
|
|
||||||
size = num.size
|
|
||||||
} ;
|
|
||||||
{-
|
{-
|
||||||
DetArtOrd quant num ord = {
|
DetArtOrd quant num ord = {
|
||||||
s = \\af => quant.s !af ++ num.s! (caseAF af) ! (genAF af) ++ ord.s!af ;
|
s = \\af => quant.s !af ++ num.s! (caseAF af) ! (genAF af) ++ ord.s!af ;
|
||||||
@@ -117,10 +103,10 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
c = quant.c
|
c = quant.c
|
||||||
} ;
|
} ;
|
||||||
-}
|
-}
|
||||||
-- MassDet = {s = \\_=>[] ; c=Nom; g = PNoGen; n = Sg} ;
|
-- MassDet = {s = \\_=>[] ; c = Nom; g = PNoGen; n = Sg} ;
|
||||||
|
|
||||||
MassNP okhotnik = {
|
MassNP okhotnik = {
|
||||||
s = \\c => okhotnik.s ! NF Sg (extCase c) nom ;
|
s = \\c => okhotnik.nounpart ! NF Sg (extCase c) nom ++ okhotnik.relcl ! Sg ! extCase c ;
|
||||||
n = Sg ;
|
n = Sg ;
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
pron = False;
|
pron = False;
|
||||||
@@ -135,7 +121,7 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
n = Sg ;
|
n = Sg ;
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
pron = False;
|
pron = False;
|
||||||
g = case kazhduj.g of { PNoGen => (PGen okhotnik.g); _ => kazhduj.g };
|
g = case kazhduj.g of { PNoGen => (PGen okhotnik.g); _ => kazhduj.g};
|
||||||
anim = okhotnik.anim
|
anim = okhotnik.anim
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -152,10 +138,6 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
-}
|
-}
|
||||||
PossPron p = {s = \\af => p.s ! mkPronForm (caseAF af) No (Poss (gennum (genAF af) (numAF af) )); c=Nom; g = PNoGen; size = nom} ;
|
PossPron p = {s = \\af => p.s ! mkPronForm (caseAF af) No (Poss (gennum (genAF af) (numAF af) )); c=Nom; g = PNoGen; size = nom} ;
|
||||||
|
|
||||||
NumCard c = c ;
|
|
||||||
NumSg = {s = \\_,_,_ => [] ; n = Sg ; size = nom} ;
|
|
||||||
NumPl = {s = \\_,_,_ => [] ; n = Pl ; size = nompl} ;
|
|
||||||
|
|
||||||
OrdNumeral numeral = variants {} ; ---- TODO; needed to compile Constructors
|
OrdNumeral numeral = variants {} ; ---- TODO; needed to compile Constructors
|
||||||
OrdDigits numeral = variants {} ; ---- TODO; needed to compile Constructors
|
OrdDigits numeral = variants {} ; ---- TODO; needed to compile Constructors
|
||||||
---- OrdDigits TODO
|
---- OrdDigits TODO
|
||||||
@@ -166,13 +148,24 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
|
|
||||||
AdNum adn num = {s = \\c,a,n => adn.s ++ num.s!c!a!n ; n = num.n ; size = num.size} ;
|
AdNum adn num = {s = \\c,a,n => adn.s ++ num.s!c!a!n ; n = num.n ; size = num.size} ;
|
||||||
|
|
||||||
OrdSuperl a = {s = a.s!Posit};
|
OrdSuperl a = {s = a.s ! Posit} ;
|
||||||
|
|
||||||
DefArt = {s = \\_=>[] ; c=Nom; g = PNoGen; size = nom };
|
DefArt = {s = \\_=>[] ; c=Nom; g = PNoGen; size = nom };
|
||||||
IndefArt = { s = \\_=>[] ; c=Nom; g = PNoGen; size = nom };
|
IndefArt = { s = \\_=>[] ; c=Nom; g = PNoGen; size = nom };
|
||||||
|
|
||||||
UseN noun = noun ;
|
UseN noun = {
|
||||||
UseN2 noun = noun ;
|
nounpart = \\nf => noun.s ! nf ;
|
||||||
|
relcl = \\n,c => "" ;
|
||||||
|
g = noun.g ;
|
||||||
|
anim = noun.anim
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseN2 noun = {
|
||||||
|
nounpart = noun.s ;
|
||||||
|
relcl = \\n,c => "" ;
|
||||||
|
g = noun.g ;
|
||||||
|
anim = noun.anim
|
||||||
|
} ;
|
||||||
|
|
||||||
-- The application of a function gives, in the first place, a common noun:
|
-- The application of a function gives, in the first place, a common noun:
|
||||||
-- "ключ от дома". From this, other rules of the resource grammar
|
-- "ключ от дома". From this, other rules of the resource grammar
|
||||||
@@ -183,11 +176,12 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
-- of the readings is meaningful.
|
-- of the readings is meaningful.
|
||||||
|
|
||||||
ComplN2 f x = {
|
ComplN2 f x = {
|
||||||
s = \\nf => case x.pron of {
|
nounpart = \\nf => case x.pron of {
|
||||||
True => x.s ! (case nf of {NF n c size => mkPronForm c No (Poss (gennum f.g n))}) ++ f.s ! nf ;
|
True => x.s ! (case nf of {NF n c size => mkPronForm c No (Poss (gennum f.g n))}) ++ f.s ! nf ;
|
||||||
False => f.s ! nf ++ f.c2.s ++
|
False => f.s ! nf ++ f.c2.s ++
|
||||||
x.s ! (case nf of {NF n c size => mkPronForm f.c2.c Yes (Poss (gennum f.g n))})
|
x.s ! (case nf of {NF n c size => mkPronForm f.c2.c Yes (Poss (gennum f.g n))})
|
||||||
};
|
} ;
|
||||||
|
relcl = \\n,c => "" ;
|
||||||
g = f.g ;
|
g = f.g ;
|
||||||
anim = f.anim
|
anim = f.anim
|
||||||
} ;
|
} ;
|
||||||
@@ -224,9 +218,13 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
-- later, in the chapter on verbs.
|
-- later, in the chapter on verbs.
|
||||||
|
|
||||||
AdjCN ap cn = {
|
AdjCN ap cn = {
|
||||||
s = \\nf => ap.s ! case nf of {NF Sg Gen sgg => AF Nom cn.anim GPl ;
|
nounpart = \\nf => case ap.p of {
|
||||||
NF n c size => AF c cn.anim (gennum cn.g n)} ++
|
False => ap.s ! case nf of {NF Sg Gen sgg => AF Nom cn.anim GPl ;
|
||||||
cn.s ! nf ;
|
NF n c size => AF c cn.anim (gennum cn.g n)} ++ cn.nounpart ! nf ;
|
||||||
|
True => cn.nounpart ! nf ++ ap.s ! case nf of {NF Sg Gen sgg => AF Nom cn.anim GPl ;
|
||||||
|
NF n c size => AF c cn.anim (gennum cn.g n)}
|
||||||
|
} ;
|
||||||
|
relcl = cn.relcl ;
|
||||||
g = cn.g ;
|
g = cn.g ;
|
||||||
anim = cn.anim
|
anim = cn.anim
|
||||||
} ;
|
} ;
|
||||||
@@ -236,7 +234,8 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
-- Semantics will have to make finer distinctions among adverbials.
|
-- Semantics will have to make finer distinctions among adverbials.
|
||||||
|
|
||||||
AdvCN cn adv = {
|
AdvCN cn adv = {
|
||||||
s = \\nf => cn.s ! nf ++ adv.s ;
|
nounpart = \\nf => cn.nounpart ! nf ++ adv.s ;
|
||||||
|
relcl = cn.relcl ;
|
||||||
g = cn.g ;
|
g = cn.g ;
|
||||||
anim = cn.anim
|
anim = cn.anim
|
||||||
} ;
|
} ;
|
||||||
@@ -245,20 +244,23 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
-- first place as common nouns, so that one can also have "a suggestion that...".
|
-- first place as common nouns, so that one can also have "a suggestion that...".
|
||||||
|
|
||||||
SentCN idea x = {
|
SentCN idea x = {
|
||||||
s = \\nf => idea.s ! nf ++ x.s ;
|
nounpart = \\nf => idea.nounpart ! nf ;
|
||||||
|
relcl = \\n,c => idea.relcl ! n ! c ++ x.s ;
|
||||||
g = idea.g ;
|
g = idea.g ;
|
||||||
anim = idea.anim
|
anim = idea.anim
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelCN idea x = {
|
RelCN idea x = {
|
||||||
s = \\nf => idea.s ! nf ++ case nf of {NF n c size => x.s ! (gennum idea.g n)!c!idea.anim} ;
|
nounpart = \\nf => idea.nounpart ! nf;
|
||||||
|
relcl = \\n,c => idea.relcl ! n ! c ++ x.s ! (gennum idea.g n)! c ! idea.anim ;
|
||||||
g = idea.g ;
|
g = idea.g ;
|
||||||
anim = idea.anim
|
anim = idea.anim
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---- AR 17/12/2008
|
---- AR 17/12/2008
|
||||||
ApposCN cn s = {
|
ApposCN cn s = {
|
||||||
s = \\nf => cn.s ! nf ++ s.s ! (case nf of {NF n c size => PF c No NonPoss}) ;
|
nounpart = \\nf => cn.nounpart ! nf ++ s.s ! (case nf of {NF n c size => PF c No NonPoss}) ;
|
||||||
|
relcl = cn.relcl ;
|
||||||
g = cn.g ;
|
g = cn.g ;
|
||||||
anim = cn.anim
|
anim = cn.anim
|
||||||
} ;
|
} ;
|
||||||
@@ -273,6 +275,30 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
|||||||
nComp = np.nComp
|
nComp = np.nComp
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
---- Liza Zimina 04/2018
|
||||||
|
-- changed to make Ord agree in number with Num
|
||||||
|
|
||||||
|
DetQuantOrd quant num ord = {
|
||||||
|
s = \\c,a,gen => quant.s ! AF c a (gennum gen num.n) ++ num.s ! gen ! a ! c ++ case num.n of {
|
||||||
|
Sg => ord.s ! AF c a (GSg gen) ;
|
||||||
|
Pl => ord.s ! AF c a GPl
|
||||||
|
} ;
|
||||||
|
n = num.n ;
|
||||||
|
g = quant.g;
|
||||||
|
c = quant.c;
|
||||||
|
size = quant.size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetQuant quant num = {
|
||||||
|
s = \\c,a,gen => quant.s ! AF c a (gennum gen num.n) ++ num.s ! gen ! a ! c ;
|
||||||
|
n = num.n ;
|
||||||
|
g = quant.g;
|
||||||
|
c = quant.c;
|
||||||
|
size = num.size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
NumCard c = c ;
|
||||||
|
NumSg = {s = \\_,_,_ => [] ; n = Sg ; size = nom} ;
|
||||||
|
NumPl = {s = \\_,_,_ => [] ; n = Pl ; size = nompl} ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,27 +15,6 @@ lincat Sub1000000 = {s : Gender => Animacy => Case => Str ; size : Size} ;
|
|||||||
|
|
||||||
lin num x = {s = \\ g,a,c => x.s ! g ! a ! c; n = Pl ; size = x.size};
|
lin num x = {s = \\ g,a,c => x.s ! g ! a ! c; n = Pl ; size = x.size};
|
||||||
|
|
||||||
lin n2 =
|
|
||||||
{s = table {unit => \\ g, a, c =>
|
|
||||||
case <c, g, a> of {
|
|
||||||
<(Nom|Acc), Fem, Inanimate > => "две";
|
|
||||||
<(Nom|Acc), _, Inanimate > => "два";
|
|
||||||
<Nom , _, Animate > => "два";
|
|
||||||
<Acc , _, Animate > => "двух";
|
|
||||||
<(Gen|Prepos _), _, _ > => "двух";
|
|
||||||
<Dat, _, _ > => "двум";
|
|
||||||
<Inst, _, _ > => "двумя"
|
|
||||||
};
|
|
||||||
teen => nadsat "две" ;
|
|
||||||
ten => n2030 "два" ;
|
|
||||||
hund => \\ g, a, c =>
|
|
||||||
case <c, g> of {
|
|
||||||
<(Nom|Acc), _ > => "двести";
|
|
||||||
<Gen, _ > => "двухсот";
|
|
||||||
<Dat, _ > => "двумстам";
|
|
||||||
<Inst, _ > => "двумяюстами";
|
|
||||||
<Prepos _, _ > => "двухстах"} } ;
|
|
||||||
size = sgg} ;
|
|
||||||
lin n3 =
|
lin n3 =
|
||||||
{s = table {unit => tri ;
|
{s = table {unit => tri ;
|
||||||
teen => nadsat "три" ;
|
teen => nadsat "три" ;
|
||||||
@@ -195,6 +174,30 @@ lin pot01 =
|
|||||||
<Neut, _, Inst > => "одним";
|
<Neut, _, Inst > => "одним";
|
||||||
<Neut, _, Prepos _ > => "одном"}}} ;
|
<Neut, _, Prepos _ > => "одном"}}} ;
|
||||||
size = nom} ;
|
size = nom} ;
|
||||||
|
|
||||||
|
lin n2 =
|
||||||
|
{s = table {unit => \\ g, a, c =>
|
||||||
|
case <c, g, a> of {
|
||||||
|
<(Nom|Acc), Fem, Inanimate > => "две";
|
||||||
|
<(Nom|Acc), Masc, Inanimate > => "два";
|
||||||
|
<(Nom|Acc), Neut, Inanimate > => "два";
|
||||||
|
<Nom , _, Animate > => "два";
|
||||||
|
<Acc , _, Animate > => "двух";
|
||||||
|
<(Gen|Prepos _), _, _ > => "двух";
|
||||||
|
<Dat, _, _ > => "двум";
|
||||||
|
<Inst, _, _ > => "двумя"
|
||||||
|
};
|
||||||
|
teen => nadsat "две" ;
|
||||||
|
ten => n2030 "два" ;
|
||||||
|
hund => \\ g, a, c =>
|
||||||
|
case <c, g> of {
|
||||||
|
<(Nom|Acc), _ > => "двести";
|
||||||
|
<Gen, _ > => "двухсот";
|
||||||
|
<Dat, _ > => "двумстам";
|
||||||
|
<Inst, _ > => "двумяюстами";
|
||||||
|
<Prepos _, _ > => "двухстах"} } ;
|
||||||
|
size = sgg} ;
|
||||||
|
|
||||||
lin pot0 d =
|
lin pot0 d =
|
||||||
{s = table {_ => d.s} ; size = d.size} ;
|
{s = table {_ => d.s} ; size = d.size} ;
|
||||||
lin pot110 =
|
lin pot110 =
|
||||||
|
|||||||
@@ -275,7 +275,8 @@ foreign = Foreign; -- +++ MG_UR: added +++
|
|||||||
perfective = Perfective ;
|
perfective = Perfective ;
|
||||||
-- present = Present ;
|
-- present = Present ;
|
||||||
--past = Past ;
|
--past = Past ;
|
||||||
-- Degree = Pos | Comp | Super ;
|
Degree = Posit | Compar | Superl ;
|
||||||
|
|
||||||
-- Person = P1 | P2 | P3 ;
|
-- Person = P1 | P2 | P3 ;
|
||||||
-- AfterPrep = Yes | No ;
|
-- AfterPrep = Yes | No ;
|
||||||
-- Possessive = NonPoss | Poss GenNum ;
|
-- Possessive = NonPoss | Poss GenNum ;
|
||||||
@@ -373,11 +374,11 @@ foreign = Foreign; -- +++ MG_UR: added +++
|
|||||||
mkN2 : N -> Prep -> N2 = mkFun;
|
mkN2 : N -> Prep -> N2 = mkFun;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkFun : N -> Prep -> N2 = \f,p -> UseN f ** {c2 = p ; lock_N2 = <>} ;
|
mkFun : N -> Prep -> N2 = \f,p -> f ** {c2 = p ; lock_N2 = <>} ;
|
||||||
|
|
||||||
nullPrep : Prep = {s = []; c= Gen; lock_Prep=<>} ;
|
nullPrep : Prep = {s = []; c= Gen; lock_Prep=<>} ;
|
||||||
|
|
||||||
mkN3 f p2 p3 = (UseN f) ** {c2 = p2; c3 = p3; lock_N3 = <>} ;
|
mkN3 f p2 p3 = f ** {c2 = p2; c3 = p3; lock_N3 = <>} ;
|
||||||
|
|
||||||
|
|
||||||
-- mkPN = \ivan, g, n, anim ->
|
-- mkPN = \ivan, g, n, anim ->
|
||||||
@@ -408,7 +409,11 @@ foreign = Foreign; -- +++ MG_UR: added +++
|
|||||||
mkA = overload {
|
mkA = overload {
|
||||||
mkA : (positive : Str) -> A = mk1A ;
|
mkA : (positive : Str) -> A = mk1A ;
|
||||||
mkA : (positive : Str) -> AdjType -> A = mk1Ab ;
|
mkA : (positive : Str) -> AdjType -> A = mk1Ab ;
|
||||||
mkA : (positive, comparative : Str) -> A = mk2A;
|
mkA : (positive, shortMasc, shortFem, shortNeut, shortPl : Str) -> A = mk3A ; -- to make correct short forms (Liza Zimina 04/2018)
|
||||||
|
mkA : (positive, comparative : Str) -> A = mk2A ;
|
||||||
|
mkA : (positive : Str) -> ShortFormPreference -> A = mk4A ; -- adjectives preferring full forms in conjunction
|
||||||
|
-- (e.g. "он классический и элегантный" vs "он классический и элегантен") Liza Zimina 04/2018
|
||||||
|
mkA : (positive : Str) -> Bool -> A = mk5A ; -- postfix adjectives (e.g. "цвета кости") Liza Zimina 04/2018
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mk1A : Str -> A = \positive ->
|
mk1A : Str -> A = \positive ->
|
||||||
@@ -441,12 +446,25 @@ foreign = Foreign; -- +++ MG_UR: added +++
|
|||||||
adjInvar : Str -> Adjective = \stem -> { s = \\_ => stem } ;
|
adjInvar : Str -> Adjective = \stem -> { s = \\_ => stem } ;
|
||||||
|
|
||||||
oper mkAdjDeg: Adjective -> Str -> A = \adj, s ->
|
oper mkAdjDeg: Adjective -> Str -> A = \adj, s ->
|
||||||
{ s = table
|
{s = table
|
||||||
{
|
{
|
||||||
Posit => adj.s ;
|
Posit => adj.s ;
|
||||||
Compar => \\af => s ;
|
Compar => \\af => s ;
|
||||||
Superl => \\af => samuj.s !af ++ adj.s ! af
|
Superl => \\af => samuj.s !af ++ adj.s ! af
|
||||||
}
|
} ;
|
||||||
|
p = False ;
|
||||||
|
preferShort = PrefShort
|
||||||
|
} ** {lock_A = <>};
|
||||||
|
|
||||||
|
oper mkAdjDegFull: Adjective -> Str -> ShortFormPreference -> A = \adj, s,sfp ->
|
||||||
|
{s = table
|
||||||
|
{
|
||||||
|
Posit => adj.s ;
|
||||||
|
Compar => \\af => s ;
|
||||||
|
Superl => \\af => samuj.s !af ++ adj.s ! af
|
||||||
|
} ;
|
||||||
|
p = False ;
|
||||||
|
preferShort = sfp
|
||||||
} ** {lock_A = <>};
|
} ** {lock_A = <>};
|
||||||
|
|
||||||
|
|
||||||
@@ -551,5 +569,40 @@ foreign = Foreign; -- +++ MG_UR: added +++
|
|||||||
mkV2S v p cas = v ** {c2 = {s=p; c=cas}; lock_V2S = <>};
|
mkV2S v p cas = v ** {c2 = {s=p; c=cas}; lock_V2S = <>};
|
||||||
mkV2Q v p cas = v ** {c2 = {s=p; c=cas}; lock_V2Q = <>};
|
mkV2Q v p cas = v ** {c2 = {s=p; c=cas}; lock_V2Q = <>};
|
||||||
mkV2A v p cas = v ** {c2 = {s=p; c=cas}; lock_V2A = <>};
|
mkV2A v p cas = v ** {c2 = {s=p; c=cas}; lock_V2A = <>};
|
||||||
} ;
|
|
||||||
|
|
||||||
|
-- Liza Zimina 04/2018: to make correct short forms of adjectives
|
||||||
|
|
||||||
|
mk3A : Str -> Str -> Str -> Str -> Str -> A = \positive,shortMasc,shortFem,shortNeut,shortPl ->
|
||||||
|
let {koren = Predef.tk 2 positive ;
|
||||||
|
comparative = koren + "ее"} in
|
||||||
|
case positive of {
|
||||||
|
stem+"ый" => mkAdjDeg (aRegHardWorstCase StemStress Qual stem shortMasc shortFem shortNeut shortPl) comparative ;
|
||||||
|
stem+"ой" => mkAdjDeg (aRegHardWorstCase EndStress Qual stem shortMasc shortFem shortNeut shortPl) comparative ;
|
||||||
|
stem@(_+("г"|"к"|"х"))+"ий" => mkAdjDeg (aRegHardWorstCase StemStress Qual stem shortMasc shortFem shortNeut shortPl) comparative;
|
||||||
|
stem@(_+("ш"|"ж"|"ч"|"щ"))+"ий" => mkAdjDeg (aRegHardWorstCase StemStress Qual stem shortMasc shortFem shortNeut shortPl) comparative;
|
||||||
|
stem+"ий" => mkAdjDeg (aRegSoftWorstCase Qual stem shortMasc shortFem shortNeut shortPl) comparative ;
|
||||||
|
stem => mkAdjDeg (adjInvar stem) comparative
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mk4A : Str -> ShortFormPreference -> A = \positive,prefshort ->
|
||||||
|
let {koren = Predef.tk 2 positive ;
|
||||||
|
comparative = koren + "ее"} in
|
||||||
|
case positive of {
|
||||||
|
stem+"ый" => mkAdjDegFull (aRegHardFull StemStress Qual stem) comparative prefshort ;
|
||||||
|
stem+"ой" => mkAdjDegFull (aRegHardFull EndStress Qual stem) comparative prefshort ;
|
||||||
|
stem@(_+("г"|"к"|"х"))+"ий" => mkAdjDegFull (aRegHardFull StemStress Qual stem) comparative prefshort ;
|
||||||
|
stem@(_+("ш"|"ж"|"ч"|"щ"))+"ий" => mkAdjDegFull (aRegHardFull StemStress Qual stem) comparative prefshort ;
|
||||||
|
stem+"ий" => mkAdjDegFull (aRegSoftFull Qual stem) comparative prefshort ;
|
||||||
|
stem => mkAdjDegFull (adjInvar stem) comparative prefshort
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mk5A : Str -> Bool -> A = \adj,postfix ->
|
||||||
|
case postfix of {
|
||||||
|
False => mk1A adj ;
|
||||||
|
True => lin A {
|
||||||
|
s = \\d,af => adj ;
|
||||||
|
p = True ;
|
||||||
|
preferShort = PrefFull
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
} ;
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ concrete PhraseRus of Phrase = CatRus ** open Prelude, ResRus in {
|
|||||||
|
|
||||||
UttIP ip = {s = ip.s ! PF Nom No NonPoss} ; --- Acc also
|
UttIP ip = {s = ip.s ! PF Nom No NonPoss} ; --- Acc also
|
||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
UttNP np = {s = np.s ! PF Acc No NonPoss} ;
|
UttNP np = {s = np.s ! PF Nom No NonPoss} ; -- why was Acc instead of Nom here? (Liza Zimina 04/2018)
|
||||||
UttVP vp = {s = vp.s ! ClInfinit ! GSg Masc ! P3} ;
|
UttVP vp = {s = vp.s ! ClInfinit ! GSg Masc ! P3} ;
|
||||||
UttAdv adv = adv ;
|
UttAdv adv = adv ;
|
||||||
UttCN n = {s = n.s ! NF Sg Nom nom} ;
|
UttCN n = {s = n.nounpart ! NF Sg Nom nom ++ n.relcl ! Sg ! Nom} ;
|
||||||
UttCard n = {s = n.s ! Neut ! Inanimate ! Nom} ;
|
UttCard n = {s = n.s ! Neut ! Inanimate ! Nom} ;
|
||||||
UttAP ap = {s = ap.s ! AF Nom Inanimate (GSg Neut)} ; ---- gennum ? (AR)
|
UttAP ap = {s = ap.s ! AF Nom Inanimate (GSg Neut)} ; ---- gennum ? (AR)
|
||||||
UttInterj i = i ;
|
UttInterj i = i ;
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ concrete QuestionRus of Question = CatRus ** open ResRus, Prelude in {
|
|||||||
{s = \\pf => case kakoj.c of {
|
{s = \\pf => case kakoj.c of {
|
||||||
Nom =>
|
Nom =>
|
||||||
kakoj.s ! AF (extCase pf) okhotnik.anim (gennum okhotnik.g kakoj.n) ++
|
kakoj.s ! AF (extCase pf) okhotnik.anim (gennum okhotnik.g kakoj.n) ++
|
||||||
okhotnik.s ! NF kakoj.n (extCase pf) nom ;
|
okhotnik.nounpart ! NF kakoj.n (extCase pf) nom ++ okhotnik.relcl ! kakoj.n ! extCase pf ;
|
||||||
_ =>
|
_ =>
|
||||||
kakoj.s ! AF (extCase pf) okhotnik.anim (gennum okhotnik.g kakoj.n) ++
|
kakoj.s ! AF (extCase pf) okhotnik.anim (gennum okhotnik.g kakoj.n) ++
|
||||||
okhotnik.s ! NF kakoj.n kakoj.c plg };
|
okhotnik.nounpart ! NF kakoj.n kakoj.c plg } ++ okhotnik.relcl ! kakoj.n ! kakoj.c ;
|
||||||
n = kakoj.n ;
|
n = kakoj.n ;
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
pron = False;
|
pron = False;
|
||||||
|
|||||||
@@ -287,6 +287,7 @@ oper
|
|||||||
-- Fixing this would require changing the Degree type.
|
-- Fixing this would require changing the Degree type.
|
||||||
param
|
param
|
||||||
AdjForm = AF Case Animacy GenNum | AFShort GenNum | AdvF;
|
AdjForm = AF Case Animacy GenNum | AFShort GenNum | AdvF;
|
||||||
|
ShortFormPreference = PrefShort | PrefFull ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Complement = {s : Str ; c : Case} ;
|
Complement = {s : Str ; c : Case} ;
|
||||||
@@ -318,7 +319,7 @@ oper numAF: AdjForm -> Number = \af ->
|
|||||||
case af of { AdvF => Sg; AFShort gn => numGenNum gn; AF _ _ gn => (numGenNum gn) } ;
|
case af of { AdvF => Sg; AFShort gn => numGenNum gn; AF _ _ gn => (numGenNum gn) } ;
|
||||||
|
|
||||||
oper genAF: AdjForm -> Gender = \af ->
|
oper genAF: AdjForm -> Gender = \af ->
|
||||||
case af of { AdvF => Neut; AFShort gn => genGNum gn; AF _ _ gn => (genGNum gn) } ;
|
case af of { AdvF => Neut; AFShort gn => genGNum gn; AF _ _ gn => genGNum gn } ;
|
||||||
|
|
||||||
oper caseAF: AdjForm -> Case = \af ->
|
oper caseAF: AdjForm -> Case = \af ->
|
||||||
case af of { AdvF => Nom; AFShort _ => Nom; AF c _ _ => c } ;
|
case af of { AdvF => Nom; AFShort _ => Nom; AF c _ _ => c } ;
|
||||||
|
|||||||
@@ -33,11 +33,15 @@ lin
|
|||||||
during_Prep = { s = ["в течение"] ; c = Gen};
|
during_Prep = { s = ["в течение"] ; c = Gen};
|
||||||
either7or_DConj = sd2 "либо" [", либо"] ** {n = Sg} ;
|
either7or_DConj = sd2 "либо" [", либо"] ** {n = Sg} ;
|
||||||
-- comma is not visible in GUI!
|
-- comma is not visible in GUI!
|
||||||
every_Det = kazhdujDet ** {n = Sg ; g = PNoGen; c= Nom; size = nom} ;
|
every_Det = {
|
||||||
everybody_NP = mkNP Pl (UseN ((eEnd_Decl "вс")**{lock_N=<>})) ;
|
s = \\c,a,g => kazhdujDet.s ! AF c a (gennum g Sg) ;
|
||||||
|
n = Sg ; g = PNoGen ; c = Nom ; size = nom} ;
|
||||||
|
everybody_NP = DetCN (DetQuant IndefArt NumPl) (UseN ((eEnd_Decl "вс")**{lock_N=<>})) ;
|
||||||
everything_NP = UsePron (pronVseInanimate ** {lock_Pron=<>}) ;
|
everything_NP = UsePron (pronVseInanimate ** {lock_Pron=<>}) ;
|
||||||
everywhere_Adv = ss "везде" ;
|
everywhere_Adv = ss "везде" ;
|
||||||
few_Det = nemnogoSgDet **{lock_Det= <>; n= Sg; g = PNoGen; c = Nom; size = plg};
|
few_Det = {
|
||||||
|
s = \\c,a,g => nemnogoSgDet.s ! AF c a (gennum g Sg) ;
|
||||||
|
n = Sg ; g = PNoGen ; c = Nom ; size = plg} ;
|
||||||
--- DEPREC first_Ord = (uy_j_EndDecl "перв" ) ** {lock_A = <>}; --AStaruyj
|
--- DEPREC first_Ord = (uy_j_EndDecl "перв" ) ** {lock_A = <>}; --AStaruyj
|
||||||
for_Prep = { s = "для" ; c = Gen };
|
for_Prep = { s = "для" ; c = Gen };
|
||||||
from_Prep = { s = "от" ; c = Gen };
|
from_Prep = { s = "от" ; c = Gen };
|
||||||
@@ -54,13 +58,17 @@ lin
|
|||||||
in_Prep = { s = "в" ; c = Prepos PrepVNa } ;
|
in_Prep = { s = "в" ; c = Prepos PrepVNa } ;
|
||||||
it_Pron = pronOno ;
|
it_Pron = pronOno ;
|
||||||
less_CAdv = {s="менее"; p=""} ;
|
less_CAdv = {s="менее"; p=""} ;
|
||||||
many_Det = mnogoSgDet ** {n = Sg; g = (PGen Neut); c= Gen; size = plg} ;
|
many_Det = {
|
||||||
|
s = \\c,a,g => mnogoSgDet.s ! AF c a (gennum g Sg) ;
|
||||||
|
n = Sg; g = (PGen Neut); c = Gen; size = plg} ;
|
||||||
more_CAdv = {s="более"; p=""} ;
|
more_CAdv = {s="более"; p=""} ;
|
||||||
most_Predet = bolshinstvoSgDet ** {n = Sg; g = (PGen Neut); c= Gen; size = plg} ;
|
most_Predet = bolshinstvoSgDet ** {n = Sg; g = (PGen Neut); c= Gen; size = plg} ;
|
||||||
-- inanimate, Sg: "большинство телефонов безмолству-ет"
|
-- inanimate, Sg: "большинство телефонов безмолвству-ет"
|
||||||
-- most8many_Det = bolshinstvoPlDet ** {n = Pl; g = (PGen Neut); c= Gen} ;
|
-- most8many_Det = bolshinstvoPlDet ** {n = Pl; g = (PGen Neut); c= Gen} ;
|
||||||
-- animate, Pl: "большинство учащихся хорошо подготовлен-ы"
|
-- animate, Pl: "большинство учащихся хорошо подготовлен-ы"
|
||||||
much_Det = mnogoSgDet ** {n = Sg; g = (PGen Neut); c= Gen; size = plg} ; -- same as previous
|
much_Det = {
|
||||||
|
s = \\c,a,g => mnogoSgDet.s ! AF c a (gennum g Sg) ;
|
||||||
|
n = Sg ; g = (PGen Neut) ; c= Gen ; size = plg} ; -- same as previous
|
||||||
must_VV = verbDolzhen ;
|
must_VV = verbDolzhen ;
|
||||||
no_Utt = ss ["Нет"] ;
|
no_Utt = ss ["Нет"] ;
|
||||||
on_Prep = { s = "на" ; c = Prepos PrepVNa };
|
on_Prep = { s = "на" ; c = Prepos PrepVNa };
|
||||||
@@ -76,8 +84,12 @@ lin
|
|||||||
she_Pron = pronOna ;
|
she_Pron = pronOna ;
|
||||||
so_AdA = ss "так";
|
so_AdA = ss "так";
|
||||||
somebody_NP = UsePron (pronKtoTo** {lock_Pron = <>});
|
somebody_NP = UsePron (pronKtoTo** {lock_Pron = <>});
|
||||||
someSg_Det = nekotorujDet ** {n = Sg; g = PNoGen; c= Nom; size = nom} ;
|
someSg_Det = {
|
||||||
somePl_Det = nekotorujDet ** {n = Pl; g = PNoGen; c= Nom; size = nom} ;
|
s = \\c,a,g => nekotorujDet.s ! AF c a (gennum g Sg) ;
|
||||||
|
n = Sg ; g = PNoGen ; c= Nom ; size = nom} ;
|
||||||
|
somePl_Det = {
|
||||||
|
s = \\c,a,g => nekotorujDet.s ! AF c a (gennum g Pl) ;
|
||||||
|
n = Pl ; g = PNoGen ; c= Nom ; size = nom} ;
|
||||||
something_NP = UsePron (pronChtoTo** {lock_Pron=<> }) ;
|
something_NP = UsePron (pronChtoTo** {lock_Pron=<> }) ;
|
||||||
somewhere_Adv = ss "где-нибудь" ;
|
somewhere_Adv = ss "где-нибудь" ;
|
||||||
that_Quant = totDet ** {n = Sg; g = PNoGen; c= Nom; size = nom} ;
|
that_Quant = totDet ** {n = Sg; g = PNoGen; c= Nom; size = nom} ;
|
||||||
@@ -107,7 +119,7 @@ lin
|
|||||||
whoPl_IP = pron2NounPhraseNum pronKto Animate Pl;
|
whoPl_IP = pron2NounPhraseNum pronKto Animate Pl;
|
||||||
whoSg_IP = pron2NounPhraseNum pronKto Animate Sg;
|
whoSg_IP = pron2NounPhraseNum pronKto Animate Sg;
|
||||||
why_IAdv = ss "почему" ;
|
why_IAdv = ss "почему" ;
|
||||||
with_Prep = { s = "с" ; c = Inst};
|
with_Prep = {s = pre {#sconsonant => "со" ; ("щ"|"Щ") => "со" ; _ => "с"} ; c = Inst} ;
|
||||||
without_Prep = { s = "без" ; c = Gen};
|
without_Prep = { s = "без" ; c = Gen};
|
||||||
youPl_Pron = pronVu Masc;
|
youPl_Pron = pronVu Masc;
|
||||||
yes_Utt = ss ["Да"] ;
|
yes_Utt = ss ["Да"] ;
|
||||||
@@ -134,4 +146,9 @@ lin
|
|||||||
--- AgentPrep = { s = "" ; c = Nom}; -- missing in Russian
|
--- AgentPrep = { s = "" ; c = Nom}; -- missing in Russian
|
||||||
|
|
||||||
lin language_title_Utt = ss "Русский" ;
|
lin language_title_Utt = ss "Русский" ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
sconsonant : pattern Str = #(("с"|"з"|"ж"|"ш"|"л"|"ль"|"р"|"м"|"в"|"С"|"З"|"Ж"|"Ш"|"Л"|"Ль"|"Р"|"М"|"В"|"ЛЬ") +
|
||||||
|
("б" | "в" | "г" | "д" | "ж" | "з" | "й" | "к" | "л" | "м" | "н" | "п" | "р" | "с" | "т" | "ф" | "х" | "ц" | "ч" | "ш" | "щ" |
|
||||||
|
"Б" | "В" | "Г" | "Д" | "Ж" | "З" | "Й" | "К" | "Л" | "М" | "Н" | "П" | "Р" | "С" | "Т" | "Ф" | "Х" | "Ц" | "Ч" | "Ш" | "Щ")) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,19 +87,19 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in {
|
|||||||
CompCN zloj ={
|
CompCN zloj ={
|
||||||
s= \\clf,gn,p =>
|
s= \\clf,gn,p =>
|
||||||
let num = numGenNum gn ;
|
let num = numGenNum gn ;
|
||||||
zlojsg = zloj.s ! NF Sg Nom nom ;
|
zlojsg = zloj.nounpart ! NF Sg Nom nom ++ zloj.relcl ! Sg ! Nom ;
|
||||||
zlojpl = zloj.s ! NF Pl Nom plg
|
zlojpl = zloj.nounpart ! NF Pl Nom plg ++ zloj.relcl ! Pl ! Nom
|
||||||
in
|
in
|
||||||
case clf of {
|
case clf of {
|
||||||
-- person is ignored !
|
-- person is ignored !
|
||||||
ClInfinit => "быть" ++ zloj.s ! NF Sg Inst nom ;
|
ClInfinit => "быть" ++ zloj.nounpart ! NF Sg Inst nom ++ zloj.relcl ! Sg ! Inst ;
|
||||||
ClImper => case gn of
|
ClImper => case gn of
|
||||||
{ (GSg _) => "будь" ++ zloj.s ! NF Sg Inst plg ;
|
{ (GSg _) => "будь" ++ zloj.nounpart ! NF Sg Inst plg ++ zloj.relcl ! Sg ! Inst ;
|
||||||
GPl => "будьте" ++ zloj.s ! NF Pl Inst plg
|
GPl => "будьте" ++ zloj.nounpart ! NF Pl Inst plg ++ zloj.relcl ! Pl ! Inst
|
||||||
};
|
};
|
||||||
-- infinitive does not save GenNum,
|
-- infinitive does not save GenNum,
|
||||||
-- but indicative does for the sake of adjectival predication !
|
-- but indicative does for the sake of adjectival predication !
|
||||||
ClIndic Present _ | ClCondit => zloj.s ! NF num Nom nom ;
|
ClIndic Present _ | ClCondit => zloj.nounpart ! NF num Nom nom ++ zloj.relcl ! num ! Nom ;
|
||||||
ClIndic PastRus _ => case gn of
|
ClIndic PastRus _ => case gn of
|
||||||
{ (GSg Fem) => "была" ++ zlojsg ;
|
{ (GSg Fem) => "была" ++ zlojsg ;
|
||||||
(GSg Masc) => "был" ++ zlojsg ;
|
(GSg Masc) => "был" ++ zlojsg ;
|
||||||
|
|||||||
Reference in New Issue
Block a user