forked from GitHub/gf-rgl
added a contruction; fixed negation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
|
||||
concrete CatRus of Cat = CommonX - [AdV, mkAdV] ** open ResRus, Prelude in {
|
||||
flags coding=utf8 ; optimize=all ;
|
||||
lincat
|
||||
N = ResRus.NounForms ;
|
||||
@@ -29,6 +29,11 @@ lincat
|
||||
A, Ord = ResRus.AdjForms ;
|
||||
A2 = ResRus.AdjForms ** {c : ComplementCase} ;
|
||||
|
||||
AdV = {
|
||||
s : Str ;
|
||||
p : Polarity
|
||||
} ;
|
||||
|
||||
V, VS, VQ, VA = ResRus.VerbForms ;
|
||||
V2, V2S, V2Q, V2A, V2V = ResRus.VerbForms2 ;
|
||||
V3 = ResRus.VerbForms3 ;
|
||||
@@ -136,7 +141,8 @@ linref
|
||||
= {verb = s.verb ;
|
||||
adv = s.adv ;
|
||||
dep = s.dep ;
|
||||
compl = \\p, a => s.compl1 ! p ! a ++ s.c.s ++ s.compl2 ! p ! a
|
||||
compl = \\p, a => s.compl1 ! p ! a ++ s.c.s ++ s.compl2 ! p ! a ;
|
||||
p = s.p
|
||||
}
|
||||
in vp.adv ! Ag (GSg Neut) P3 ++ (verbInf vp.verb) ++ vp.dep ++ vp.compl ! Pos ! Ag (GSg Neut) P3 ;
|
||||
Cl = \s -> s.subj ++ s.adv ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Pos ;
|
||||
|
||||
@@ -102,8 +102,11 @@ concrete ConjunctionRus of Conjunction =
|
||||
ConjAdv = conjunctDistrSS ;
|
||||
-- : Conj -> ListIAdv -> IAdv ; -- where or why
|
||||
ConjIAdv = conjunctDistrSS ;
|
||||
-- : Conj -> ListAdV -> AdV ; -- always or sometimes
|
||||
ConjAdV = conjunctDistrSS ;
|
||||
-- : Conj -> ListAdV -> AdV ; -- always or sometimes;
|
||||
ConjAdV conj xs = {
|
||||
s = conj.s1 ++ xs.s1 ++ conj.s2 ++ xs.s2 ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
-- : Conj -> ListAP -> AP ; -- cold and warm
|
||||
ConjAP conj xs = conjunctDistrTable3 GenNum Animacy Case conj xs ** {
|
||||
|
||||
@@ -45,6 +45,7 @@ lin
|
||||
verb=copulaEll ;
|
||||
dep=[] ;
|
||||
compl=\\p,a => (timeunitAdv card year_Timeunit).s;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
-- : NP -> QCl ; -- how old is x / quanti anni ha x (Ita)
|
||||
|
||||
@@ -14,7 +14,8 @@ concrete ExtendRus of Extend =
|
||||
-- AdvIsNPAP, AdAdV, AdjAsNP,
|
||||
ApposNP,
|
||||
-- BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2,
|
||||
-- MkVPS, ConjVPS, MkVPI, ConjVPI, ComplVPIVV,
|
||||
-- MkVPS,
|
||||
-- ConjVPS, MkVPI, ConjVPI, ComplVPIVV,
|
||||
-- MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2,
|
||||
-- Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN,
|
||||
-- CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP,
|
||||
@@ -42,7 +43,8 @@ concrete ExtendRus of Extend =
|
||||
PastPartAP,
|
||||
PastPartAgentAP,
|
||||
PositAdVAdj,
|
||||
-- PredVPS, PredVPSVV, PredetRNP, PrepCN,
|
||||
PredVPS,
|
||||
-- PredVPSVV, PredetRNP, PrepCN,
|
||||
-- EmbedSSlash, PresPartAP,
|
||||
PurposeVP,
|
||||
-- ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash,
|
||||
@@ -89,7 +91,7 @@ lin
|
||||
ExistsNP np = {
|
||||
subj=[] ;
|
||||
adv=[] ;
|
||||
verb=M.to_exist ;
|
||||
verb=copulaFull ;
|
||||
dep=[] ;
|
||||
compl=table {
|
||||
Pos => np.s ! Nom ;
|
||||
@@ -98,6 +100,8 @@ lin
|
||||
a=np.a
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
iFem_Pron = personalPron (Ag (GSg Fem) P1) ;
|
||||
youFem_Pron = personalPron (Ag (GSg Fem) P2) ;
|
||||
|
||||
@@ -221,7 +225,7 @@ lin
|
||||
UttAdV adv = {s=adv.s} ;
|
||||
|
||||
-- : A -> AdV ; -- (that she) positively (sleeps)
|
||||
PositAdVAdj a = ss a.sn ;
|
||||
PositAdVAdj a = ss a.sn ** {p=Pos} ;
|
||||
|
||||
-- : NP -> SSlash -> Utt ; -- her I love
|
||||
FocusObj np ss = {
|
||||
@@ -314,6 +318,16 @@ lin
|
||||
a=Ag (gennum g (numSizeNumber det.size)) P3
|
||||
} ;
|
||||
|
||||
--PredVPS np vps = {s = np.s ! Nom ++ vps.c.s } ;
|
||||
|
||||
-- mkVPS : Temp -> Pol -> VP -> VPS
|
||||
--MkVPS t p vp = {
|
||||
-- s = \\a =>
|
||||
-- let verb = vp.verb ;
|
||||
-- compl = vp.compl
|
||||
-- in verb
|
||||
-- } ;
|
||||
|
||||
oper
|
||||
rus_quoted : Str -> Str = \s -> "«" ++ s ++ "»" ; ---- TODO bind ; move to Prelude?
|
||||
|
||||
|
||||
@@ -170,6 +170,19 @@ lin
|
||||
-- : NP -> Comp ; -- (Париж) - столица Франции
|
||||
CompNomNP np = {s=\\a=>np.s ! Nom ; adv=[] ; cop=NomCopula} ;
|
||||
|
||||
-- : NP -> Adv -> Cl ; -- у них есть дети
|
||||
ExistsNPAdv np adv = {
|
||||
subj=[] ;
|
||||
adv=adv.s ;
|
||||
verb=copulaFull ;
|
||||
dep=[] ;
|
||||
compl=table {
|
||||
Pos => np.s ! Nom ;
|
||||
Neg => np.s ! Gen
|
||||
} ;
|
||||
a=np.a
|
||||
} ;
|
||||
|
||||
oper
|
||||
est_V : V = lin V {
|
||||
inf="есть";
|
||||
@@ -190,6 +203,7 @@ oper
|
||||
-- refl=NonReflexive;
|
||||
-- tran=Transitive
|
||||
} ;
|
||||
|
||||
est_ell_V = est_V ** {prsg1, prsg2, prsg3, prpl1, prpl2, prpl3=""} ;
|
||||
be_ell_V = est_ell_V ** {inf=""} ;
|
||||
net_V : V = lin V {
|
||||
|
||||
@@ -46,6 +46,7 @@ fun
|
||||
that_way_Adv : Adv ;
|
||||
any_way_Adv : Adv ;
|
||||
never_Adv : Adv ;
|
||||
never_AdV : AdV ;
|
||||
from_nowhere_Adv : Adv ;
|
||||
to_nowhere_Adv : Adv ;
|
||||
nowhere_Adv : Adv ;
|
||||
@@ -112,4 +113,5 @@ fun
|
||||
TransgrAsAdv1 : Temp -> Pol -> VPSlash -> Adv ;
|
||||
UttImpImm : Pol -> Imp -> Utt ;
|
||||
CompNomNP : NP -> Comp ;
|
||||
ExistsNPAdv : NP -> Adv -> Cl ;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ concrete GrammarRus of Grammar =
|
||||
RelativeRus,
|
||||
ConjunctionRus,
|
||||
PhraseRus,
|
||||
TextX,
|
||||
TextX- [AdV],
|
||||
StructuralRus,
|
||||
IdiomRus,
|
||||
TenseRus,
|
||||
|
||||
@@ -64,15 +64,17 @@ lin
|
||||
compl=\\_ => [] ;
|
||||
a=ip.a
|
||||
} ;
|
||||
|
||||
-- : NP -> Adv -> Cl ; -- there is a house in Paris
|
||||
ExistNPAdv np adv = {
|
||||
subj=np.s ! Nom ;
|
||||
adv=adv.s ;
|
||||
verb=to_exist ;
|
||||
subj=np.s ! Nom ;
|
||||
verb= copulaEll ;
|
||||
dep=[] ;
|
||||
compl=\\_ => [] ;
|
||||
a=np.a
|
||||
} ;
|
||||
|
||||
-- : IP -> Adv -> QCl ; -- which houses are there in Paris
|
||||
ExistIPAdv ip adv = {
|
||||
subj=ip.nom ; -- gen?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--# -path=.:../abstract:../common
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
--1 Russian Lexical Paradigms
|
||||
|
||||
resource ParadigmsRus = open CatRus, ResRus, (R=ResRus), ParamRus, (Z=InflectionRus), Prelude, Maybe, MorphoRus in {
|
||||
resource ParadigmsRus = open CatRus, ResRus, (R=ResRus), ParamRus, (Z=InflectionRus), TenseRus, Maybe, MorphoRus, Prelude in {
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
@@ -742,15 +742,18 @@ oper
|
||||
= \s -> lin Adv (makeAdverb s) ;
|
||||
} ;
|
||||
|
||||
mkAdV : Str -> AdV
|
||||
= \s -> lin AdV (makeAdverb s) ;
|
||||
|
||||
mkAdA : Str -> AdA
|
||||
= \s -> lin AdA (makeAdverb s) ;
|
||||
|
||||
mkAdN : Str -> AdN
|
||||
= \s -> lin AdN (makeAdverb s) ;
|
||||
|
||||
mkAdV : Str -> AdV
|
||||
= \s -> lin AdV {s = s; p = Pos} ;
|
||||
|
||||
mkAdVNeg : Str -> AdV
|
||||
= \s -> lin AdV {s = s; p = Neg} ;
|
||||
|
||||
mkIAdv : Str -> IAdv
|
||||
= \s -> lin IAdv (makeAdverb s) ;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
resource ParamRus = ParamX, CommonX [Temp] ** open Prelude, Maybe in {
|
||||
resource ParamRus = ParamX - [mkAdV, AdV], CommonX [Temp] ** open Prelude, Maybe in {
|
||||
-- Mostly follows https://en.wikipedia.org/wiki/List_of_glossing_abbreviations
|
||||
-- see theory.txt
|
||||
|
||||
|
||||
@@ -203,6 +203,12 @@ oper
|
||||
ellNoun : NounForms -> NounForms
|
||||
= \n -> noMinorCases (immutableNounCases "" n.g n.anim) ;
|
||||
|
||||
orPol : Polarity -> Polarity -> Polarity = \p1,p2 ->
|
||||
case p1 of {
|
||||
Neg => Neg;
|
||||
Pos => p2
|
||||
} ;
|
||||
|
||||
AgrTable = Agr => Str ;
|
||||
ComplTable = Polarity => Agr => Str ;
|
||||
PolarityTable = Polarity => Str ;
|
||||
@@ -399,6 +405,8 @@ oper
|
||||
the_most = guessAdjectiveForms "самый" ;
|
||||
utmost_Adv = makeAdverb "наиболее" ;
|
||||
|
||||
|
||||
|
||||
-- [ISACHENKO],p.220 there are three forms in Russian: самый важный; наиболее важный/важен; важнее (всех, всего)
|
||||
-- here only first one:
|
||||
long_superlative : AdjForms -> AdjForms
|
||||
@@ -589,6 +597,8 @@ oper
|
||||
comp = a1.sn ++ l ++ a2.comp ;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
---------------------
|
||||
-- Verbs -- Глаголы
|
||||
|
||||
@@ -603,7 +613,8 @@ oper
|
||||
adv : AgrTable ; -- modals are in position of adverbials ones numgen gets fixed
|
||||
verb : ResRus.VerbForms ;
|
||||
dep : Str ; -- dependent infinitives and such
|
||||
compl : ComplTable
|
||||
compl : ComplTable ;
|
||||
p : Polarity
|
||||
} ;
|
||||
|
||||
VPSlash = {
|
||||
@@ -614,6 +625,7 @@ oper
|
||||
compl2 : ComplTable ;
|
||||
c : ComplementCase ;
|
||||
isSimple : Bool ; -- regulates the place of participle used as adjective
|
||||
p : Polarity
|
||||
} ; ----
|
||||
|
||||
slashV : VerbForms -> ComplementCase -> VPSlash = \verb,c -> {
|
||||
@@ -623,6 +635,7 @@ oper
|
||||
compl2 = \\_,a => [] ;
|
||||
dep = [] ;
|
||||
c = c ;
|
||||
p = Pos ;
|
||||
isSimple = True
|
||||
} ;
|
||||
|
||||
@@ -645,7 +658,8 @@ oper
|
||||
} ;
|
||||
c = {s="" ; c=Acc ; neggen=True ; hasPrep=False};
|
||||
dep = slash.dep ;
|
||||
isSimple = False
|
||||
isSimple = False ;
|
||||
p = slash.p
|
||||
} ;
|
||||
|
||||
insertSlashObj1 : (Polarity => Agr => Str) -> ComplementCase -> VPSlash -> VPSlash = \obj,c,slash -> {
|
||||
@@ -655,7 +669,8 @@ oper
|
||||
compl2 = slash.compl2 ;
|
||||
c = slash.c ;
|
||||
dep = slash.dep ;
|
||||
isSimple = False
|
||||
isSimple = False ;
|
||||
p = slash.p
|
||||
} ;
|
||||
|
||||
insertSlashObj2 : (Polarity => Agr => Str) -> ComplementCase -> VPSlash -> VPSlash = \obj,c,slash -> {
|
||||
@@ -665,7 +680,8 @@ oper
|
||||
compl2 =\\p,a => slash.compl2 ! p ! a ++ obj ! p ! a;
|
||||
c = slash.c ;
|
||||
dep = slash.dep ;
|
||||
isSimple = False
|
||||
isSimple = False ;
|
||||
p = slash.p
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1582,6 +1598,7 @@ oper
|
||||
makeAdverb : Str -> Adverb
|
||||
= \word -> {s=word} ;
|
||||
|
||||
|
||||
--------------------------------
|
||||
-- combining nouns with numerals
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ lin
|
||||
-- : VP -> Imp ; -- love yourselves
|
||||
ImpVP vp = {
|
||||
s = \\polarity, gn =>
|
||||
let pol = case polarity of {Neg => PNeg; Pos => PPos} in
|
||||
let pol = case (R.orPol vp.p polarity) of {Neg => PNeg; Pos => PPos} in
|
||||
let a = Ag gn P2 in
|
||||
(R.verbEnvAgr "" "" vp.verb Imperative Pres a pol)
|
||||
++ vp.dep
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
concrete StructuralRus of Structural = CatRus **
|
||||
open ParadigmsRus, ResRus, MorphoRus, (X = ConstructX), Coordination, Prelude in {
|
||||
open ParadigmsRus, ResRus, MorphoRus, ParamRus, Maybe, (X = ConstructX), Coordination, Prelude in {
|
||||
|
||||
lin
|
||||
i_Pron = personalPron (Ag MSg P1) ;
|
||||
@@ -82,6 +82,8 @@ lin
|
||||
there_Adv = mkAdv "там" ;
|
||||
there7to_Adv = mkAdv "туда" ;
|
||||
there7from_Adv = mkAdv "оттуда" ;
|
||||
always_AdV = mkAdV "всегда";
|
||||
--always_AdV = {s="всегда"; p=Pos} ;
|
||||
|
||||
how_IAdv = ss "как" ;
|
||||
how8much_IAdv = ss "сколько" ;
|
||||
@@ -162,7 +164,6 @@ lin
|
||||
|
||||
almost_AdA = ss "почти" ;
|
||||
almost_AdN = ss "почти" ;
|
||||
always_AdV = ss "всегда" ;
|
||||
at_least_AdN = ss "по меньшей мере" ;
|
||||
at_most_AdN = ss "самое большее" ;
|
||||
too_AdA = ss "слишком" ;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
concrete TenseRus of Tense = TenseX - [PNeg,PPos] ** open (R = ParamX) in {
|
||||
concrete TenseRus of Tense = TenseX - [PNeg,PPos,AdV] ** open (R = ParamX) in {
|
||||
flags coding=utf8 ; optimize=all ;
|
||||
lin
|
||||
PNeg = {
|
||||
|
||||
@@ -6,7 +6,8 @@ lin
|
||||
adv = \\a=>[] ;
|
||||
verb = v ;
|
||||
dep=[] ;
|
||||
compl = \\_,_ => []
|
||||
compl = \\_,_ => [] ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
-- : V2 -> VP ; -- be loved
|
||||
@@ -14,14 +15,16 @@ lin
|
||||
adv = \\a=>[] ;
|
||||
verb = passivate v2 ;
|
||||
dep=[] ;
|
||||
compl = \\p,a => []
|
||||
compl = \\p,a => [] ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
-- : VV -> VP -> VP ; -- want to run
|
||||
ComplVV vv vp = vp ** {
|
||||
verb=vv.v ;
|
||||
dep=verbInf vp.verb ++ vp.dep ;
|
||||
adv=\\a=>vv.modal ! a ++ vp.adv ! a
|
||||
adv=\\a=>vv.modal ! a ++ vp.adv ! a ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
-- : VS -> S -> VP ; -- say that she runs
|
||||
@@ -29,7 +32,8 @@ lin
|
||||
verb = vs ;
|
||||
dep=[] ;
|
||||
adv=\\a=>[] ;
|
||||
compl=\\_,_ => comma ++ "что" ++ s.s ! Ind
|
||||
compl=\\_,_ => comma ++ "что" ++ s.s ! Ind ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
-- : VQ -> QS -> VP ; -- wonder who runs
|
||||
@@ -37,7 +41,8 @@ lin
|
||||
verb = vq ;
|
||||
dep=[] ;
|
||||
adv=\\a=>[] ;
|
||||
compl=\\_,_ => comma ++ "что" ++ qs.s ! QDir
|
||||
compl=\\_,_ => comma ++ "что" ++ qs.s ! QDir ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
|
||||
@@ -49,7 +54,8 @@ lin
|
||||
compl=\\_ => case ap.preferShort of {
|
||||
PreferFull => (\\a => ap.s ! agrGenNum a ! Inanimate ! Ins) ;
|
||||
PrefShort => ap.short
|
||||
}
|
||||
} ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
-- : V2 -> VPSlash ; -- love (it)
|
||||
@@ -79,13 +85,15 @@ lin
|
||||
adv = vps.adv ;
|
||||
dep = vps.dep ;
|
||||
compl = \\p,a => vps.compl1 ! p ! a ++ applyPolPrep p vps.c np ++ vps.compl2 ! p ! a ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
-- : VV -> VPSlash -> VPSlash ; -- want to buy
|
||||
SlashVV vv vps = vps ** {
|
||||
verb=vv.v ;
|
||||
dep=(verbInf vps.verb) ++ vps.dep ;
|
||||
adv=\\a=>vv.modal ! a ++ vps.adv ! a
|
||||
adv=\\a=>vv.modal ! a ++ vps.adv ! a ;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
{- This is very heavy, but can be replaced (see todo.txt)
|
||||
@@ -109,7 +117,8 @@ lin
|
||||
adv=\\a => comp.adv ;
|
||||
verb=selectCopula comp.cop ;
|
||||
dep=[] ;
|
||||
compl=\\p => comp.s
|
||||
compl=\\p => comp.s;
|
||||
p = Pos
|
||||
} ;
|
||||
|
||||
-- : VP -> Adv -> VP ; -- sleep here
|
||||
@@ -123,7 +132,7 @@ lin
|
||||
} ;
|
||||
|
||||
-- : AdV -> VP -> VP ; -- always sleep
|
||||
AdVVP adv vp = vp ** {adv=\\a => adv.s ++ vp.adv ! a} ;
|
||||
AdVVP adv vp = vp ** {adv=\\a => adv.s ++ vp.adv ! a; p = orPol adv.p vp.p} ;
|
||||
|
||||
-- : VPSlash -> Adv -> VPSlash ; -- use (it) here
|
||||
AdvVPSlash vps adv = vps ** {compl1=\\p,a => vps.compl1 ! p ! a ++ adv.s; isSimple=False} ;
|
||||
@@ -153,5 +162,5 @@ lin
|
||||
} ;
|
||||
|
||||
-- : VP ; -- be
|
||||
UseCopula = {adv=\\a=>[] ; verb=copulaIns ; dep=[] ; compl=\\p,a=>[]} ;
|
||||
UseCopula = {adv=\\a=>[] ; verb=copulaIns ; dep=[] ; compl=\\p,a=>[]; p=Pos} ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user