forked from GitHub/gf-rgl
Oridnal numerals added ; many fixes
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
concrete AdjectiveRus of Adjective = CatRus ** open ResRus, Prelude, Coordination in {
|
concrete AdjectiveRus of Adjective = CatRus ** open ResRus, Prelude, Coordination in {
|
||||||
lin
|
lin
|
||||||
-- : A -> AP ; -- warm - тёплый
|
-- : A -> AP ; -- warm - тёплый
|
||||||
PositA a = adjFormsAdjective a ** {isPost = False} ;
|
PositA a = adjFormsAdjective a ** {isPost = a.p} ;
|
||||||
-- : A2 -> AP ; -- married
|
-- : A2 -> AP ; -- married
|
||||||
UseA2 a = adjFormsAdjective a ** {isPost = False} ;
|
UseA2 a = adjFormsAdjective a ** {isPost = False} ;
|
||||||
-- : A -> AP ; -- warmer - теплее
|
-- : A -> AP ; -- warmer - теплее
|
||||||
UseComparA a = adjFormsAdjective (immutableAdjForms a.comp)
|
UseComparA a = adjFormsAdjective (immutableAdjForms a.comp)
|
||||||
** {isPost = False; preferShort = PrefShort} ; -- TODO: non-qual
|
** {isPost = a.p; preferShort = PrefShort} ; -- TODO: non-qual
|
||||||
-- : AP -> Adv -> AP ; -- warm by nature
|
-- : AP -> Adv -> AP ; -- warm by nature
|
||||||
AdvAP ap adv = ap ** {s = \\gn,a,c => adv.s ++ ap.s ! gn ! a ! c ; isPost = False} ;
|
AdvAP ap adv = ap ** {s = \\gn,a,c => adv.s ++ ap.s ! gn ! a ! c ; isPost = False} ;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : Ord -> AP ; -- warmest
|
-- : Ord -> AP ; -- warmest
|
||||||
AdjOrd ord = adjFormsAdjective ord ** {isPost = False; preferShort = PrefFull} ;
|
AdjOrd ord = adjFormsAdjective ord ** {isPost = False; preferShort = PreferFull} ;
|
||||||
|
|
||||||
-- : A2 -> NP -> AP ; -- married to him - замужем за ним (NB: gender change requires different word!)
|
-- : A2 -> NP -> AP ; -- married to him - замужем за ним (NB: gender change requires different word!)
|
||||||
ComplA2 a2 np = let af=adjFormsAdjective a2 in {
|
ComplA2 a2 np = let af=adjFormsAdjective a2 in {
|
||||||
|
|||||||
@@ -63,7 +63,9 @@ lincat
|
|||||||
Predet = ResRus.Adjective ** {size : NumSize} ;
|
Predet = ResRus.Adjective ** {size : NumSize} ;
|
||||||
IQuant = ResRus.Adjective ** {g: Gender; c: Case} ;
|
IQuant = ResRus.Adjective ** {g: Gender; c: Case} ;
|
||||||
Quant = ResRus.Adjective ** {g: Gender; c: Case; type: DetType} ;
|
Quant = ResRus.Adjective ** {g: Gender; c: Case; type: DetType} ;
|
||||||
Num, Numeral, Card = NumDet ;
|
Numeral = NumeralForms ;
|
||||||
|
Num = NumDet ;
|
||||||
|
Card = NumDet ;
|
||||||
Digits = {s : Str ; size: NumSize} ;
|
Digits = {s : Str ; size: NumSize} ;
|
||||||
|
|
||||||
QS = {s : QForm => Str} ;
|
QS = {s : QForm => Str} ;
|
||||||
@@ -99,8 +101,8 @@ linref
|
|||||||
N = \s -> s.snom ;
|
N = \s -> s.snom ;
|
||||||
PN = \s -> s.snom ;
|
PN = \s -> s.snom ;
|
||||||
Pron = \s -> s.nom ;
|
Pron = \s -> s.nom ;
|
||||||
N2 = \s -> s.snom ++ s.c2.s ; -- TODO
|
N2 = \s -> s.snom ++ s.c2.s ;
|
||||||
N3 = \s -> s.snom ++ s.c2.s ++ s.c3.s ; -- TODO
|
N3 = \s -> s.snom ++ s.c2.s ++ s.c3.s ;
|
||||||
A = \s -> case s.preferShort of {PrefShort => s.sm ; _ => s.msnom} ;
|
A = \s -> case s.preferShort of {PrefShort => s.sm ; _ => s.msnom} ;
|
||||||
A2 = \s -> case s.preferShort of {PrefShort => s.sm ; _ => s.msnom} ++ s.c.s ; -- ?
|
A2 = \s -> case s.preferShort of {PrefShort => s.sm ; _ => s.msnom} ++ s.c.s ; -- ?
|
||||||
V = \s -> verbInf s ;
|
V = \s -> verbInf s ;
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ concrete ConjunctionRus of Conjunction =
|
|||||||
BaseCN x y = {
|
BaseCN x y = {
|
||||||
s1 = x.s ;
|
s1 = x.s ;
|
||||||
s2 = y.s ;
|
s2 = y.s ;
|
||||||
g = y.g ;
|
g = conjGender x.g y.g ;
|
||||||
mayben = JustPl ;
|
mayben = JustPl ;
|
||||||
anim = conjAnim x.anim y.anim
|
anim = conjAnim x.anim y.anim
|
||||||
} ;
|
} ;
|
||||||
@@ -202,6 +202,6 @@ concrete ConjunctionRus of Conjunction =
|
|||||||
= \sfp1,sfp2 ->
|
= \sfp1,sfp2 ->
|
||||||
case <sfp1,sfp2> of {
|
case <sfp1,sfp2> of {
|
||||||
<PrefShort, PrefShort> => PrefShort ;
|
<PrefShort, PrefShort> => PrefShort ;
|
||||||
_ => PrefFull
|
_ => PreferFull
|
||||||
} ;
|
} ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ concrete ConstructionRus of Construction = CatRus **
|
|||||||
lin
|
lin
|
||||||
hungry_VP = mkVP (P.mkA "голодный" "" "1*a/c'" PrefShort) ;
|
hungry_VP = mkVP (P.mkA "голодный" "" "1*a/c'" PrefShort) ;
|
||||||
thirsty_VP = mkVP want_VV (mkVP (P.mkV Imperfective "пить" "пью" "пьёт")) ;
|
thirsty_VP = mkVP want_VV (mkVP (P.mkV Imperfective "пить" "пью" "пьёт")) ;
|
||||||
tired_VP = mkVP (P.mkA "усталый" "" "1*a/c'" PrefFull) ;
|
tired_VP = mkVP (P.mkA "усталый" "" "1*a/c'" PreferFull) ;
|
||||||
scared_VP = mkVP (P.mkV Imperfective "бояться" "боюсь" "боится") ; -- intran
|
scared_VP = mkVP (P.mkV Imperfective "бояться" "боюсь" "боится") ; -- intran
|
||||||
ill_VP = mkVP ( P.mkA "больной" "" "1*b" PrefShort) ;
|
ill_VP = mkVP ( P.mkA "больной" "" "1*b" PrefShort) ;
|
||||||
ready_VP = mkVP L.ready_A ;
|
ready_VP = mkVP L.ready_A ;
|
||||||
@@ -87,9 +87,8 @@ lin
|
|||||||
timeHour h = P.mkAdv (in_Prep.s ++ h.s) ;
|
timeHour h = P.mkAdv (in_Prep.s ++ h.s) ;
|
||||||
|
|
||||||
-- : Hour -> Card -> Adv ; -- at six forty a.m./p.m.
|
-- : Hour -> Card -> Adv ; -- at six forty a.m./p.m.
|
||||||
timeHourMinute h card = P.mkAdv ((timeHour h).s ++ BIND ++ ":" ++ BIND ++ card.s ! Neut ! Inanimate ! Nom) ; -- TODO: ?
|
timeHourMinute h card = P.mkAdv ((timeHour h).s ++ BIND ++ ":" ++ BIND ++ card.s ! Neut ! Inanimate ! Nom) ; -- TODO: 00?
|
||||||
|
|
||||||
-- TODO: Fix the following (genders)
|
|
||||||
-- : Weekday -> Adv ; -- on Monday
|
-- : Weekday -> Adv ; -- on Monday
|
||||||
weekdayPunctualAdv w = P.mkAdv (in_Prep.s ++ w.sacc) ; -- on Sunday
|
weekdayPunctualAdv w = P.mkAdv (in_Prep.s ++ w.sacc) ; -- on Sunday
|
||||||
-- : Weekday -> Adv ; -- on Mondays
|
-- : Weekday -> Adv ; -- on Mondays
|
||||||
@@ -134,7 +133,7 @@ lin
|
|||||||
++ cn.s ! numSizeNum Nom card.size ! (numSizeCase Nom card.size)) in { --? Nom?
|
++ cn.s ! numSizeNum Nom card.size ! (numSizeCase Nom card.size)) in { --? Nom?
|
||||||
s=\\gn,anim,cas=> ap.s!gn!anim!cas ++ as_n_units ;
|
s=\\gn,anim,cas=> ap.s!gn!anim!cas ++ as_n_units ;
|
||||||
short=\\a=> ap.short ! a ++ as_n_units ;
|
short=\\a=> ap.short ! a ++ as_n_units ;
|
||||||
preferShort=PrefFull ;
|
preferShort=PreferFull ;
|
||||||
isPost=True
|
isPost=True
|
||||||
} ;
|
} ;
|
||||||
-- This does not work in Russian naturally
|
-- This does not work in Russian naturally
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete DictRus of DictRusAbs = CatRus ** open ParadigmsRus, Prelude,
|
concrete DictRus of DictRusAbs = CatRus ** open ParadigmsRus, Prelude,
|
||||||
ZaliznyakAlgo, -- TODO: convert to Str-based index and remove
|
ZaliznyakAlgo,
|
||||||
ResRus in {
|
ResRus in {
|
||||||
flags optimize=values ; coding=utf8 ;
|
flags optimize=values ; coding=utf8 ;
|
||||||
-- About 1000 most frequent nouns (source: wiktionary)
|
-- About 1000 most frequent nouns (source: wiktionary)
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ oper
|
|||||||
inflVerb : CatRus.V -> Str = \v ->
|
inflVerb : CatRus.V -> Str = \v ->
|
||||||
let fut : Agr=>Str = \\a => verbFutAgree v a in
|
let fut : Agr=>Str = \\a => verbFutAgree v a in
|
||||||
let pres : Agr=>Str = \\a => verbPresAgree v a in
|
let pres : Agr=>Str = \\a => verbPresAgree v a in
|
||||||
let past : Agr=>Str = \\a => (verbPastAgree v a "").p2 in
|
let past : Agr=>Str = \\a => verbPastAgree v a "" in
|
||||||
let imp : Agr=>Str = \\a => ((verbImperativeAgree v a).p1 ++ (verbImperativeAgree v a).p2) in
|
let imp : Agr=>Str = \\a => ((verbImperativeAgree v a).p1 ++ (verbImperativeAgree v a).p2) in
|
||||||
let ppp : GenNum=>Str = \\gn => shortPastPassPart v gn in
|
let ppp : GenNum=>Str = \\gn => shortPastPassPart v gn in
|
||||||
case v.asp of {Imperfective => "несовершенного вида" ; Perfective => "совершенного вида"} ++ "," ++
|
case v.asp of {Imperfective => "несовершенного вида" ; Perfective => "совершенного вида"} ++ "," ++
|
||||||
|
|||||||
@@ -20,17 +20,21 @@ concrete ExtendRus of Extend =
|
|||||||
--ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash,
|
--ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash,
|
||||||
ExistsNP,
|
ExistsNP,
|
||||||
-- ExistCN, ExistMassCN, ExistPluralCN,
|
-- ExistCN, ExistMassCN, ExistPluralCN,
|
||||||
ProDrop,
|
--ProDrop,
|
||||||
-- FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP,
|
-- FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP,
|
||||||
-- GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP,
|
-- GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP,
|
||||||
InOrderToVP,
|
InOrderToVP,
|
||||||
-- MkVPS, NominalizeVPSlashNP,
|
-- MkVPS, NominalizeVPSlashNP,
|
||||||
-- PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN,
|
-- PassAgentVPSlash, PassVPSlash, ProgrVPSlash,
|
||||||
|
PastPartAP,
|
||||||
|
-- PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN,
|
||||||
-- EmbedSSlash, PresPartAP,
|
-- EmbedSSlash, PresPartAP,
|
||||||
PurposeVP,
|
PurposeVP,
|
||||||
-- ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash,
|
-- ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash,
|
||||||
PredIAdvVP
|
PredIAdvVP,
|
||||||
-- UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2
|
-- UncontractedNeg, UttAccIP, UttAccNP,
|
||||||
|
UttAdV
|
||||||
|
-- UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2
|
||||||
]
|
]
|
||||||
with (Grammar=GrammarRus)
|
with (Grammar=GrammarRus)
|
||||||
** open Prelude, ResRus, ParadigmsRus, (M = MorphoRus) in {
|
** open Prelude, ResRus, ParadigmsRus, (M = MorphoRus) in {
|
||||||
@@ -73,8 +77,21 @@ lin
|
|||||||
iFem_Pron = personalPron (Ag (GSg Fem) P1) ;
|
iFem_Pron = personalPron (Ag (GSg Fem) P1) ;
|
||||||
youFem_Pron = personalPron (Ag (GSg Fem) P2) ;
|
youFem_Pron = personalPron (Ag (GSg Fem) P2) ;
|
||||||
|
|
||||||
|
-- : N -> N -> N ;
|
||||||
CompoundN n1 n2 = mkCompoundN n1 "-" n2 ;
|
CompoundN n1 n2 = mkCompoundN n1 "-" n2 ;
|
||||||
|
|
||||||
|
-- VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space
|
||||||
|
PastPartAP vps = {
|
||||||
|
s=\\gn,anim,cas => vps.adv ! (genNumAgrP3 gn)
|
||||||
|
++ (shortPastPassPart vps.verb gn) ++ vps.dep ++ vps.compl ! (genNumAgrP3 gn) ;
|
||||||
|
short=\\a => vps.adv ! a ++ (shortPastPassPart vps.verb (agrGenNum a)) ++ vps.dep ++ vps.compl ! a ++ vps.c.s ; --
|
||||||
|
isPost = False ;
|
||||||
|
preferShort=PreferFull
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- PresPartAP : VP -> AP ; -- (the man) looking at Mary
|
||||||
|
-- use PlP2 + "ый"
|
||||||
|
|
||||||
-- : Pron -> Pron ; -- unstressed subject pronoun becomes empty: "am tired"
|
-- : Pron -> Pron ; -- unstressed subject pronoun becomes empty: "am tired"
|
||||||
ProDrop pron = {
|
ProDrop pron = {
|
||||||
nom,gen,dat,acc,ins,prep=[] ;
|
nom,gen,dat,acc,ins,prep=[] ;
|
||||||
@@ -82,4 +99,7 @@ lin
|
|||||||
poss={msnom,fsnom,nsnom,pnom,msgen,fsgen,pgen,msdat,fsacc,msins,fsins,pins,msprep=[]} ;
|
poss={msnom,fsnom,nsnom,pnom,msgen,fsgen,pgen,msdat,fsacc,msins,fsins,pins,msprep=[]} ;
|
||||||
a=pron.a
|
a=pron.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- : AdV -> Utt ; -- always(!)
|
||||||
|
UttAdV adv = {s=adv.s} ;
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -3,14 +3,13 @@
|
|||||||
concrete ExtraRus of ExtraRusAbs = CatRus **
|
concrete ExtraRus of ExtraRusAbs = CatRus **
|
||||||
open ResRus, MorphoRus, (P=ParadigmsRus), Prelude, NounRus in {
|
open ResRus, MorphoRus, (P=ParadigmsRus), Prelude, NounRus in {
|
||||||
flags optimize=all ; coding=utf8 ;
|
flags optimize=all ; coding=utf8 ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
obj_no_Prep = {s="" ; c=Acc ; hasPrep=False} ;
|
obj_no_Prep = {s="" ; c=Acc ; hasPrep=False} ;
|
||||||
to2_Prep = P.mkPrep "в" Acc ;
|
to2_Prep = P.mkPrep v_prep_mod Acc ;
|
||||||
on_to_Prep = P.mkPrep "до" Gen ;
|
on_to_Prep = P.mkPrep "до" Gen ;
|
||||||
along_Prep = P.mkPrep "по" Loc ;
|
along_Prep = P.mkPrep "по" Loc ;
|
||||||
from2_Prep = from2 ;
|
from2_Prep = from2 ;
|
||||||
about_Prep = P.mkPrep "о" Pre ;
|
about_Prep = P.mkPrep o_prep_pre_mod Pre ;
|
||||||
|
|
||||||
have_V3 = P.mkV3 est_ell_V nom_Prep u_Prep;
|
have_V3 = P.mkV3 est_ell_V nom_Prep u_Prep;
|
||||||
have2_V3 = P.mkV3 est_V nom_Prep u_Prep;
|
have2_V3 = P.mkV3 est_V nom_Prep u_Prep;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : NP -> Cl ; -- there is a house
|
-- : NP -> Cl ; -- there is a house
|
||||||
ExistNP np = {subj=np.s ! Nom ; compl="" ; verb=to_exist ; dep=[] ; adv=[] ; a=np.a} ; -- TODO: Different order?
|
ExistNP np = {subj=np.s ! Nom ; compl="" ; verb=to_exist ; dep=[] ; adv=[] ; a=np.a} ;
|
||||||
|
|
||||||
-- : IP -> QCl ; -- which houses are there
|
-- : IP -> QCl ; -- which houses are there
|
||||||
ExistIP ip = {
|
ExistIP ip = {
|
||||||
@@ -41,25 +41,36 @@ lin
|
|||||||
compl=[];
|
compl=[];
|
||||||
a=ip.a
|
a=ip.a
|
||||||
} ;
|
} ;
|
||||||
-- TODO: ExistNPAdv : NP -> Adv -> Cl ; -- there is a house in Paris
|
-- : NP -> Adv -> Cl ; -- there is a house in Paris
|
||||||
-- TODO: ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
|
ExistNPAdv np adv = {
|
||||||
|
subj=np.s ! Nom ;
|
||||||
|
compl="" ;
|
||||||
|
verb=to_exist ;
|
||||||
|
dep=[] ;
|
||||||
|
adv=adv.s ;
|
||||||
|
a=np.a
|
||||||
|
} ;
|
||||||
|
-- : IP -> Adv -> QCl ; -- which houses are there in Paris
|
||||||
|
ExistIPAdv ip adv = {
|
||||||
|
subj=ip.nom ; -- gen?
|
||||||
|
adv=adv.s ;
|
||||||
|
verb=to_exist;
|
||||||
|
dep=[] ;
|
||||||
|
compl=[];
|
||||||
|
a=ip.a
|
||||||
|
} ;
|
||||||
|
|
||||||
-- : VP -> VP ; -- be sleeping
|
-- : VP -> VP ; -- be sleeping
|
||||||
ProgrVP vp = vp ;
|
ProgrVP vp = vp ;
|
||||||
-- : VP -> Utt ; -- let's go
|
-- : VP -> Utt ; -- let's go
|
||||||
ImpPl1 vp =
|
ImpPl1 vp =
|
||||||
let a = Ag GPl P1 in
|
let a = Ag GPl P1 in {
|
||||||
let pol = PPos in
|
s = (verbEnvAgr "давайте" (vp.adv ! a) vp.verb Infinitive Pres a PPos) ++ vp.dep ++ vp.compl ! a
|
||||||
let parts = verbAgr vp.verb Infinitive Pres a pol.p in -- colloquial, should be Fut, but then present fails...
|
|
||||||
let p1 = "давайте" in {
|
|
||||||
s = p1 ++ pol.s ++ vp.adv ! a ++ parts.p2 ++ vp.dep ++ vp.compl ! a
|
|
||||||
} ;
|
} ;
|
||||||
-- : NP -> VP -> Utt ; -- let John walk
|
-- : NP -> VP -> Utt ; -- let John walk
|
||||||
ImpP3 np vp =
|
ImpP3 np vp = {
|
||||||
let pol = PPos in
|
s = (verbEnvAgr "пусть" (vp.adv ! np.a ++ np.s ! Nom) vp.verb Ind Pres np.a PPos) ++ vp.dep ++ vp.compl ! np.a
|
||||||
let parts = verbAgr vp.verb Ind Pres np.a pol.p in
|
} ;
|
||||||
let p1 = "пусть" in {
|
|
||||||
s = p1 ++ pol.s ++ vp.adv ! np.a ++ np.s ! Nom ++ parts.p2 ++ vp.dep ++ vp.compl ! np.a
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- : VP -> VP ; -- is at home himself
|
-- : VP -> VP ; -- is at home himself
|
||||||
SelfAdvVP vp = vp ** {compl=\\a => vp.compl ! a ++ (adjFormsAdjective sam).s ! agrGenNum a ! Animate ! Nom} ;
|
SelfAdvVP vp = vp ** {compl=\\a => vp.compl ! a ++ (adjFormsAdjective sam).s ! agrGenNum a ! Animate ! Nom} ;
|
||||||
|
|||||||
@@ -12,5 +12,41 @@ oper
|
|||||||
who_pl = doKPron "к" (Ag GPl P3) Animate ;
|
who_pl = doKPron "к" (Ag GPl P3) Animate ;
|
||||||
somebody = pronFormsPronoun ((appendToIP who_sg (BIND ++ "-то")) ** {nPrefix=False}) ;
|
somebody = pronFormsPronoun ((appendToIP who_sg (BIND ++ "-то")) ** {nPrefix=False}) ;
|
||||||
nobody = pronFormsPronoun ((doKPron "ник" (Ag (GSg Masc) P3) Animate) ** {nPrefix=False}) ;
|
nobody = pronFormsPronoun ((doKPron "ник" (Ag (GSg Masc) P3) Animate) ** {nPrefix=False}) ;
|
||||||
such = adjFormsAdjective (makeAdjectiveForms "такой" "" "3b" PrefFull) ;
|
such = adjFormsAdjective (makeAdjectiveForms "такой" "" "3b" PreferFull) ;
|
||||||
|
|
||||||
|
-- Situations, when prepositions are modified (approximate, full rules may be much more complex)
|
||||||
|
sconsonant : pattern Str = #(("с"|"з"|"ж"|"ш"|"С"|"З"|"Ж"|"Ш") +
|
||||||
|
("б"|"в"|"г"|"д"|"ж"|"з"|"й"|"к"|"л"|"м"|"н"|"п"|"р"|"с"|"т"|"ф"|"х"|"ц"|"ч"|"ш"|"щ" |
|
||||||
|
"Б"|"В"|"Г"|"Д"|"Ж"|"З"|"Й"|"К"|"Л"|"М"|"Н"|"П"|"Р"|"С"|"Т"|"Ф"|"Х"|"Ц"|"Ч"|"Ш"|"Щ")) ;
|
||||||
|
vconsonant : pattern Str = #(("в"|"ф"|"В"|"Ф") +
|
||||||
|
("б"|"в"|"г"|"д"|"ж"|"з"|"й"|"к"|"л"|"м"|"н"|"п"|"р"|"с"|"т"|"ф"|"х"|"ц"|"ч"|"ш"|"щ" |
|
||||||
|
"Б"|"В"|"Г"|"Д"|"Ж"|"З"|"Й"|"К"|"Л"|"М"|"Н"|"П"|"Р"|"С"|"Т"|"Ф"|"Х"|"Ц"|"Ч"|"Ш"|"Щ")) ;
|
||||||
|
s_prep_mod : Str = pre {
|
||||||
|
#sconsonant => "со" ;
|
||||||
|
("льв"|"льд"|"льн"|"лба"|"мха"|"рва"|"рта"|"лбом"|"мхом"|"рвом"|"ртом"|"мной"|"мною") => "со" ;
|
||||||
|
("вш"|"всем"|"всех"|"всей"|"всею"|"всег"|"всяк"|"всяческ"|"вторник"|"втор"|"многи"|"многом"|"многог") => "со" ;
|
||||||
|
("щ"|"Щ") => "со" ;
|
||||||
|
_ => "с"
|
||||||
|
} ;
|
||||||
|
v_prep_mod : Str = pre {#vconsonant => "во" ; ("мног"|"множ"|"все"|"весь"|"имя"|"мне") => "во" ; _ => "в"} ;
|
||||||
|
k_prep_dat_mod : Str = pre {
|
||||||
|
("льву"|"льду"|"льну"|"лбу"|"мху"|"рву"|"ржи"|"рту"|"всякому"|"всему"|"всяческому"|"вторнику"|"второму"|"многому") => "ко" ;
|
||||||
|
_ => "к"
|
||||||
|
} ;
|
||||||
|
ot_prep_gen_mod : Str = pre {
|
||||||
|
("льва"|"льда"|"льна"|"лба"|"мха"|"рва"|"ржи"|"рта") => "ото" ;
|
||||||
|
_ => "от"
|
||||||
|
} ;
|
||||||
|
pod_prep_mod : Str = pre {
|
||||||
|
("львом"|"льдом"|"льном"|"лбом"|"мхом"|"рвом"|"ртом") => "подо" ;
|
||||||
|
_ => "под"
|
||||||
|
} ;
|
||||||
|
above_prep_ins_mod : Str = pre {
|
||||||
|
("львом"|"льдом"|"льном"|"лбом"|"мхом"|"рвом"|"ртом") => "надо" ;
|
||||||
|
_ => "над"
|
||||||
|
} ;
|
||||||
|
o_prep_pre_mod : Str = pre { -- rules are approximate
|
||||||
|
("всем"|"всём"|"мне"|"всех"|"всей") => "обо" ;
|
||||||
|
("а"|"и"|"о"|"у"|"э"|"А"|"И"|"О"|"У"|"Э") => "об" ;
|
||||||
|
_ => "о"} ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ lin
|
|||||||
-- : Predet -> NP -> NP ; -- only the man
|
-- : Predet -> NP -> NP ; -- only the man
|
||||||
PredetNP predet np = np ** {s=\\cas => predet.s ! (agrGenNum np.a) ! Inanimate ! cas ++ np.s ! numSizeCase cas predet.size} ;
|
PredetNP predet np = np ** {s=\\cas => predet.s ! (agrGenNum np.a) ! Inanimate ! cas ++ np.s ! numSizeCase cas predet.size} ;
|
||||||
|
|
||||||
-- : NP -> V2 -> NP ; -- the man seen
|
-- : NP -> V2 -> NP ; -- the man seen
|
||||||
PPartNP np v2 = np ** {
|
PPartNP np v2 = np ** {
|
||||||
s = \\cas => np.s ! cas ++ (shortPastPassPart v2 (agrGenNum np.a))
|
s = \\cas => np.s ! cas ++ (shortPastPassPart v2 (agrGenNum np.a))
|
||||||
} ;
|
} ;
|
||||||
@@ -112,10 +112,15 @@ lin
|
|||||||
NumPl = {s = \\_,_,_ => [] ; size = NumAll } ;
|
NumPl = {s = \\_,_,_ => [] ; size = NumAll } ;
|
||||||
|
|
||||||
-- Digits -> Ord ; -- 51st
|
-- Digits -> Ord ; -- 51st
|
||||||
OrdDigits d = immutableAdjForms d.s ; -- TODO: better implementation
|
OrdDigits d = ith_forms d.s ;
|
||||||
|
|
||||||
-- TODO: : Numeral -> Ord ; -- fifty-first
|
-- : Numeral -> Ord ; -- fifty-first
|
||||||
OrdNumeral numeral = variants {} ;
|
OrdNumeral numeral = numeral.o ** {
|
||||||
|
sm,sf,sn,sp=[] ;
|
||||||
|
comp=[] ;
|
||||||
|
p=False ;
|
||||||
|
preferShort=PreferFull
|
||||||
|
} ;
|
||||||
|
|
||||||
-- : A -> Ord ;
|
-- : A -> Ord ;
|
||||||
OrdSuperl a = long_superlative a ;
|
OrdSuperl a = long_superlative a ;
|
||||||
@@ -127,7 +132,7 @@ lin
|
|||||||
short=\\a=>[] ;
|
short=\\a=>[] ;
|
||||||
g=Neut ;
|
g=Neut ;
|
||||||
c=Nom ;
|
c=Nom ;
|
||||||
preferShort=PrefFull
|
preferShort=PreferFull
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : AdN -> Card -> Card
|
-- : AdN -> Card -> Card
|
||||||
@@ -188,7 +193,7 @@ lin
|
|||||||
|
|
||||||
-- : Det -> NP -> NP ; -- three of them, some of the boys
|
-- : Det -> NP -> NP ; -- three of them, some of the boys
|
||||||
CountNP det np = {
|
CountNP det np = {
|
||||||
s=\\cas => det.s ! Neut ! Inanimate ! cas ++ selectCase np.s from2 ;
|
s=\\cas => det.s ! Neut ! Inanimate ! cas ++ applyPrep from2 np ;
|
||||||
pron=False ;
|
pron=False ;
|
||||||
a=numSizeGenAgr det.size Neut P3
|
a=numSizeGenAgr det.size Neut P3
|
||||||
} ;
|
} ;
|
||||||
@@ -214,7 +219,7 @@ lin
|
|||||||
c=Nom ;
|
c=Nom ;
|
||||||
g=Neut ;
|
g=Neut ;
|
||||||
size=Num1 ;
|
size=Num1 ;
|
||||||
preferShort=PrefFull
|
preferShort=PreferFull
|
||||||
} ;
|
} ;
|
||||||
-- : Quant ; -- a (house), (houses)
|
-- : Quant ; -- a (house), (houses)
|
||||||
IndefArt = {
|
IndefArt = {
|
||||||
@@ -224,7 +229,7 @@ lin
|
|||||||
c=Nom ;
|
c=Nom ;
|
||||||
g=Neut ;
|
g=Neut ;
|
||||||
size=Num1 ;
|
size=Num1 ;
|
||||||
preferShort=PrefFull
|
preferShort=PreferFull
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,272 +1,447 @@
|
|||||||
--# -path=.:../abstract:../common:../../prelude
|
--# -path=.:../abstract:../common:../../prelude
|
||||||
|
|
||||||
concrete NumeralRus of Numeral = CatRus [Numeral,Digits] ** open ResRus, Prelude in {
|
concrete NumeralRus of Numeral = CatRus [Numeral,Digits] ** open ResRus, ZaliznyakAlgo, Prelude in {
|
||||||
|
|
||||||
flags coding=utf8 ;
|
flags coding=utf8 ;
|
||||||
|
|
||||||
-- Toiska, 13/8/2000, AR with Arto Mustajoki.
|
-- Toiska, 13/8/2000, AR with Arto Mustajoki.
|
||||||
-- Nikita Frolov, 2011
|
-- Nikita Frolov, 2011
|
||||||
|
|
||||||
lincat Digit = {s : DForm => Gender => Animacy => Case => Str ; size : NumSize} ;
|
lincat Digit = {s : DForm => DetTable ; size : NumSize ; o : DForm => PronForms} ;
|
||||||
lincat Sub10 = {s : Place => DForm => Gender => Animacy => Case => Str ; size : NumSize} ;
|
lincat Sub10 = {s : Place => DForm => DetTable ; size : NumSize ; o : Place => DForm => PronForms ; just1 : Bool} ;
|
||||||
lincat Sub100 = {s : Place => Gender => Animacy => Case => Str ; size : NumSize} ;
|
lincat Sub100 = {s : Place => DetTable ; size : NumSize ; o : Place => PronForms; just1 : Bool} ;
|
||||||
lincat Sub1000 = {s : Place => Gender => Animacy => Case => Str ; size : NumSize} ;
|
lincat Sub1000 = {s : Place => DetTable ; size : NumSize ; o : Place => PronForms; just1 : Bool} ;
|
||||||
lincat Sub1000000 = {s : Gender => Animacy => Case => Str ; size : NumSize} ;
|
lincat Sub1000000 = {s : DetTable ; size : NumSize ; o : PronForms; just1 : Bool} ;
|
||||||
|
-- just1 to correctly generate exactly 1000
|
||||||
|
|
||||||
lin num x = {s = \\ g,a,c => x.s ! g ! a ! c; n = Pl ; size = x.size};
|
-- : Sub1000000 -> Numeral ; -- 123456 [coercion to top category]
|
||||||
|
lin num x = {
|
||||||
|
s = \\ g,a,c => x.s ! g ! a ! c ;
|
||||||
|
o = x.o ;
|
||||||
|
size = x.size
|
||||||
|
};
|
||||||
|
|
||||||
lin n3 =
|
-- : Digit
|
||||||
{s = table {unit => tri ;
|
lin n3 = {
|
||||||
teen => nadsat "три" ;
|
s = table {
|
||||||
ten => n2030 "три" ;
|
unit => tri ;
|
||||||
hund => sta tri} ;
|
teen => nadsat "три" ;
|
||||||
size = Num2_4} ;
|
ten => n2030 "три" ;
|
||||||
lin n4 =
|
hund => sta tri
|
||||||
{s = table {unit => chetyre ;
|
} ;
|
||||||
teen => nadsat "четыр" ;
|
o = table {
|
||||||
ten => \\ g, a, c =>
|
unit => pronoun6AstA "третий" ;
|
||||||
case <c, g> of {
|
teen => pronounAdj1A "тринадцатый" ;
|
||||||
<(Nom|VocRus|Acc), _ > => "сорок";
|
ten => pronounAdj1A "тридцатый" ;
|
||||||
<(Gen|Ptv|Dat|Ins|Pre|Loc), _ > => "сорока" } ;
|
hund => pronounAdj1A "трёхсотый"
|
||||||
hund => sta chetyre } ;
|
} ;
|
||||||
size = Num2_4} ;
|
size = Num2_4
|
||||||
lin n5 =
|
} ;
|
||||||
{s = table {unit => n59 "пят" ;
|
lin n4 = {
|
||||||
teen => nadsat "пят" ;
|
s = table {
|
||||||
ten => n5070 "пят" ;
|
unit => chetyre ;
|
||||||
hund => sot (n59 "пят")} ;
|
teen => nadsat "четыр" ;
|
||||||
size = Num5} ;
|
ten => \\g,a,c => case <c, g> of {
|
||||||
lin n6 =
|
<(Nom|VocRus|Acc), _> => "сорок";
|
||||||
{s = table {unit => n59 "шест" ;
|
<(Gen|Ptv|Dat|Ins|Pre|Loc), _> => "сорока"
|
||||||
teen => nadsat "шест" ;
|
} ;
|
||||||
ten => n5070 "шест" ;
|
hund => sta chetyre
|
||||||
hund => sot (n59 "шест")} ;
|
} ;
|
||||||
size = Num5} ;
|
o = table {
|
||||||
lin n7 =
|
unit => pronounAdj1A "четвёртый" ;
|
||||||
{s = table {unit => n59 "сем" ;
|
teen => pronounAdj1A "четырнадцатый" ;
|
||||||
teen => nadsat "сем" ;
|
ten => pronounAdj1B "сороковой" ;
|
||||||
ten => n5070 "сем" ;
|
hund => pronounAdj1A "четырёхсотый"
|
||||||
hund => sot (n59 "сем") } ;
|
} ;
|
||||||
size = Num5} ;
|
size = Num2_4
|
||||||
lin n8 =
|
} ;
|
||||||
{s = table {unit => vosem ;
|
lin n5 = {
|
||||||
teen => nadsat "восем" ;
|
s = table {
|
||||||
ten => \\ g, a, c =>
|
unit => n59 "пят" ;
|
||||||
|
teen => nadsat "пят" ;
|
||||||
|
ten => n5070 "пят" ;
|
||||||
|
hund => sot (n59 "пят")
|
||||||
|
} ;
|
||||||
|
o = table {
|
||||||
|
unit => pronounAdj1A "пятый" ;
|
||||||
|
teen => pronounAdj1A "пятнадцатый" ;
|
||||||
|
ten => pronounAdj1A "пятидесятый" ;
|
||||||
|
hund => pronounAdj1A "пятисотый"
|
||||||
|
} ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
lin n6 = {
|
||||||
|
s = table {
|
||||||
|
unit => n59 "шест" ;
|
||||||
|
teen => nadsat "шест" ;
|
||||||
|
ten => n5070 "шест" ;
|
||||||
|
hund => sot (n59 "шест")
|
||||||
|
} ;
|
||||||
|
o = table {
|
||||||
|
unit => pronounAdj1B "шестой" ;
|
||||||
|
teen => pronounAdj1A "шестнадцатый" ;
|
||||||
|
ten => pronounAdj1A "шестидесятый" ;
|
||||||
|
hund => pronounAdj1A "шестисотый"
|
||||||
|
} ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
lin n7 = {
|
||||||
|
s = table {
|
||||||
|
unit => n59 "сем" ;
|
||||||
|
teen => nadsat "сем" ;
|
||||||
|
ten => n5070 "сем" ;
|
||||||
|
hund => sot (n59 "сем")
|
||||||
|
} ;
|
||||||
|
o = table {
|
||||||
|
unit => pronounAdj1B "седьмой" ;
|
||||||
|
teen => pronounAdj1A "семнадцатый" ;
|
||||||
|
ten => pronounAdj1A "семидесятый" ;
|
||||||
|
hund => pronounAdj1A "семисотый"
|
||||||
|
} ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
lin n8 = {
|
||||||
|
s = table {
|
||||||
|
unit => vosem ;
|
||||||
|
teen => nadsat "восем" ;
|
||||||
|
ten => \\g,a,c => case <c, g> of {
|
||||||
|
<(Nom|VocRus|Acc), _> => "восемьдесят";
|
||||||
|
<(Gen|Ptv|Dat|Pre|Loc), _> => "восьмидесяти" ;
|
||||||
|
<Ins, _> => "восемьюдесятью"
|
||||||
|
};
|
||||||
|
hund => sot vosem
|
||||||
|
} ;
|
||||||
|
o = table {
|
||||||
|
unit => pronounAdj1B "восьмой" ;
|
||||||
|
teen => pronounAdj1A "восемнадцатый" ;
|
||||||
|
ten => pronounAdj1A "восьмидесятый" ;
|
||||||
|
hund => pronounAdj1A "восьмисотый"
|
||||||
|
} ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
lin n9 = {
|
||||||
|
s = table {
|
||||||
|
unit => n59 "девят" ;
|
||||||
|
teen => nadsat "девят" ;
|
||||||
|
ten => \\g,a,c =>
|
||||||
|
case <c, g> of {
|
||||||
|
<(Nom|VocRus|Acc), _> => "девяносто" ;
|
||||||
|
<(Gen|Ptv|Dat|Ins|Pre|Loc), _> => "девяноста"
|
||||||
|
};
|
||||||
|
hund => sot (n59 "девят")
|
||||||
|
} ;
|
||||||
|
o = table {
|
||||||
|
unit => pronounAdj1A "девятый" ;
|
||||||
|
teen => pronounAdj1A "девятнадцатый" ;
|
||||||
|
ten => pronounAdj1A "девяностый" ;
|
||||||
|
hund => pronounAdj1A "девятисотый"
|
||||||
|
} ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper n59 : Str -> DetTable =
|
||||||
|
\n -> \\g, a, c =>
|
||||||
case <c, g> of {
|
case <c, g> of {
|
||||||
<(Nom|VocRus|Acc), _ > => "восемьдесят";
|
<(Nom|VocRus|Acc), _> => n + "ь" ;
|
||||||
<(Gen|Ptv|Dat|Pre|Loc), _ > => "восьмидесяти" ;
|
<(Gen|Ptv|Dat|Pre|Loc), _> => n + "и" ;
|
||||||
<Ins, _ > => "восемьюдесятью"
|
<Ins, _> => n + "ью"
|
||||||
};
|
} ;
|
||||||
hund => sot vosem
|
|
||||||
} ;
|
oper n2030 : Str -> DetTable =
|
||||||
size = Num5} ;
|
\n -> \\g, a, c =>
|
||||||
lin n9 =
|
|
||||||
{s = table {unit => n59 "девят" ;
|
|
||||||
teen => nadsat "девят" ;
|
|
||||||
ten => \\ g, a, c =>
|
|
||||||
case <c, g> of {
|
case <c, g> of {
|
||||||
<(Nom|VocRus|Acc), _ > => "девяносто";
|
<(Nom|VocRus|Acc), _> => n + "дцать" ;
|
||||||
<(Gen|Ptv|Dat|Ins|Pre|Loc), _ > => "девяноста"
|
<(Gen|Ptv|Dat|Pre|Loc), _> => n + "дцати" ;
|
||||||
};
|
<Ins, _> => n + "дцатью"
|
||||||
hund => sot (n59 "девят") } ;
|
} ;
|
||||||
size = Num5} ;
|
|
||||||
|
|
||||||
oper n59 : Str -> (Gender => Animacy => Case => Str) = \ n -> \\ g, a, c =>
|
oper n5070 : Str -> DetTable =
|
||||||
|
\n -> \\g, a, c =>
|
||||||
case <c, g> of {
|
case <c, g> of {
|
||||||
<(Nom|VocRus|Acc), _ > => n + "ь";
|
<(Nom|VocRus|Acc), _> => n + "ьдесят" ;
|
||||||
<(Gen|Ptv|Dat|Pre|Loc), _ > => n + "и";
|
<(Gen|Ptv|Dat|Pre|Loc), _> => n + "идесяти" ;
|
||||||
<Ins, _ > => n + "ью"
|
<Ins, _> => n + "ьюдесятью"
|
||||||
};
|
} ;
|
||||||
|
|
||||||
oper n2030 : Str -> (Gender => Animacy => Case => Str) = \ n -> \\ g, a, c =>
|
oper tri : DetTable =
|
||||||
case <c, g> of {
|
\\ g, a, c =>
|
||||||
<(Nom|VocRus|Acc), _ > => n + "дцать";
|
case <c, g> of {
|
||||||
<(Gen|Ptv|Dat|Pre|Loc), _ > => n + "дцати" ;
|
<(Nom|VocRus|Acc), _> => "три";
|
||||||
<Ins, _ > => n + "дцатью"
|
<(Gen|Ptv|Pre|Loc), _> => "трёх";
|
||||||
};
|
<Dat, _> => "трём";
|
||||||
|
<Ins, _> => "тремя"
|
||||||
|
} ;
|
||||||
|
|
||||||
oper n5070 : Str -> (Gender => Animacy => Case => Str) = \ n -> \\ g, a, c =>
|
oper chetyre : DetTable =
|
||||||
case <c, g> of {
|
\\ g, a, c =>
|
||||||
<(Nom|VocRus|Acc), _ > => n + "ьдесят";
|
case <c, g> of {
|
||||||
<(Gen|Ptv|Dat|Pre|Loc), _ > => n + "идесяти" ;
|
<(Nom|VocRus|Acc), _> => "четыре" ;
|
||||||
<Ins, _ > => n + "ьюдесятью"
|
<(Gen|Ptv|Pre|Loc), _> => "четырех" ;
|
||||||
};
|
<Dat, _> => "четырем" ;
|
||||||
|
<Ins, _> => "четырьмя"
|
||||||
|
} ;
|
||||||
|
|
||||||
oper tri : Gender => Animacy => Case => Str = \\ g, a, c =>
|
oper vosem : DetTable =
|
||||||
case <c, g> of {
|
\\ g, a, c =>
|
||||||
<(Nom|VocRus|Acc), _ > => "три";
|
case <c, g> of {
|
||||||
<(Gen|Ptv|Pre|Loc), _ > => "трех";
|
<(Nom|VocRus|Acc), _> => "восемь" ;
|
||||||
<Dat, _ > => "трем";
|
<(Gen|Ptv|Dat|Pre|Loc), _> => "восьми ";
|
||||||
<Ins, _ > => "тремя"
|
<Ins, _> => "восемью"
|
||||||
};
|
} ;
|
||||||
|
|
||||||
oper chetyre : Gender => Animacy => Case => Str = \\ g, a, c =>
|
|
||||||
case <c, g> of {
|
|
||||||
<(Nom|VocRus|Acc), _ > => "четыре";
|
|
||||||
<(Gen|Ptv|Pre|Loc), _ > => "четырех";
|
|
||||||
<Dat, _ > => "четырем";
|
|
||||||
<Ins, _ > => "четырьмя"
|
|
||||||
};
|
|
||||||
|
|
||||||
oper vosem : Gender => Animacy => Case => Str = \\ g, a, c =>
|
|
||||||
case <c, g> of {
|
|
||||||
<(Nom|VocRus|Acc), _ > => "восемь";
|
|
||||||
<(Gen|Ptv|Dat|Pre|Loc), _ > => "восьми";
|
|
||||||
<Ins, _ > => "восемью"
|
|
||||||
};
|
|
||||||
|
|
||||||
-- a little tribute to Burgess
|
-- a little tribute to Burgess
|
||||||
oper nadsat : Str -> (Gender => Animacy => Case => Str) = \ n -> \\ g, a, c =>
|
oper nadsat : Str -> DetTable
|
||||||
|
= \n -> \\g, a, c =>
|
||||||
case <c, g> of {
|
case <c, g> of {
|
||||||
<(Nom|VocRus|Acc), _ > => n + "надцать";
|
<(Nom|VocRus|Acc), _> => n + "надцать" ;
|
||||||
<(Gen|Ptv|Dat|Pre|Loc), _ > => n + "надцати";
|
<(Gen|Ptv|Dat|Pre|Loc), _> => n + "надцати" ;
|
||||||
<Ins, _ > => n + "надцатью"
|
<Ins, _> => n + "надцатью"
|
||||||
};
|
} ;
|
||||||
|
|
||||||
oper sta : (Gender => Animacy => Case => Str) -> (Gender => Animacy => Case => Str) = \ n -> \\ g, a, c =>
|
oper sta : DetTable -> DetTable
|
||||||
|
= \n -> \\ g, a, c =>
|
||||||
case <c, g> of {
|
case <c, g> of {
|
||||||
<(Nom|VocRus|Acc), _ > => n ! Fem ! Animate ! c + "ста";
|
<(Nom|VocRus|Acc), _> => n ! Fem ! Animate ! c + "ста" ;
|
||||||
<Gen|Ptv, _ > => n ! Fem ! Animate ! c + "сот";
|
<Gen|Ptv, _> => n ! Fem ! Animate ! c + "сот" ;
|
||||||
<Dat, _ > => n ! Fem ! Animate ! c + "стам";
|
<Dat, _> => n ! Fem ! Animate ! c + "стам" ;
|
||||||
<Ins, _ > => n ! Fem ! Animate ! c + "стами";
|
<Ins, _> => n ! Fem ! Animate ! c + "стами" ;
|
||||||
<Pre|Loc, _ > => n ! Fem ! Animate ! c + "стах"
|
<Pre|Loc, _> => n ! Fem ! Animate ! c + "стах"
|
||||||
};
|
} ;
|
||||||
|
|
||||||
oper sot : (Gender => Animacy => Case => Str) -> (Gender => Animacy => Case => Str) = \ n -> \\ g, a, c =>
|
oper sot : DetTable -> DetTable
|
||||||
|
= \n -> \\ g, a, c =>
|
||||||
case <c, g> of {
|
case <c, g> of {
|
||||||
<(Nom|VocRus|Acc), _ > => n ! Fem ! Animate ! c + "сот";
|
<(Nom|VocRus|Acc), _> => n ! Fem ! Animate ! c + "сот" ;
|
||||||
<Gen|Ptv, _ > => n ! Fem ! Animate ! c + "сот";
|
<Gen|Ptv, _> => n ! Fem ! Animate ! c + "сот" ;
|
||||||
<Dat, _ > => n ! Fem ! Animate ! c + "стам";
|
<Dat, _> => n ! Fem ! Animate ! c + "стам" ;
|
||||||
<Ins, _ > => n ! Fem ! Animate ! c + "стами";
|
<Ins, _> => n ! Fem ! Animate ! c + "стами" ;
|
||||||
<Pre|Loc, _ > => n ! Fem ! Animate ! c + "ста"
|
<Pre|Loc, _> => n ! Fem ! Animate ! c + "ста"
|
||||||
};
|
} ;
|
||||||
|
|
||||||
lin pot01 =
|
lin n2 = {
|
||||||
{s = table {attr => table {hund => \\ g, a, c =>
|
s = table {
|
||||||
case <g, a, c> of {
|
unit => \\ g, a, c => case <c, g, a> of {
|
||||||
<_, _, (Nom|VocRus|Acc) > => "сто";
|
<(Nom|VocRus|Acc), Fem, _> => "две" ;
|
||||||
<_, _, (Gen|Ptv|Dat|Pre|Loc) > => "ста";
|
<(Nom|VocRus|Acc), (Masc|Neut), Inanimate> => "два" ;
|
||||||
<_, _, Ins > => "сотней"
|
<Nom|VocRus, (Masc|Neut), Animate> => "два" ;
|
||||||
};
|
<Acc , _, Animate> => "двух" ;
|
||||||
_ => \\ g, a, c => []} ;
|
<(Gen|Ptv|Pre|Loc), _, _> => "двух" ;
|
||||||
_ => table {hund => \\ g, a, c =>
|
<Dat, _, _> => "двум" ;
|
||||||
case <g, a, c> of {
|
<Ins, _, _> => "двумя"
|
||||||
<_, _, (Nom|VocRus|Acc) > => "сто";
|
};
|
||||||
<_, _, (Gen|Ptv|Dat|Pre|Loc) > => "ста";
|
teen => nadsat "две" ;
|
||||||
-- TODO: case agreement with nouns
|
ten => n2030 "два" ;
|
||||||
<_, _, Ins > => "сотней"
|
hund => \\ g, a, c => case <c, g> of {
|
||||||
};
|
<(Nom|VocRus|Acc), _> => "двести" ;
|
||||||
_ => \\ g, a, c =>
|
<Gen|Ptv, _> => "двухсот" ;
|
||||||
case <g, a, c> of {
|
<Dat, _> => "двумстам" ;
|
||||||
<Masc, Animate, Acc> => "одного";
|
<Ins, _> => "двумястами" ;
|
||||||
<Masc, Inanimate, Acc> => "один";
|
<Pre|Loc, _> => "двухстах"
|
||||||
<Masc, _, Nom|VocRus > => "один";
|
}
|
||||||
<Masc, _, Gen|Ptv > => "одного";
|
} ;
|
||||||
<Masc, _, Dat > => "одному";
|
o = table {
|
||||||
<Masc, _, Ins > => "одним";
|
unit => pronounAdj1B "второй" ;
|
||||||
<Masc, _, Pre|Loc > => "одном";
|
teen => pronounAdj1A "двенадцатый" ;
|
||||||
<Fem, _, Nom|VocRus > => "одна";
|
ten => pronounAdj1A "двадцатый" ;
|
||||||
<Fem, _, (Gen|Ptv|Dat|Ins|Pre|Loc) > => "одной";
|
hund => pronounAdj1A "двухсотый"
|
||||||
<Fem, _, Acc> => "одну";
|
} ;
|
||||||
<Neut, _, (Nom|VocRus|Acc) > => "одно";
|
size = Num2_4
|
||||||
<Neut, _, Gen|Ptv > => "одного";
|
} ;
|
||||||
<Neut, _, Dat > => "одному";
|
|
||||||
<Neut, _, Ins > => "одним";
|
|
||||||
<Neut, _, Pre|Loc > => "одном"}}} ;
|
|
||||||
size = Num1} ;
|
|
||||||
|
|
||||||
lin n2 =
|
-- : Sub10 ; -- 1
|
||||||
{s = table {unit => \\ g, a, c =>
|
lin pot01 = {
|
||||||
case <c, g, a> of {
|
s = table {
|
||||||
<(Nom|VocRus|Acc), Fem, _ > => "две";
|
attr => table {
|
||||||
<(Nom|VocRus|Acc), (Masc|Neut), Inanimate > => "два";
|
hund => \\ g, a, c => case <g, a, c> of {
|
||||||
<Nom|VocRus, (Masc|Neut), Animate > => "два";
|
<_, _, (Nom|VocRus|Acc)> => "сто";
|
||||||
<Acc , _, Animate > => "двух";
|
<_, _, (Gen|Ptv|Dat|Pre|Loc)> => "ста";
|
||||||
<(Gen|Ptv|Pre|Loc), _, _ > => "двух";
|
<_, _, Ins> => "сотней"
|
||||||
<Dat, _, _ > => "двум";
|
} ;
|
||||||
<Ins, _, _ > => "двумя"
|
_ => \\ g, a, c => []
|
||||||
};
|
} ;
|
||||||
teen => nadsat "две" ;
|
indep => table {
|
||||||
ten => n2030 "два" ;
|
hund => \\ g, a, c => case <g, a, c> of {
|
||||||
hund => \\ g, a, c =>
|
<_, _, (Nom|VocRus|Acc)> => "сто";
|
||||||
case <c, g> of {
|
<_, _, (Gen|Ptv|Dat|Pre|Loc)> => "ста";
|
||||||
<(Nom|VocRus|Acc), _ > => "двести";
|
<_, _, Ins> => "сотней"
|
||||||
<Gen|Ptv, _ > => "двухсот";
|
};
|
||||||
<Dat, _ > => "двумстам";
|
_ => \\ g, a, c => case <g, a, c> of {
|
||||||
<Ins, _ > => "двумястами";
|
<Masc, Animate, Acc> => "одного";
|
||||||
<Pre|Loc, _ > => "двухстах"} } ;
|
<Masc, Inanimate, Acc> => "один";
|
||||||
size = Num2_4} ;
|
<Masc, _, Nom|VocRus> => "один";
|
||||||
|
<Masc, _, Gen|Ptv> => "одного";
|
||||||
|
<Masc, _, Dat> => "одному";
|
||||||
|
<Masc, _, Ins> => "одним";
|
||||||
|
<Masc, _, Pre|Loc> => "одном";
|
||||||
|
<Fem, _, Nom|VocRus> => "одна";
|
||||||
|
<Fem, _, (Gen|Ptv|Dat|Ins|Pre|Loc)> => "одной";
|
||||||
|
<Fem, _, Acc> => "одну";
|
||||||
|
<Neut, _, (Nom|VocRus|Acc)> => "одно";
|
||||||
|
<Neut, _, Gen|Ptv> => "одного";
|
||||||
|
<Neut, _, Dat> => "одному";
|
||||||
|
<Neut, _, Ins> => "одним";
|
||||||
|
<Neut, _, Pre|Loc> => "одном"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
o = table {
|
||||||
|
attr => table {
|
||||||
|
hund => immutableAdjectiveCases "сто" ; -- as in "сто второй"?
|
||||||
|
_ => immutableAdjectiveCases ""
|
||||||
|
} ;
|
||||||
|
indep => table {
|
||||||
|
hund => pronounAdj1A "сотый" ;
|
||||||
|
_ => pronounAdj1A "первый"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
just1 = True ;
|
||||||
|
size = Num1
|
||||||
|
} ;
|
||||||
|
|
||||||
lin pot0 d =
|
-- : Digit -> Sub10 ; -- d * 1
|
||||||
{s = table {_ => d.s} ; size = d.size} ;
|
lin pot0 d = {
|
||||||
lin pot110 =
|
s = table {_ => d.s} ;
|
||||||
{s = \\ p => n59 "десят" ; size = Num5} ;
|
o = table {_ => d.o} ;
|
||||||
lin pot111 =
|
just1 = False ;
|
||||||
{s = \\ p => nadsat "один" ; size = Num5} ; --- 11
|
size = d.size
|
||||||
lin pot1to19 d =
|
} ;
|
||||||
{s = table {_ => d.s ! teen} ; size = Num5} ;
|
|
||||||
lin pot0as1 n =
|
|
||||||
{s = table {p => n.s ! p ! unit} ; size = n.size} ;
|
|
||||||
lin pot1 d =
|
|
||||||
{s = table {_ => d.s ! ten} ; size = Num5} ; ---
|
|
||||||
lin pot1plus d e =
|
|
||||||
{s = table {_ => \\ g, a, c => d.s ! ten ! g ! a ! c ++ e.s ! indep ! unit ! g ! a ! c} ; size = e.size} ;
|
|
||||||
lin pot1as2 n =
|
|
||||||
{s = n.s ; size = n.size} ;
|
|
||||||
lin pot2 d =
|
|
||||||
{s = table {p => d.s ! p ! hund} ; size = Num5} ;
|
|
||||||
lin pot2plus d e =
|
|
||||||
{s = \\ p, g, a, c => d.s ! p ! hund ! g ! a ! c ++ e.s ! indep ! g ! a ! c ; size = e.size} ;
|
|
||||||
lin pot2as3 n =
|
|
||||||
{s = n.s ! indep ; size = n.size} ;
|
|
||||||
lin pot3 n =
|
|
||||||
{s = \\ g, a, c => n.s ! attr ! Fem ! a ! c ++ mille.s ! numSizeNum c n.size ! numSizeCase c n.size ; size = Num5} ;
|
|
||||||
lin pot3plus n m =
|
|
||||||
{s = \\ g, a, c => n.s ! attr ! Fem ! a ! c ++ mille.s ! numSizeNum c n.size ! numSizeCase c n.size ++ m.s ! indep ! g ! a ! c ; size = Num5} ;
|
|
||||||
|
|
||||||
--- TODO
|
-- : Sub100 ; -- 10
|
||||||
--- raz/odin
|
lin pot110 = {
|
||||||
|
s = \\p => n59 "десят" ;
|
||||||
|
o = \\p => pronounAdj1A "десятый" ;
|
||||||
|
just1 = False ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Sub100 ; -- 11
|
||||||
|
lin pot111 = {
|
||||||
|
s = \\p => nadsat "один" ;
|
||||||
|
o = \\p => pronounAdj1A "одиннадцатый" ;
|
||||||
|
just1 = False ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Digit -> Sub100 ; -- 10 + d
|
||||||
|
lin pot1to19 d = {
|
||||||
|
s = table {_ => d.s ! teen} ;
|
||||||
|
o = table {_ => d.o ! teen} ;
|
||||||
|
just1 = False ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Sub10 -> Sub100 ; -- coercion of 1..9
|
||||||
|
lin pot0as1 n = {
|
||||||
|
s = table {p => n.s ! p ! unit} ;
|
||||||
|
o = table {p => n.o ! p ! unit} ; --?
|
||||||
|
just1 = n.just1 ;
|
||||||
|
size = n.size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Digit -> Sub100 ; -- d * 10
|
||||||
|
lin pot1 d = {
|
||||||
|
s = table {_ => d.s ! ten} ;
|
||||||
|
o = table {_ => d.o ! ten} ;
|
||||||
|
just1 = False ;
|
||||||
|
size = Num5
|
||||||
|
} ; ---
|
||||||
|
|
||||||
|
-- : Digit -> Sub10 -> Sub100 ; -- d * 10 + n
|
||||||
|
lin pot1plus d e = {
|
||||||
|
s = table {_ => \\g, a, c => d.s ! ten ! g ! a ! c ++ e.s ! indep ! unit ! g ! a ! c} ;
|
||||||
|
o = \\p => prependPF (d.s ! ten ! Masc ! Inanimate ! Nom) (e.o ! p ! unit) ;
|
||||||
|
just1 = False ;
|
||||||
|
size = e.size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Sub100 -> Sub1000 ; -- coercion of 1..99
|
||||||
|
lin pot1as2 n = {s = n.s ; size = n.size ; just1 = n.just1 ; o = n.o} ;
|
||||||
|
|
||||||
|
-- : Sub10 -> Sub1000 ; -- m * 100
|
||||||
|
lin pot2 d = {
|
||||||
|
s = table {p => d.s ! p ! hund} ;
|
||||||
|
o = table {p => d.o ! p ! hund} ;
|
||||||
|
just1 = False ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n
|
||||||
|
lin pot2plus d e = {
|
||||||
|
s = \\p, g, a, c => d.s ! p ! hund ! g ! a ! c ++ e.s ! indep ! g ! a ! c ;
|
||||||
|
o = \\p => prependPF (d.s ! p ! hund ! Masc ! Inanimate ! Nom) (e.o ! p) ;
|
||||||
|
just1 = False ;
|
||||||
|
size = e.size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Sub1000 -> Sub1000000 ; -- coercion of 1..999
|
||||||
|
lin pot2as3 n = {
|
||||||
|
s = n.s ! indep ;
|
||||||
|
o = n.o ! indep ; -- ???
|
||||||
|
just1 = n.just1 ; -- ???
|
||||||
|
size = n.size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Sub1000 -> Sub1000000 ; -- m * 1000
|
||||||
|
lin pot3 n = { -- TODO: fix cases like: 111000, 100000
|
||||||
|
s = \\g, a, c => n.s ! attr ! Fem ! a ! c ++ mille.s ! numSizeNum c n.size ! numSizeCase c n.size ;
|
||||||
|
o = prependPF (case n.just1 of {
|
||||||
|
False => n.s ! attr ! Neut ! Inanimate ! Gen ++ BIND ;
|
||||||
|
True => ""
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(pronounAdj1AstA "тысячный") ; --TODO: not as simple. Gen or Nom?
|
||||||
|
just1 = False ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
||||||
|
lin pot3plus n m = {
|
||||||
|
s = \\g, a, c => n.s ! attr ! Fem ! a ! c
|
||||||
|
++ mille.s ! numSizeNum c n.size ! numSizeCase c n.size
|
||||||
|
++ m.s ! indep ! g ! a ! c ;
|
||||||
|
o = prependPF (n.s ! attr ! Neut ! Inanimate ! Nom ++ mille.s ! numSizeNum Nom n.size ! numSizeCase Nom n.size)
|
||||||
|
(m.o ! indep) ; -- TODO: chk
|
||||||
|
just1 = False ;
|
||||||
|
size = Num5
|
||||||
|
} ;
|
||||||
|
|
||||||
-- numerals as sequences of digits
|
-- numerals as sequences of digits
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Dig = TDigit ;
|
Dig = TDigit ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
IDig d = {s = d.s ; n = d.n ; size = d.size} ;
|
IDig d = {s = d.s ; n = d.n ; size = d.size} ;
|
||||||
|
|
||||||
IIDig d i = {
|
IIDig d i = {
|
||||||
s = d.s ++ BIND ++ i.s ;
|
s = d.s ++ BIND ++ i.s ;
|
||||||
n = Pl ;
|
n = Pl ;
|
||||||
size = i.size
|
size = i.size
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
D_0 = mk2Dig "0" Num5 ;
|
D_0 = mk2Dig "0" Num5 ;
|
||||||
D_1 = mk4Dig "1" "1" Sg Num1 ; ----
|
D_1 = mk4Dig "1" "1" Sg Num1 ; ----
|
||||||
D_2 = mk2Dig "2" Num2_4 ;
|
D_2 = mk2Dig "2" Num2_4 ;
|
||||||
D_3 = mk2Dig "3" Num2_4 ;
|
D_3 = mk2Dig "3" Num2_4 ;
|
||||||
D_4 = mk2Dig "4" Num2_4 ;
|
D_4 = mk2Dig "4" Num2_4 ;
|
||||||
D_5 = mk2Dig "5" Num5 ;
|
D_5 = mk2Dig "5" Num5 ;
|
||||||
D_6 = mk2Dig "6" Num5 ;
|
D_6 = mk2Dig "6" Num5 ;
|
||||||
D_7 = mk2Dig "7" Num5 ;
|
D_7 = mk2Dig "7" Num5 ;
|
||||||
D_8 = mk2Dig "8" Num5 ;
|
D_8 = mk2Dig "8" Num5 ;
|
||||||
D_9 = mk2Dig "9" Num5 ;
|
D_9 = mk2Dig "9" Num5 ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
mk3Dig : Str -> Str -> NumSize -> TDigit = \c,o,size -> mk4Dig c o Pl size ;
|
mk3Dig : Str -> Str -> NumSize -> TDigit = \c,o,size -> mk4Dig c o Pl size ;
|
||||||
mk2Dig : Str -> NumSize -> TDigit = \c,size -> mk3Dig c (c + "o") size ;
|
mk2Dig : Str -> NumSize -> TDigit = \c,size -> mk3Dig c (c + "o") size ;
|
||||||
|
mk4Dig : Str -> Str -> Number -> NumSize -> TDigit = \c,o,n,size -> {
|
||||||
mk4Dig : Str -> Str -> Number -> NumSize -> TDigit = \c,o,n,size -> {
|
s = c ; ---- gender
|
||||||
s = c ; ---- gender
|
n = n ;
|
||||||
n = n ;
|
size = size
|
||||||
size = size
|
|
||||||
} ;
|
|
||||||
|
|
||||||
TDigit = {
|
|
||||||
n : Number ;
|
|
||||||
s : Str ;
|
|
||||||
size : NumSize
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
TDigit = {
|
||||||
|
n : Number ;
|
||||||
|
s : Str ;
|
||||||
|
size : NumSize
|
||||||
|
} ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ oper
|
|||||||
short : ShortFormPreference
|
short : ShortFormPreference
|
||||||
= PrefShort ;
|
= PrefShort ;
|
||||||
full : ShortFormPreference
|
full : ShortFormPreference
|
||||||
= PrefFull ;
|
= PreferFull ;
|
||||||
|
|
||||||
-- Animacy is needed for nouns and some pronouns.
|
-- Animacy is needed for nouns and some pronouns.
|
||||||
animate : Animacy
|
animate : Animacy
|
||||||
@@ -132,14 +132,15 @@ oper
|
|||||||
|
|
||||||
ShortenA : A -> A ;
|
ShortenA : A -> A ;
|
||||||
|
|
||||||
-- Two-place adjectives need a preposition and a case as extra arguments.
|
-- Two-place adjectives need a preposition
|
||||||
|
|
||||||
-- TODO: ? mkA2 : A -> Str -> Case -> A2 ; -- "делим на"
|
mkA2 : overload {
|
||||||
mkA2 : A -> Prep -> A2 ;
|
mkA2 : A -> Prep -> A2 ;
|
||||||
|
} ;
|
||||||
|
|
||||||
mkOrd : overload {
|
mkOrd : overload {
|
||||||
mkOrd : (nom : Str) -> Ord ;
|
mkOrd : (nom : Str) -> Ord ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-------------------------
|
-------------------------
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
@@ -275,7 +276,7 @@ oper
|
|||||||
mkA : Str -> Str -> A
|
mkA : Str -> Str -> A
|
||||||
= \nom, comp -> lin A ((guessAdjectiveForms nom) ** {comp=comp}) ;
|
= \nom, comp -> lin A ((guessAdjectiveForms nom) ** {comp=comp}) ;
|
||||||
mkA : Str -> Str -> Str -> A
|
mkA : Str -> Str -> Str -> A
|
||||||
= \nom, comp, zi -> lin A (makeAdjectiveForms nom comp zi PrefFull) ;
|
= \nom, comp, zi -> lin A (makeAdjectiveForms nom comp zi PreferFull) ;
|
||||||
mkA : Str -> Str -> Str -> ShortFormPreference -> A
|
mkA : Str -> Str -> Str -> ShortFormPreference -> A
|
||||||
= \nom, comp, zi, spf -> lin A (makeAdjectiveForms nom comp zi spf) ;
|
= \nom, comp, zi, spf -> lin A (makeAdjectiveForms nom comp zi spf) ;
|
||||||
} ;
|
} ;
|
||||||
@@ -285,14 +286,17 @@ oper
|
|||||||
|
|
||||||
-- Two-place adjectives need a preposition and a case as extra arguments.
|
-- Two-place adjectives need a preposition and a case as extra arguments.
|
||||||
|
|
||||||
-- TODO: ? mkA2 : A -> Str -> Case -> A2 ; -- "делим на"
|
mkA2 = overload {
|
||||||
mkA2 : A -> Prep -> A2
|
mkA2 : A -> Prep -> A2
|
||||||
= \a,p -> lin A2 (a ** {c = p}) ;
|
= \a,p -> lin A2 (a ** {c = p}) ;
|
||||||
|
mkA2 : A -> Str -> Case -> A2
|
||||||
|
= \a,p,cas -> lin A2 (a ** {c = mkPrep p cas}) ;
|
||||||
|
} ;
|
||||||
|
|
||||||
mkOrd = overload {
|
mkOrd = overload {
|
||||||
mkOrd : (nom : Str) -> Ord
|
mkOrd : (nom : Str) -> Ord
|
||||||
= \nom -> lin Ord (guessAdjectiveForms nom) ;
|
= \nom -> lin Ord (guessAdjectiveForms nom) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-------------------------
|
-------------------------
|
||||||
-- Verbs
|
-- Verbs
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ param
|
|||||||
|
|
||||||
Case = Nom | Gen | Dat | Acc | Ins | Pre -- падеж, "малые падежи":
|
Case = Nom | Gen | Dat | Acc | Ins | Pre -- падеж, "малые падежи":
|
||||||
| Loc | Ptv | VocRus ; -- "minor cases", usually Loc = Pre, Ptv = Gen, VocRus = Nom
|
| Loc | Ptv | VocRus ; -- "minor cases", usually Loc = Pre, Ptv = Gen, VocRus = Nom
|
||||||
ShortFormPreference = PrefShort | PrefFull ;
|
ShortFormPreference = PrefShort | PreferFull ;
|
||||||
CopulaType = NomCopula | InsCopula | EllCopula | ExplicitCopula ;
|
CopulaType = NomCopula | InsCopula | EllCopula | ExplicitCopula ;
|
||||||
SpecialFuture = NormalFuture | BeFuture | CanFuture | WantFuture | NullFuture ;
|
SpecialFuture = NormalFuture | BeFuture | BeFuture2 | CanFuture | WantFuture | NullFuture ;
|
||||||
DetType = NormalDet | EmptyDef | EmptyIndef ; -- artificial parameter to side-step DetNP parsing issues
|
DetType = NormalDet | EmptyDef | EmptyIndef ; -- artificial parameter to side-step DetNP parsing issues
|
||||||
oper
|
oper
|
||||||
MaybeAgr = Maybe Agr ;
|
MaybeAgr = Maybe Agr ;
|
||||||
@@ -72,6 +72,7 @@ oper
|
|||||||
sm, sf, sn, sp, -- short forms
|
sm, sf, sn, sp, -- short forms
|
||||||
comp -- comparative variants
|
comp -- comparative variants
|
||||||
: Str ;
|
: Str ;
|
||||||
|
p : Bool ;
|
||||||
preferShort : ShortFormPreference
|
preferShort : ShortFormPreference
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ lin
|
|||||||
|
|
||||||
-- : IP -> ClSlash -> QCl ; -- whom does John love
|
-- : IP -> ClSlash -> QCl ; -- whom does John love
|
||||||
QuestSlash ip cls = cls ** {
|
QuestSlash ip cls = cls ** {
|
||||||
subj=(applyIPronPrep cls.c ip) ++ cls.subj ; -- cls.subj ???
|
subj=(applyIPronPrep cls.c ip) ++ cls.subj ;
|
||||||
a=ip.a
|
a=cls.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : IAdv -> Cl -> QCl ; -- why does John walk
|
-- : IAdv -> Cl -> QCl ; -- why does John walk
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ concrete RelativeRus of Relative = CatRus ** open
|
|||||||
lin
|
lin
|
||||||
-- : Cl -> RCl ; -- such that John loves her
|
-- : Cl -> RCl ; -- such that John loves her
|
||||||
RelCl cl = {
|
RelCl cl = {
|
||||||
subj=such.s ;
|
subj=\\gn,anim,cas => such.s ! gn ! anim ! cas ++ comma ++ "что" ++ cl.subj ;
|
||||||
adv=\\a=> cl.subj ++ comma ++ "что" ++ cl.adv ; -- TODO: this should be after subj in this case
|
adv=\\a => cl.adv ;
|
||||||
verb=cl.verb ;
|
verb=cl.verb ;
|
||||||
dep=cl.dep ;
|
dep=cl.dep ;
|
||||||
compl=\\a=>cl.compl ;
|
compl=\\a => cl.compl ;
|
||||||
a=Just Agr cl.a
|
a=Just Agr cl.a
|
||||||
} ;
|
} ;
|
||||||
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
||||||
|
|||||||
@@ -197,14 +197,6 @@ oper
|
|||||||
|
|
||||||
AgrTable = Agr => Str ;
|
AgrTable = Agr => Str ;
|
||||||
|
|
||||||
agree : ComplementCase -> AgrTable
|
|
||||||
= \c -> table {
|
|
||||||
_ => c.s -- TODO: implement
|
|
||||||
} ;
|
|
||||||
|
|
||||||
selectCase : (Case => Str) -> ComplementCase -> Str
|
|
||||||
= \np,prep -> prep.s ++ np ! prep.c ; -- TODO: NP - pronoun special treatment
|
|
||||||
|
|
||||||
from2 = {s="из"; c=Gen; hasPrep=True} ;
|
from2 = {s="из"; c=Gen; hasPrep=True} ;
|
||||||
|
|
||||||
mkCompoundN : NounForms -> Str -> NounForms -> NounForms
|
mkCompoundN : NounForms -> Str -> NounForms -> NounForms
|
||||||
@@ -246,7 +238,8 @@ oper
|
|||||||
sn = [] ;
|
sn = [] ;
|
||||||
sp = [] ;
|
sp = [] ;
|
||||||
comp = [] ;
|
comp = [] ;
|
||||||
preferShort = PrefFull
|
preferShort = PreferFull ;
|
||||||
|
p = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
immutableAdjForms = immutableAdjectiveCases ;
|
immutableAdjForms = immutableAdjectiveCases ;
|
||||||
@@ -346,33 +339,43 @@ oper
|
|||||||
preferShort = forms.preferShort
|
preferShort = forms.preferShort
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
doGuessAdjectiveForms : Str -> AdjForms
|
||||||
|
= \word -> case word of {
|
||||||
|
_ + "шеий" => makeAdjective word (ZA 6 No A_ NoC) PreferFull ;
|
||||||
|
_ + "цый" => makeAdjective word (ZA 5 No A_ NoC) PreferFull ;
|
||||||
|
_ + ("к"|"г"|"х") +"ий" => makeAdjective word (ZA 3 No A_ NoC) PreferFull ;
|
||||||
|
_ + ("ш"|"ж"|"ч"|"щ")+"ий" => makeAdjective word (ZA 4 No A_ NoC) PreferFull ;
|
||||||
|
_ + #consonant + "ный" => makeAdjective word (ZA 1 Ast A_ NoC) PreferFull ;
|
||||||
|
_ + #consonant + "ний" => makeAdjective word (ZA 2 Ast A_ NoC) PreferFull ;
|
||||||
|
_ + "ый" => makeAdjective word (ZA 1 No A_ NoC) PreferFull ;
|
||||||
|
_ + "ой" => makeAdjective word (ZA 1 No B_ NoC) PreferFull ;
|
||||||
|
_ + "ий" => makeAdjective word (ZA 2 No A_ NoC) PreferFull ;
|
||||||
|
_ => makeAdjective word (ZA 1 No A_ NoC) PreferFull
|
||||||
|
} ;
|
||||||
|
|
||||||
guessAdjectiveForms : Str -> AdjForms
|
guessAdjectiveForms : Str -> AdjForms
|
||||||
= \word ->
|
= \word -> case word of {
|
||||||
let stem = Predef.tk 2 word in
|
s + "ся" => appendToAF (doGuessAdjectiveForms s) "ся" ;
|
||||||
case word of {
|
_ => doGuessAdjectiveForms word
|
||||||
_ + "шеий" => makeAdjective word (ZA 6 No A_ NoC) PrefFull ;
|
} ;
|
||||||
_ + "цый" => makeAdjective word (ZA 5 No A_ NoC) PrefFull ;
|
|
||||||
_ + ("к"|"г"|"х") +"ий" => makeAdjective word (ZA 3 No A_ NoC) PrefFull ;
|
doMakeAdjectiveForms : Str -> Str -> Str -> ShortFormPreference -> AdjForms
|
||||||
_ + ("ш"|"ж"|"ч"|"щ")+"ий" => makeAdjective word (ZA 4 No A_ NoC) PrefFull ;
|
= \nom, comp, zi, spf ->
|
||||||
_ + #consonant + "ный" => makeAdjective word (ZA 1 Ast A_ NoC) PrefFull ;
|
let af = makeAdjective nom (parseAdjIndex zi) spf in
|
||||||
_ + #consonant + "ний" => makeAdjective word (ZA 2 Ast A_ NoC) PrefFull ;
|
let comp' = case (Predef.length comp) of {0 => af.comp; _ => comp} in
|
||||||
_ + "ый" => makeAdjective word (ZA 1 No A_ NoC) PrefFull ;
|
af ** {comp=comp'} ;
|
||||||
_ + "ой" => makeAdjective word (ZA 1 No B_ NoC) PrefFull ;
|
|
||||||
_ + "ий" => makeAdjective word (ZA 2 No A_ NoC) PrefFull ;
|
|
||||||
_ => makeAdjective word (ZA 1 No A_ NoC) PrefFull
|
|
||||||
} ;
|
|
||||||
|
|
||||||
makeAdjectiveForms : Str -> Str -> Str -> ShortFormPreference -> AdjForms
|
makeAdjectiveForms : Str -> Str -> Str -> ShortFormPreference -> AdjForms
|
||||||
= \nom, comp, zi, spf ->
|
= \nom, comp, zi, spf -> case nom of {
|
||||||
let af = makeAdjective nom (parseAdjIndex zi) spf in
|
s + "ся" => appendToAF (doMakeAdjectiveForms s comp zi spf) "ся" ;
|
||||||
let comp' = case (Predef.length comp) of {0 => af.comp; _ => comp} in
|
_ => doMakeAdjectiveForms nom comp zi spf
|
||||||
af ** {comp=comp'} ;
|
} ;
|
||||||
|
|
||||||
makeAdjectiveFromNoun : Noun -> Adjective
|
makeAdjectiveFromNoun : Noun -> Adjective
|
||||||
= \n -> {
|
= \n -> {
|
||||||
s = \\gn,anim,cas=> n.s ! numGenNum gn ! cas ;
|
s = \\gn,anim,cas=> n.s ! numGenNum gn ! cas ;
|
||||||
short=\\a=>[] ;
|
short=\\a=>[] ;
|
||||||
preferShort=PrefFull
|
preferShort=PreferFull
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
the_most = guessAdjectiveForms "самый" ;
|
the_most = guessAdjectiveForms "самый" ;
|
||||||
@@ -401,10 +404,45 @@ oper
|
|||||||
sp = the_most.sp ++ af.sp ;
|
sp = the_most.sp ++ af.sp ;
|
||||||
comp = the_most.comp ++ af.comp ;
|
comp = the_most.comp ++ af.comp ;
|
||||||
g=af.g ;
|
g=af.g ;
|
||||||
-- a=af.a ;
|
preferShort = PreferFull ;
|
||||||
preferShort = PrefFull
|
p = af.p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
prependPF : Str -> PronForms -> PronForms
|
||||||
|
= \s,pf -> {
|
||||||
|
msnom = s ++ pf.msnom ;
|
||||||
|
fsnom = s ++ pf.fsnom ;
|
||||||
|
nsnom = s ++ pf.nsnom ;
|
||||||
|
pnom = s ++ pf.pnom ;
|
||||||
|
msgen = s ++ pf.msgen ;
|
||||||
|
fsgen = s ++ pf.fsgen ;
|
||||||
|
pgen = s ++ pf.pgen ;
|
||||||
|
msdat = s ++ pf.msdat ;
|
||||||
|
fsacc = s ++ pf.fsacc ;
|
||||||
|
msins = s ++ pf.msins ;
|
||||||
|
fsins = s ++ pf.fsins ;
|
||||||
|
pins = s ++ pf.pins ;
|
||||||
|
msprep= s ++ pf.msprep
|
||||||
|
} ;
|
||||||
|
|
||||||
|
appendToAF : AdjForms -> Str -> AdjForms
|
||||||
|
= \af,s -> af ** {
|
||||||
|
msnom = af.msnom ++ BIND ++ s;
|
||||||
|
fsnom = af.fsnom ++ BIND ++ s;
|
||||||
|
nsnom = af.nsnom ++ BIND ++ s;
|
||||||
|
pnom = af.pnom ++ BIND ++ s;
|
||||||
|
msgen = af.msgen ++ BIND ++ s;
|
||||||
|
fsgen = af.fsgen ++ BIND ++ s;
|
||||||
|
pgen = af.pgen ++ BIND ++ s;
|
||||||
|
msdat = af.msdat ++ BIND ++ s;
|
||||||
|
fsacc = af.fsacc ++ BIND ++ s;
|
||||||
|
msins = af.msins ++ BIND ++ s;
|
||||||
|
fsins = af.fsins ++ BIND ++ s;
|
||||||
|
pins = af.pins ++ BIND ++ s;
|
||||||
|
msprep= af.msprep ++ BIND ++ s;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
makeNFFromAF : AdjForms -> Gender -> Animacy -> NounForms
|
makeNFFromAF : AdjForms -> Gender -> Animacy -> NounForms
|
||||||
= \af, g, anim ->
|
= \af, g, anim ->
|
||||||
case g of {
|
case g of {
|
||||||
@@ -548,6 +586,7 @@ oper
|
|||||||
-- TODO: Provide also Nom-based as idiomatic (?)
|
-- TODO: Provide also Nom-based as idiomatic (?)
|
||||||
copulaIns : VerbForms
|
copulaIns : VerbForms
|
||||||
= copula ** {
|
= copula ** {
|
||||||
|
fut=BeFuture2 ;
|
||||||
prsg1="являюсь" ;
|
prsg1="являюсь" ;
|
||||||
prsg2="являешься" ;
|
prsg2="являешься" ;
|
||||||
prsg3="является" ;
|
prsg3="является" ;
|
||||||
@@ -646,13 +685,13 @@ oper
|
|||||||
tran=Intransitive
|
tran=Intransitive
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
verbPastAgree : VerbForms -> Agr -> Str -> TempParts
|
verbPastAgree : VerbForms -> Agr -> Str -> Str
|
||||||
= \vf,a,after -> <"", case a of {
|
= \vf,a,after -> case a of {
|
||||||
Ag (GSg Masc) _ => vf.psgm ++ (verbReflAfterConsonant vf) ++ after ;
|
Ag (GSg Masc) _ => vf.psgm ++ (verbReflAfterConsonant vf) ++ after ;
|
||||||
Ag (GSg Fem) _ => vf.psgs ++ BIND ++ "ла" ++ (verbRefl vf) ++ after ;
|
Ag (GSg Fem) _ => vf.psgs ++ BIND ++ "ла" ++ (verbRefl vf) ++ after ;
|
||||||
Ag (GSg Neut) _ => vf.psgs ++ BIND ++ "ло" ++ (verbRefl vf) ++ after ;
|
Ag (GSg Neut) _ => vf.psgs ++ BIND ++ "ло" ++ (verbRefl vf) ++ after ;
|
||||||
Ag GPl _ => vf.psgs ++ BIND ++ "ли"++ (verbRefl vf) ++ after
|
Ag GPl _ => vf.psgs ++ BIND ++ "ли"++ (verbRefl vf) ++ after
|
||||||
}> ;
|
} ;
|
||||||
|
|
||||||
verbReflAfterConsonant : VerbForms -> Str
|
verbReflAfterConsonant : VerbForms -> Str
|
||||||
= \vf -> case vf.refl of {Reflexive => BIND ++ "ся" ; NonReflexive => ""} ;
|
= \vf -> case vf.refl of {Reflexive => BIND ++ "ся" ; NonReflexive => ""} ;
|
||||||
@@ -698,7 +737,7 @@ oper
|
|||||||
<CanFuture,Ag GPl P1 > => "сможем" ;
|
<CanFuture,Ag GPl P1 > => "сможем" ;
|
||||||
<CanFuture,Ag GPl P2 > => "сможете" ;
|
<CanFuture,Ag GPl P2 > => "сможете" ;
|
||||||
<CanFuture,Ag GPl P3 > => "смогут" ;
|
<CanFuture,Ag GPl P3 > => "смогут" ;
|
||||||
<BeFuture,_> => beFuture a ;
|
<BeFuture | BeFuture2,_> => beFuture a ;
|
||||||
_ => case vf.asp of {
|
_ => case vf.asp of {
|
||||||
Perfective => verbPresAgree vf a ;
|
Perfective => verbPresAgree vf a ;
|
||||||
Imperfective => (beFuture a) ++ verbInf vf
|
Imperfective => (beFuture a) ++ verbInf vf
|
||||||
@@ -715,19 +754,32 @@ oper
|
|||||||
Ag GPl P3 => <"пусть", verbFutAgree vf (Ag GPl P3)>
|
Ag GPl P3 => <"пусть", verbFutAgree vf (Ag GPl P3)>
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
verbAgr : VerbForms -> Mood -> Tense -> Agr -> Polarity -> TempParts
|
verbEnvAgr : Str -> Str -> VerbForms -> Mood -> Tense -> Agr -> Pol -> Str
|
||||||
= \vf,m,temp,a,pol ->
|
= \subj,adv,vf,m,temp,a,pol ->
|
||||||
case <vf.fut,m,temp> of {
|
case vf.fut of {
|
||||||
<NullFuture, _, _> => <"",""> ;
|
NullFuture => subj ++ pol.s ++ adv ;
|
||||||
<_, Ind, Past> => verbPastAgree vf a "";
|
BeFuture => case <m,temp, pol.p> of {
|
||||||
<_, Ind, Pres> => <"",verbPresAgree vf a>;
|
<Ind, Past, _> => subj ++ pol.s ++ adv ++ verbPastAgree vf a "" ;
|
||||||
<_, Ind, Fut> => <"",verbFutAgree vf a>;
|
<Ind, Pres, Pos> => subj ++ pol.s ++ adv ++ verbPresAgree vf a ;
|
||||||
<_, Ind, Cond> => verbPastAgree vf a "бы" ;
|
<Ind, Pres, Neg> => subj ++ "нет" ++ adv ;
|
||||||
<_, Sbjv, _> => verbPastAgree vf a "бы" ;
|
<Ind, Fut, _> => subj ++ pol.s ++ adv ++ verbFutAgree vf a ;
|
||||||
<_, Imperative, _> => verbImperativeAgree vf a ;
|
<Ind, Cond, _> => subj ++ pol.s ++ adv ++ verbPastAgree vf a "бы" ;
|
||||||
<_, Infinitive, _> => <"",verbInf vf>
|
<Sbjv, _, _> => subj ++ pol.s ++ adv ++ verbPastAgree vf a "бы" ;
|
||||||
|
<Imperative, _, _> => let p = verbImperativeAgree vf a in p.p1 ++ subj ++ pol.s ++ adv ++ p.p2 ;
|
||||||
|
<Infinitive, _, _> => subj ++ pol.s ++ adv ++ verbInf vf
|
||||||
|
} ;
|
||||||
|
_ => case <m,temp> of {
|
||||||
|
<Ind, Past> => subj ++ pol.s ++ adv ++ verbPastAgree vf a "" ;
|
||||||
|
<Ind, Pres> => subj ++ pol.s ++ adv ++ verbPresAgree vf a ;
|
||||||
|
<Ind, Fut> => subj ++ pol.s ++ adv ++ verbFutAgree vf a ;
|
||||||
|
<Ind, Cond> => subj ++ pol.s ++ adv ++ verbPastAgree vf a "бы" ;
|
||||||
|
<Sbjv, _> => subj ++ pol.s ++ adv ++ verbPastAgree vf a "бы" ;
|
||||||
|
<Imperative, _> => let p = verbImperativeAgree vf a in p.p1 ++ subj ++ pol.s ++ adv ++ p.p2 ;
|
||||||
|
<Infinitive, _> => subj ++ pol.s ++ adv ++ verbInf vf
|
||||||
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
-- Pronouns -- Местоимения
|
-- Pronouns -- Местоимения
|
||||||
|
|
||||||
@@ -923,7 +975,7 @@ oper
|
|||||||
dat = "им" ; -- TODO: n
|
dat = "им" ; -- TODO: n
|
||||||
ins = "ими" ; -- TODO: n
|
ins = "ими" ; -- TODO: n
|
||||||
prep, loc = "них" ;
|
prep, loc = "них" ;
|
||||||
nPrefix = False ;
|
nPrefix = True ;
|
||||||
poss = doPossessivePronP3 "их"
|
poss = doPossessivePronP3 "их"
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
@@ -1220,8 +1272,9 @@ oper
|
|||||||
fsins = "той" ;
|
fsins = "той" ;
|
||||||
pins = "тех" ;
|
pins = "тех" ;
|
||||||
msprep = "том" ;
|
msprep = "том" ;
|
||||||
preferShort = PrefFull ;
|
preferShort = PreferFull ;
|
||||||
comp = []
|
comp = [] ;
|
||||||
|
p = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
this_forms = {
|
this_forms = {
|
||||||
@@ -1238,8 +1291,9 @@ oper
|
|||||||
fsins = "этой" ;
|
fsins = "этой" ;
|
||||||
pins = "этими" ;
|
pins = "этими" ;
|
||||||
msprep = "этом" ;
|
msprep = "этом" ;
|
||||||
preferShort = PrefFull ;
|
preferShort = PreferFull ;
|
||||||
comp = []
|
comp = [] ;
|
||||||
|
p = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
a_forms = { -- this pronoun is an approximate translation of indef article; preventing DetNP parsing problems
|
a_forms = { -- this pronoun is an approximate translation of indef article; preventing DetNP parsing problems
|
||||||
@@ -1256,8 +1310,9 @@ oper
|
|||||||
fsins = "некой" ;
|
fsins = "некой" ;
|
||||||
pins = "неким" ;
|
pins = "неким" ;
|
||||||
msprep = "некой" ;
|
msprep = "некой" ;
|
||||||
preferShort = PrefFull ;
|
preferShort = PreferFull ;
|
||||||
comp = []
|
comp = [] ;
|
||||||
|
p = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
a_Det = {
|
a_Det = {
|
||||||
@@ -1291,8 +1346,9 @@ oper
|
|||||||
fsins = "данной" ;
|
fsins = "данной" ;
|
||||||
pins = "данных" ;
|
pins = "данных" ;
|
||||||
msprep = "данном" ;
|
msprep = "данном" ;
|
||||||
preferShort = PrefFull ;
|
preferShort = PreferFull ;
|
||||||
comp = []
|
comp = [] ;
|
||||||
|
p = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
the_Det = {
|
the_Det = {
|
||||||
@@ -1320,6 +1376,27 @@ param Place = attr | indep ;
|
|||||||
oper
|
oper
|
||||||
mille : Noun = nounFormsNoun ((guessNounForms "тысяча") ** {sins=variants {"тысячей" ; "тысячью"}});
|
mille : Noun = nounFormsNoun ((guessNounForms "тысяча") ** {sins=variants {"тысячей" ; "тысячью"}});
|
||||||
|
|
||||||
|
ith_forms : Str -> AdjForms
|
||||||
|
= \s -> {
|
||||||
|
msnom = s ++ BIND ++ "-й" ; -- after vowel
|
||||||
|
fsnom = s ++ BIND ++ "-я" ;
|
||||||
|
nsnom = s ++ BIND ++ "-е" ;
|
||||||
|
pnom = s ++ BIND ++ "-е" ;
|
||||||
|
msgen = s ++ BIND ++ "-го" ; -- after consonant
|
||||||
|
fsgen = s ++ BIND ++ "-й" ;
|
||||||
|
pgen = s ++ BIND ++ "-х" ;
|
||||||
|
msdat = s ++ BIND ++ "-му" ;
|
||||||
|
fsacc = s ++ BIND ++ "-ю" ;
|
||||||
|
msins = s ++ BIND ++ "-м" ;
|
||||||
|
fsins = s ++ BIND ++ "-й" ;
|
||||||
|
pins = s ++ BIND ++ "-ми" ;
|
||||||
|
msprep= s ++ BIND ++ "-м" ;
|
||||||
|
sm, sf, sn, sp = s ;
|
||||||
|
comp = s ++ BIND ++ "-е" ; --*
|
||||||
|
p = False ;
|
||||||
|
preferShort=PreferFull
|
||||||
|
} ;
|
||||||
|
|
||||||
---------------
|
---------------
|
||||||
-- Adverbs -- Наречия
|
-- Adverbs -- Наречия
|
||||||
|
|
||||||
@@ -1334,6 +1411,12 @@ oper
|
|||||||
oper
|
oper
|
||||||
DetTable = Gender => Animacy => Case => Str ;
|
DetTable = Gender => Animacy => Case => Str ;
|
||||||
|
|
||||||
|
NumeralForms : Type = {
|
||||||
|
s : DetTable ;
|
||||||
|
o : PronForms ;
|
||||||
|
size : NumSize
|
||||||
|
} ;
|
||||||
|
|
||||||
NumDet : Type = {
|
NumDet : Type = {
|
||||||
s : DetTable ;
|
s : DetTable ;
|
||||||
size : NumSize
|
size : NumSize
|
||||||
|
|||||||
@@ -4,45 +4,28 @@ lin
|
|||||||
-- : Adv -> S -> S ; -- then I will go home
|
-- : Adv -> S -> S ; -- then I will go home
|
||||||
AdvS adv s = {s=\\m => adv.s ++ s.s ! m} ;
|
AdvS adv s = {s=\\m => adv.s ++ s.s ! m} ;
|
||||||
-- : Adv -> S -> S ; -- next week, I will go home
|
-- : Adv -> S -> S ; -- next week, I will go home
|
||||||
ExtAdvS adv s = {s=\\m => adv.s ++ comma ++ s.s ! m} ; -- TODO: what is the case for this? embed in commas?
|
ExtAdvS adv s = {s=\\m => adv.s ++ comma ++ s.s ! m} ;
|
||||||
|
|
||||||
-- : Temp -> Pol -> Cl -> S ; -- she had not slept - она не спала
|
-- : Temp -> Pol -> Cl -> S ; -- she had not slept - она не спала
|
||||||
UseCl temp pol cl = {
|
UseCl temp pol cl = {
|
||||||
s = table {
|
s : Mood => Str = \\m => temp.s ++ (R.verbEnvAgr cl.subj cl.adv cl.verb m temp.t cl.a pol) ++ cl.dep ++ cl.compl ;
|
||||||
Infinitive => let parts = R.verbAgr cl.verb Infinitive temp.t cl.a pol.p in
|
|
||||||
temp.s ++ parts.p1 ++ cl.subj ++ pol.s ++ cl.adv ++ parts.p2 ++ cl.dep ++ cl.compl ;
|
|
||||||
Ind => let parts = R.verbAgr cl.verb Ind temp.t cl.a pol.p in
|
|
||||||
temp.s ++ parts.p1 ++ cl.subj ++ pol.s ++ cl.adv ++ parts.p2 ++ cl.dep ++ cl.compl ;
|
|
||||||
-- temp.s ++ cl.adv ++ pol.s ++ parts.p1 ++ parts.p2 ++ cl.dep ++ cl.subj ++ cl.compl ;
|
|
||||||
Sbjv => let parts = R.verbAgr cl.verb Sbjv temp.t cl.a pol.p in
|
|
||||||
temp.s ++ parts.p1 ++ cl.subj ++ pol.s ++ cl.adv ++ parts.p2 ++ cl.dep ++ cl.compl ;
|
|
||||||
Imperative => let parts = R.verbAgr cl.verb Imperative temp.t cl.a pol.p in
|
|
||||||
temp.s ++ parts.p1 ++ cl.subj ++ pol.s ++ cl.adv ++ parts.p2 ++ cl.dep ++ cl.compl
|
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : Temp -> Pol -> RCl -> RS ; -- that had not slept
|
-- : Temp -> Pol -> RCl -> RS ; -- that had not slept
|
||||||
UseRCl temp pol rcl = {
|
UseRCl temp pol rcl = {
|
||||||
s = \\gn,anim,cas =>
|
s = \\gn,anim,cas =>
|
||||||
let a : Agr = fromMaybe Agr (genNumAgrP3 gn) rcl.a in
|
let a : Agr = fromMaybe Agr (genNumAgrP3 gn) rcl.a in
|
||||||
let parts = R.verbAgr rcl.verb Ind temp.t a pol.p in
|
temp.s
|
||||||
temp.s ++ parts.p1 ++ rcl.subj ! gn ! anim ! Nom ++ rcl.adv ! (genNumAgrP3 gn) ++ pol.s ++ parts.p2 ++ rcl.dep ++ rcl.compl ! (genNumAgrP3 gn)
|
++ (R.verbEnvAgr (rcl.subj ! gn ! anim ! Nom) (rcl.adv ! (genNumAgrP3 gn)) rcl.verb Ind temp.t a pol)
|
||||||
|
++ rcl.dep ++ rcl.compl ! (genNumAgrP3 gn)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen
|
-- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen
|
||||||
UseSlash temp pol cls = {
|
UseSlash temp pol cls = {
|
||||||
s = table {
|
s : Mood => Str = \\m => temp.s
|
||||||
Infinitive => let parts = R.verbAgr cls.verb Infinitive temp.t cls.a pol.p in
|
++ (R.verbEnvAgr cls.subj cls.adv cls.verb m temp.t cls.a pol) ++ cls.dep ++ cls.compl ;
|
||||||
temp.s ++ parts.p1 ++ cls.subj ++ pol.s ++ cls.adv ++ parts.p2 ++ cls.dep ++ cls.compl ;
|
|
||||||
Ind => let parts = R.verbAgr cls.verb Ind temp.t cls.a pol.p in
|
|
||||||
temp.s ++ parts.p1 ++ cls.subj ++ pol.s ++ cls.adv ++ parts.p2 ++ cls.dep ++ cls.compl ;
|
|
||||||
Sbjv => let parts = R.verbAgr cls.verb Sbjv temp.t cls.a pol.p in
|
|
||||||
temp.s ++ parts.p1 ++ cls.subj ++ pol.s ++ cls.adv ++ parts.p2 ++ cls.dep ++ cls.compl ;
|
|
||||||
Imperative => let parts = R.verbAgr cls.verb Imperative temp.t cls.a pol.p in
|
|
||||||
temp.s ++ parts.p1 ++ cls.subj ++ pol.s ++ cls.adv ++ parts.p2 ++ cls.dep ++ cls.compl
|
|
||||||
} ;
|
|
||||||
c=cls.c
|
c=cls.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : NP -> VPSlash -> ClSlash ; -- (whom) he sees
|
-- : NP -> VPSlash -> ClSlash ; -- (whom) he sees
|
||||||
SlashVP np vps = {
|
SlashVP np vps = {
|
||||||
@@ -92,8 +75,7 @@ lin
|
|||||||
s = \\polarity, gn =>
|
s = \\polarity, gn =>
|
||||||
let pol = case polarity of {Neg => PNeg; Pos => PPos} in
|
let pol = case polarity of {Neg => PNeg; Pos => PPos} in
|
||||||
let a = Ag gn P2 in
|
let a = Ag gn P2 in
|
||||||
let parts = R.verbAgr vp.verb Imperative Pres a pol.p in
|
(R.verbEnvAgr "" "" vp.verb Imperative Pres a pol) ++ vp.adv ! a ++ vp.compl ! a
|
||||||
parts.p1 ++ pol.s ++ parts.p2 ++ vp.dep ++ vp.adv ! a ++ vp.compl ! a
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : NP -> VP -> Cl ; -- John walks - Иван гуляет
|
-- : NP -> VP -> Cl ; -- John walks - Иван гуляет
|
||||||
@@ -121,10 +103,7 @@ lin
|
|||||||
|
|
||||||
-- : Temp -> Pol -> QCl -> QS ; -- who had not slept
|
-- : Temp -> Pol -> QCl -> QS ; -- who had not slept
|
||||||
UseQCl temp pol cl = {
|
UseQCl temp pol cl = {
|
||||||
s = table {_ =>
|
s = \\qf => temp.s ++ (R.verbEnvAgr cl.subj cl.adv cl.verb Ind temp.t cl.a pol) ++ cl.dep ++ cl.compl
|
||||||
let parts = R.verbAgr cl.verb Ind temp.t cl.a pol.p in
|
|
||||||
temp.s ++ parts.p1 ++ cl.subj ++ pol.s ++ cl.adv ++ parts.p2 ++ cl.dep ++ cl.compl
|
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : QS -> SC ; -- who goes
|
-- : QS -> SC ; -- who goes
|
||||||
|
|||||||
@@ -18,34 +18,34 @@ lin
|
|||||||
whoPl_IP = who_pl ;
|
whoPl_IP = who_pl ;
|
||||||
|
|
||||||
-- : IQuant ;
|
-- : IQuant ;
|
||||||
which_IQuant = (adjFormsAdjective (makeAdjectiveForms "который" "" "1a" PrefFull)) ** {
|
which_IQuant = (adjFormsAdjective (makeAdjectiveForms "который" "" "1a" PreferFull)) ** {
|
||||||
preferShort=PrefFull ;
|
preferShort=PreferFull ;
|
||||||
g=Neut ;
|
g=Neut ;
|
||||||
c=Nom
|
c=Nom
|
||||||
} ;
|
} ;
|
||||||
-- : Quant ;
|
-- : Quant ;
|
||||||
this_Quant = (adjFormsAdjective this_forms) ** {
|
this_Quant = (adjFormsAdjective this_forms) ** {
|
||||||
type=NormalDet ;
|
type=NormalDet ;
|
||||||
preferShort=PrefFull ;
|
preferShort=PreferFull ;
|
||||||
g=Neut ;
|
g=Neut ;
|
||||||
c=Nom
|
c=Nom
|
||||||
} ;
|
} ;
|
||||||
-- : Quant ;
|
-- : Quant ;
|
||||||
that_Quant = (adjFormsAdjective that_forms) ** {
|
that_Quant = (adjFormsAdjective that_forms) ** {
|
||||||
type=NormalDet ;
|
type=NormalDet ;
|
||||||
preferShort=PrefFull ;
|
preferShort=PreferFull ;
|
||||||
g=Neut ;
|
g=Neut ;
|
||||||
c=Nom
|
c=Nom
|
||||||
} ;
|
} ;
|
||||||
-- : Quant ;
|
-- : Quant ;
|
||||||
no_Quant = (adjFormsAdjective (makeAdjectiveForms "никакой" "" "3b" PrefFull)) ** {
|
no_Quant = (adjFormsAdjective (makeAdjectiveForms "никакой" "" "3b" PreferFull)) ** {
|
||||||
type=NormalDet ;
|
type=NormalDet ;
|
||||||
preferShort=PrefFull ;
|
preferShort=PreferFull ;
|
||||||
g=Neut ;
|
g=Neut ;
|
||||||
c=Nom
|
c=Nom
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
above_Prep = mkPrep "над" Ins ;
|
above_Prep = mkPrep above_prep_ins_mod Ins ;
|
||||||
after_Prep = mkPrep "после" Gen ;
|
after_Prep = mkPrep "после" Gen ;
|
||||||
before_Prep = mkPrep "перед" Ins ;
|
before_Prep = mkPrep "перед" Ins ;
|
||||||
behind_Prep = mkPrep "за" Ins ;
|
behind_Prep = mkPrep "за" Ins ;
|
||||||
@@ -55,15 +55,15 @@ lin
|
|||||||
during_Prep = mkPrep "в течение" Gen ;
|
during_Prep = mkPrep "в течение" Gen ;
|
||||||
except_Prep = mkPrep ["за исключением"] Gen ;
|
except_Prep = mkPrep ["за исключением"] Gen ;
|
||||||
for_Prep = mkPrep "для" Gen ;
|
for_Prep = mkPrep "для" Gen ;
|
||||||
from_Prep = mkPrep "от" Gen ;
|
from_Prep = mkPrep ot_prep_gen_mod Gen ;
|
||||||
in8front_Prep = mkPrep "перед" Ins ;
|
in8front_Prep = mkPrep "перед" Ins ;
|
||||||
in_Prep = mkPrep "в" Loc ;
|
in_Prep = mkPrep v_prep_mod Loc ;
|
||||||
on_Prep = mkPrep "на" Loc ;
|
on_Prep = mkPrep "на" Loc ;
|
||||||
part_Prep = {s="" ; c=Ptv ; hasPrep=False } ;
|
part_Prep = {s="" ; c=Ptv ; hasPrep=False } ;
|
||||||
possess_Prep = {s="у" ; c=Gen ; hasPrep=False} ;
|
possess_Prep = {s="у" ; c=Gen ; hasPrep=False} ;
|
||||||
through_Prep = mkPrep "через" Acc ;
|
through_Prep = mkPrep "через" Acc ;
|
||||||
to_Prep = mkPrep "к" Dat ;
|
to_Prep = mkPrep k_prep_dat_mod Dat ;
|
||||||
under_Prep = mkPrep "под" Ins ;
|
under_Prep = mkPrep pod_prep_mod Ins ;
|
||||||
without_Prep = mkPrep "без" Gen ;
|
without_Prep = mkPrep "без" Gen ;
|
||||||
|
|
||||||
or_Conj = mkConj "или" Sg ;
|
or_Conj = mkConj "или" Sg ;
|
||||||
@@ -72,7 +72,7 @@ lin
|
|||||||
either7or_DConj = mkConj "либо" (comma ++ "либо") Sg ;
|
either7or_DConj = mkConj "либо" (comma ++ "либо") Sg ;
|
||||||
if_then_Conj = mkConj "если" (comma ++ "то") Sg ;
|
if_then_Conj = mkConj "если" (comma ++ "то") Sg ;
|
||||||
|
|
||||||
with_Prep = mkPrep "с" Ins ;
|
with_Prep = mkPrep s_prep_mod Ins ;
|
||||||
|
|
||||||
please_Voc = ss "пожалуйста" ;
|
please_Voc = ss "пожалуйста" ;
|
||||||
|
|
||||||
@@ -100,12 +100,12 @@ lin
|
|||||||
|
|
||||||
can8know_VV = {v=can; modal=\\a=>[]} ;
|
can8know_VV = {v=can; modal=\\a=>[]} ;
|
||||||
can_VV = {v=can; modal=\\a=>[]} ;
|
can_VV = {v=can; modal=\\a=>[]} ;
|
||||||
must_VV = {v=nullVerb; modal=adjFormsToShort (makeAdjectiveForms "должный" "" "1*a" PrefFull)} ;
|
must_VV = {v=nullVerb; modal=adjFormsToShort (makeAdjectiveForms "должный" "" "1*a" PreferFull)} ;
|
||||||
want_VV = {v=want; modal=\\a=>[]} ;
|
want_VV = {v=want; modal=\\a=>[]} ;
|
||||||
|
|
||||||
-- : Det ;
|
-- : Det ;
|
||||||
every_Det = {
|
every_Det = {
|
||||||
s = \\g => (adjFormsAdjective (makeAdjectiveForms "каждый" "" "1*a" PrefFull)).s ! GSg g;
|
s = \\g => (adjFormsAdjective (makeAdjectiveForms "каждый" "" "1*a" PreferFull)).s ! GSg g;
|
||||||
type=NormalDet ;
|
type=NormalDet ;
|
||||||
g = Masc ;
|
g = Masc ;
|
||||||
c = Nom ;
|
c = Nom ;
|
||||||
@@ -113,7 +113,7 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
-- : Det ;
|
-- : Det ;
|
||||||
someSg_Det = {
|
someSg_Det = {
|
||||||
s = \\g => (adjFormsAdjective (makeAdjectiveForms "некоторый" "" "1*a" PrefFull)).s ! GSg g;
|
s = \\g => (adjFormsAdjective (makeAdjectiveForms "некоторый" "" "1*a" PreferFull)).s ! GSg g;
|
||||||
type=NormalDet ;
|
type=NormalDet ;
|
||||||
g = Masc ;
|
g = Masc ;
|
||||||
c = Nom ;
|
c = Nom ;
|
||||||
@@ -121,15 +121,15 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
-- : Det ;
|
-- : Det ;
|
||||||
somePl_Det = {
|
somePl_Det = {
|
||||||
s = \\g => (adjFormsAdjective (makeAdjectiveForms "некоторый" "" "1*a" PrefFull)).s ! GPl;
|
s = \\g => (adjFormsAdjective (makeAdjectiveForms "некоторый" "" "1*a" PreferFull)).s ! GPl;
|
||||||
type=NormalDet ;
|
type=NormalDet ;
|
||||||
g = Masc ;
|
g = Masc ;
|
||||||
c = Nom ;
|
c = Nom ;
|
||||||
size = NumAll ;
|
size = NumAll ;
|
||||||
} ;
|
} ;
|
||||||
-- : Det ;
|
-- : Det ;
|
||||||
few_Det = { -- numeral! TODO: мало ? немного ?
|
few_Det = {
|
||||||
s = \\g => (adjFormsAdjective (makeAdjectiveForms "немногий" "" "3a" PrefFull)).s ! GPl;
|
s = \\g => (adjFormsAdjective (makeAdjectiveForms "немногий" "" "3a" PreferFull)).s ! GPl;
|
||||||
type=NormalDet ;
|
type=NormalDet ;
|
||||||
g = Masc ;
|
g = Masc ;
|
||||||
c = Nom ;
|
c = Nom ;
|
||||||
@@ -137,7 +137,7 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
-- : Det ;
|
-- : Det ;
|
||||||
many_Det, much_Det = {
|
many_Det, much_Det = {
|
||||||
s = \\g => (adjFormsAdjective (makeAdjectiveForms "многий" "" "3a" PrefFull)).s ! GPl;
|
s = \\g => (adjFormsAdjective (makeAdjectiveForms "многий" "" "3a" PreferFull)).s ! GPl;
|
||||||
type=NormalDet ;
|
type=NormalDet ;
|
||||||
g = Neut ;
|
g = Neut ;
|
||||||
c = Gen ;
|
c = Gen ;
|
||||||
@@ -166,8 +166,8 @@ lin
|
|||||||
almost_AdA = ss "почти" ;
|
almost_AdA = ss "почти" ;
|
||||||
almost_AdN = ss "почти" ;
|
almost_AdN = ss "почти" ;
|
||||||
always_AdV = ss "всегда" ;
|
always_AdV = ss "всегда" ;
|
||||||
at_least_AdN = ss "по меньшей мере" ; -- TODO: ?
|
at_least_AdN = ss "по меньшей мере" ;
|
||||||
at_most_AdN = ss "самое большее" ; -- TODO: ?
|
at_most_AdN = ss "самое большее" ;
|
||||||
too_AdA = ss "слишком" ;
|
too_AdA = ss "слишком" ;
|
||||||
very_AdA = ss "очень" ;
|
very_AdA = ss "очень" ;
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ lin
|
|||||||
-- : Symb -> Card ; -- n
|
-- : Symb -> Card ; -- n
|
||||||
SymbNum symb = {s = \\_,_,_ => symb.s ; size = Num5} ;
|
SymbNum symb = {s = \\_,_,_ => symb.s ; size = Num5} ;
|
||||||
|
|
||||||
-- : Symb -> Ord ; -- n'th
|
-- : Symb -> Ord ; -- n'th (i-й "итый")
|
||||||
SymbOrd symb = immutableAdjForms symb.s ; -- TODO: better implementation
|
SymbOrd symb = ith_forms symb.s ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Symb, [Symb] = SS ;
|
Symb, [Symb] = SS ;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ lin
|
|||||||
dep=[] ;
|
dep=[] ;
|
||||||
adv=\\a=>[] ;
|
adv=\\a=>[] ;
|
||||||
compl=case ap.preferShort of {
|
compl=case ap.preferShort of {
|
||||||
PrefFull => (\\a => ap.s ! agrGenNum a ! Inanimate ! Ins) ;
|
PreferFull => (\\a => ap.s ! agrGenNum a ! Inanimate ! Ins) ;
|
||||||
PrefShort => ap.short
|
PrefShort => ap.short
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
@@ -64,7 +64,7 @@ lin
|
|||||||
c=v3.c2
|
c=v3.c2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : V3 -> NP -> VPSlash ; -- give (it) to her
|
-- : V3 -> NP -> VPSlash ; -- give (it) to her
|
||||||
Slash3V3 v3 np = {
|
Slash3V3 v3 np = {
|
||||||
adv=\\a=>[] ;
|
adv=\\a=>[] ;
|
||||||
verb=v3 ;
|
verb=v3 ;
|
||||||
@@ -80,7 +80,7 @@ lin
|
|||||||
c=v2v.c
|
c=v2v.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : V2S -> S -> VPSlash ; -- answer (to him) that it is good
|
-- : V2S -> S -> VPSlash ; -- answer (to him) that it is good
|
||||||
SlashV2S v2s s = {
|
SlashV2S v2s s = {
|
||||||
adv=\\a=>[] ;
|
adv=\\a=>[] ;
|
||||||
verb=v2s ;
|
verb=v2s ;
|
||||||
@@ -103,7 +103,7 @@ lin
|
|||||||
verb=v2a ;
|
verb=v2a ;
|
||||||
dep=[] ;
|
dep=[] ;
|
||||||
compl=case ap.preferShort of {
|
compl=case ap.preferShort of {
|
||||||
PrefFull => (\\a => ap.s ! agrGenNum a ! Animate ! v2a.c.c) ; -- TODO: Acc depends on animacy!
|
PreferFull => (\\a => ap.s ! agrGenNum a ! Animate ! v2a.c.c) ; -- TODO: Acc depends on animacy!
|
||||||
PrefShort => ap.short
|
PrefShort => ap.short
|
||||||
} ;
|
} ;
|
||||||
c=v2a.c
|
c=v2a.c
|
||||||
@@ -130,7 +130,7 @@ lin
|
|||||||
|
|
||||||
-- : VPSlash -> VP ; -- love himself
|
-- : VPSlash -> VP ; -- love himself
|
||||||
ReflVP vps = vps ** {
|
ReflVP vps = vps ** {
|
||||||
compl=\\a => vps.compl ! a ++ vps.c.s ++ sebya.s ! vps.c.c -- TODO: use applyPronounPrep (search all ".c.s" also)
|
compl=\\a => vps.compl ! a ++ vps.c.s ++ sebya.s ! vps.c.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : Comp -> VP ; -- be warm
|
-- : Comp -> VP ; -- be warm
|
||||||
@@ -160,7 +160,7 @@ lin
|
|||||||
VPSlashPrep vp prep = vp ** {c=prep} ;
|
VPSlashPrep vp prep = vp ** {c=prep} ;
|
||||||
-- : AP -> Comp ; -- (be) small
|
-- : AP -> Comp ; -- (be) small
|
||||||
CompAP ap = case ap.preferShort of {
|
CompAP ap = case ap.preferShort of {
|
||||||
PrefFull => {s=\\a=>ap.s ! agrGenNum a ! Inanimate ! Ins ; adv=[] ; cop=InsCopula} ;
|
PreferFull => {s=\\a=>ap.s ! agrGenNum a ! Inanimate ! Ins ; adv=[] ; cop=InsCopula} ;
|
||||||
PrefShort => {s=ap.short ; adv=[] ; cop=EllCopula}
|
PrefShort => {s=ap.short ; adv=[] ; cop=EllCopula}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -542,7 +542,8 @@ oper
|
|||||||
immutableAdjectiveCases : Str -> AdjForms
|
immutableAdjectiveCases : Str -> AdjForms
|
||||||
= \s -> {
|
= \s -> {
|
||||||
msnom=s;fsnom=s;nsnom=s;pnom=s;msgen=s;fsgen=s;pgen=s;msdat=s;fsacc=s;msins=s;fsins=s;pins=s;msprep=s;sm=s;sf=s;sn=s;sp=s;comp=[];
|
msnom=s;fsnom=s;nsnom=s;pnom=s;msgen=s;fsgen=s;pgen=s;msdat=s;fsacc=s;msins=s;fsins=s;pins=s;msprep=s;sm=s;sf=s;sn=s;sp=s;comp=[];
|
||||||
preferShort=PrefFull
|
preferShort=PreferFull ;
|
||||||
|
p=False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
makeAdjective : Str -> ZAIndex -> ShortFormPreference -> AdjForms
|
makeAdjective : Str -> ZAIndex -> ShortFormPreference -> AdjForms
|
||||||
@@ -643,7 +644,8 @@ oper
|
|||||||
sn = sstem + aef.sn ;
|
sn = sstem + aef.sn ;
|
||||||
sp = sstem + aef.sp ;
|
sp = sstem + aef.sp ;
|
||||||
comp = comps + aef.comp ;
|
comp = comps + aef.comp ;
|
||||||
preferShort = aef.preferShort
|
preferShort = aef.preferShort ;
|
||||||
|
p = aef.p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
doAlternationsAdj : Str -> AdjForms -> DeclType -> AdjStressSchema -> ZCirc -> AdjForms
|
doAlternationsAdj : Str -> AdjForms -> DeclType -> AdjStressSchema -> ZCirc -> AdjForms
|
||||||
@@ -670,7 +672,8 @@ oper
|
|||||||
sn = sstem + aef.sn ;
|
sn = sstem + aef.sn ;
|
||||||
sp = sstem + aef.sp ;
|
sp = sstem + aef.sp ;
|
||||||
comp = comps + aef.comp ;
|
comp = comps + aef.comp ;
|
||||||
preferShort = aef.preferShort
|
preferShort = aef.preferShort ;
|
||||||
|
p = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
endingsSelectionAdj : DeclType -> AlterType -> AdjStressSchema -> ShortFormPreference -> AdjForms
|
endingsSelectionAdj : DeclType -> AlterType -> AdjStressSchema -> ShortFormPreference -> AdjForms
|
||||||
@@ -700,7 +703,8 @@ oper
|
|||||||
sn = stressSelectionAdj aef1.sn ss "sn" ;
|
sn = stressSelectionAdj aef1.sn ss "sn" ;
|
||||||
sp = stressSelectionAdj aef1.sp ss "sp" ;
|
sp = stressSelectionAdj aef1.sp ss "sp" ;
|
||||||
comp = stressSelectionAdj aef1.comp ss "comp" ;
|
comp = stressSelectionAdj aef1.comp ss "comp" ;
|
||||||
preferShort = sfp
|
preferShort = sfp ;
|
||||||
|
p = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
stressSelectionAdj : EndingSpec -> AdjStressSchema -> Str -> Str
|
stressSelectionAdj : EndingSpec -> AdjStressSchema -> Str -> Str
|
||||||
@@ -745,14 +749,21 @@ oper
|
|||||||
-----------
|
-----------
|
||||||
-- Pronouns
|
-- Pronouns
|
||||||
|
|
||||||
|
-- these are needed for numerals
|
||||||
|
pronounAdj1A : Str -> PronForms
|
||||||
|
= \word -> makeAdjective word (ZA 1 No A_ NoC) PreferFull ;
|
||||||
|
|
||||||
|
pronounAdj1B : Str -> PronForms
|
||||||
|
= \word -> makeAdjective word (ZA 1 No B_ NoC) PreferFull ;
|
||||||
|
|
||||||
|
pronounAdj1AstA : Str -> PronForms
|
||||||
|
= \word -> makeAdjective word (ZA 1 Ast A_ NoC) PreferFull ;
|
||||||
|
|
||||||
pronoun2AstB : Str -> PronForms
|
pronoun2AstB : Str -> PronForms
|
||||||
= \word -> -- весь
|
= \word -> -- весь
|
||||||
let cmp_base : Str = case word of {s + "ь" => s ; _ => word} in
|
let cmp_base : Str = case word of {s + "ь" => s ; _ => word} in --
|
||||||
let last = Predef.dp 1 cmp_base in
|
let last = Predef.dp 1 cmp_base in
|
||||||
let butLast = Predef.tk 1 cmp_base in
|
let butTwolast = Predef.tk 2 cmp_base in --
|
||||||
let secondLast = Predef.dp 1 butLast in
|
|
||||||
let butTwolast = Predef.tk 2 cmp_base in
|
|
||||||
let thirdLast = Predef.dp 1 butTwolast in
|
|
||||||
let stem = cmp_base in
|
let stem = cmp_base in
|
||||||
let stem2 = butTwolast + last in
|
let stem2 = butTwolast + last in
|
||||||
{
|
{
|
||||||
@@ -771,6 +782,29 @@ oper
|
|||||||
msprep=stem2 +"ем" ; --ём
|
msprep=stem2 +"ем" ; --ём
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
pronoun6AstA : Str -> PronForms
|
||||||
|
= \word -> -- третий
|
||||||
|
let cmp_base : Str = case word of {_ => word} in --
|
||||||
|
let butTwolast = Predef.tk 2 cmp_base in --
|
||||||
|
let stem = cmp_base in --
|
||||||
|
let stem2 = butTwolast + "ь" in --
|
||||||
|
{
|
||||||
|
msnom=stem ;
|
||||||
|
fsnom=stem2 +"я" ;
|
||||||
|
nsnom=stem2 +"е" ;
|
||||||
|
pnom=stem2 +"и" ;
|
||||||
|
msgen=stem2 +"его" ;
|
||||||
|
fsgen=stem2 +"ей" ;
|
||||||
|
pgen=stem2 +"их" ;
|
||||||
|
msdat=stem2 +"ему" ;
|
||||||
|
fsacc=stem2 +"ю" ;
|
||||||
|
msins=stem2 +"им" ;
|
||||||
|
fsins=stem2 +"ей" ;
|
||||||
|
pins=stem2 +"ими" ;
|
||||||
|
msprep=stem2 +"ем" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--------
|
--------
|
||||||
-- Verbs
|
-- Verbs
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -113,12 +113,66 @@ gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TFut ASimul) ? (PredVP (UsePron
|
|||||||
gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TFut ASimul) ? (PredVP (UsePron he_Pron) (AdvVP (PassV2 learn_V2) (weekdayNextAdv ?))))) NoVoc) TEmpty |l -treebank
|
gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TFut ASimul) ? (PredVP (UsePron he_Pron) (AdvVP (PassV2 learn_V2) (weekdayNextAdv ?))))) NoVoc) TEmpty |l -treebank
|
||||||
gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) ? (PredVP (UsePron he_Pron) (AdvVP (PassV2 learn_V2) (weekdayLastAdv ?))))) NoVoc) TEmpty |l -treebank
|
gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) ? (PredVP (UsePron he_Pron) (AdvVP (PassV2 learn_V2) (weekdayLastAdv ?))))) NoVoc) TEmpty |l -treebank
|
||||||
gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TFut AAnter) PPos (PredVP (UsePron ?) (AdvVP (PassV2 teach_V2) (yearAdv (intYear 2024)))))) NoVoc) TEmpty |l -treebank
|
gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TFut AAnter) PPos (PredVP (UsePron ?) (AdvVP (PassV2 teach_V2) (yearAdv (intYear 2024)))))) NoVoc) TEmpty |l -treebank
|
||||||
|
gt UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (UseN boy_N)) (AdvVP (UseV fly_V) (PrepCN on_Prep (UseN (CompoundN carpet_N airplane_N))))) |l -treebank
|
||||||
|
|
||||||
gt UseComp (CompAdv here_Adv) | l -treebank
|
gt UseComp (CompAdv here_Adv) | l -treebank
|
||||||
gt PredSCVP (EmbedVP (UseV think_V)) thirsty_VP | l -treebank
|
gt PredSCVP (EmbedVP (UseV think_V)) thirsty_VP | l -treebank
|
||||||
|
|
||||||
|
gt RelCl (PredVP (UsePN john_PN) (ComplSlashPartLast (SlashV2a love_V2) (UsePron she_Pron))) | l -treebank
|
||||||
|
gt UseRCl ? ? ( RelCl (PredVP (UsePN john_PN) (ComplSlashPartLast (SlashV2a love_V2) (UsePron she_Pron))) ) | l -treebank
|
||||||
|
gt RelNP (MassNP (UseN woman_N)) (UseRCl (TTAnt ? ASimul) ? (RelCl (PredVP (UsePN john_PN) (ComplSlashPartLast (SlashV2a love_V2) (UsePron she_Pron))))) | l -treebank
|
||||||
|
|
||||||
|
gt UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (Slash3V3 talk_V3 (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (SlashV2a read_V2))))))) (DetCN (DetQuant (PossPron i_Pron) NumPl) (UseN friend_N)))) | l -treebank
|
||||||
|
gt UseQCl (TTAnt TPres ASimul) PPos (QuestVP whatSg_IP (UseComp (CompNP (DetCN (DetQuant (PossPron youSg_Pron) NumSg) (UseN name_N))))) | l -treebank
|
||||||
|
gt UseQCl (TTAnt TPres ASimul) PPos (QuestIAdv how_IAdv (PredVP (UsePron youSg_Pron) (UseV fly_V))) | l -treebank
|
||||||
|
gt UseQCl (TTAnt ? ASimul) ? (QuestSlash whatSg_IP (SlashVP (UsePron she_Pron) (SlashV2a do_V2))) | l -treebank
|
||||||
|
gt UseQCl (TTAnt ? ASimul) PPos (QuestIComp (CompIAdv when_IAdv) (MassNP (UseN apple_N))) | l -treebank
|
||||||
|
gt UseQCl (TTAnt ? ASimul) PNeg (QuestIAdv when_IAdv (ImpersCl (AdvVP UseCopula (PrepNP part_Prep (MassNP (UseN apple_N)))))) | l -treebank
|
||||||
|
|
||||||
|
gt ImpVP (UseCopula) | l -treebank
|
||||||
|
gt CountNP many_Det (MassNP (UseN city_N)) | l -treebank
|
||||||
|
gt CountNP many_Det (UsePron they_Pron) | l -treebank
|
||||||
|
gt CountNP many_Det (UsePron we_Pron) | l -treebank
|
||||||
|
gt CountNP few_Det (MassNP (UseN city_N)) | l -treebank
|
||||||
|
gt UttAdV always_AdV | l -treebank
|
||||||
|
|
||||||
|
gt PrepNP above_Prep (MassNP (UseN (mouth_N))) | l -treebank
|
||||||
|
gt PrepNP above_Prep (MassNP (UseN (weekdayN tuesday_Weekday))) |l -treebank
|
||||||
|
|
||||||
|
gt (AdjOrd (OrdNumeral (num (pot2as3 (pot1as2 (pot1 ?)))))) |l -treebank
|
||||||
|
gt (AdjOrd (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 ?)))))) |l -treebank
|
||||||
|
gt OrdNumeral (num (pot3 (pot1as2 (pot0as1 (pot0 ?))))) | l -treebank
|
||||||
|
gt OrdNumeral (num (pot3 (pot1as2 pot110))) | l -treebank
|
||||||
|
gt OrdNumeral (num (pot3 (pot1as2 pot111))) | l -treebank
|
||||||
|
gt OrdNumeral (num (pot3 (pot1as2 (pot1to19 n2)))) | l -treebank
|
||||||
|
gt OrdNumeral (num (pot3 (pot1as2 (pot0as1 pot01)))) | l -treebank
|
||||||
|
gt OrdNumeral (num (pot3 (pot1as2 pot110))) | l -treebank
|
||||||
|
|
||||||
|
-- from extend
|
||||||
|
|
||||||
|
gt UseCl (TTAnt ? AAnter) ? (AdvIsNP everywhere_Adv (MassNP (UseN sky_N))) | l -treebank
|
||||||
|
gt UseCl (TTAnt ? AAnter) PPos (AdvIsNPAP everywhere_Adv (MassNP (UseN sky_N)) (PositA blue_A)) | l -treebank
|
||||||
|
gt UseCl ? PPos (ExistsNP (MassNP (UseN number_N))) | l -treebank
|
||||||
|
gt UseCl ? PPos (ExistNPAdv (MassNP (UseN house_N)) now_Adv ) | l -treebank
|
||||||
|
gt TFullStop (PhrUtt NoPConj (UttNP (MassNP (AdjCN (PositA full_A) (glass_of_CN (MassNP (UseN wine_N)))))) NoVoc) TEmpty | l -treebank
|
||||||
|
gt EmbedQS (UseQCl (TTAnt ? ASimul) ? (ExistIPAdv whatSg_IP now_Adv)) | l -treebank
|
||||||
|
|
||||||
|
gt UttCN (AdjCN (PositA red_A) (UseN house_N)) | l -treebank
|
||||||
|
gt UttCard (AdNum at_least_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n8))))))) | l -treebank
|
||||||
|
gt timeunitAdv (AdNum at_least_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 ?))))))) second_Timeunit | l -treebank
|
||||||
|
gt AdvS (timeunitAdv (AdNum at_least_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 ?))))))) second_Timeunit) (ExistS (TTAnt TFut ASimul) PPos (MassNP (cup_of_CN (MassNP (UseN water_N))))) | l -treebank
|
||||||
|
gt AdvS (timeunitAdv (AdNum at_most_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n9))))))) second_Timeunit) (ExistS (TTAnt TFut ASimul) PPos (MassNP (cup_of_CN (MassNP (UseN water_N))))) | l -treebank
|
||||||
|
gt AdvS (timeunitAdv (AdNum at_most_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) second_Timeunit) (ExistS (TTAnt TFut ASimul) PPos (MassNP (cup_of_CN (MassNP (UseN water_N))))) |l -treebank
|
||||||
|
gt AdvS (timeunitAdv (AdNum almost_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))))) second_Timeunit) (ExistS (TTAnt TFut ASimul) PPos (MassNP (cup_of_CN (MassNP (UseN water_N))))) | l -treebank
|
||||||
|
|
||||||
-- these below sound unnatural
|
-- these below sound unnatural
|
||||||
|
|
||||||
|
gt OrdNumeral (num (pot3 (pot1as2 (pot1plus n2 (pot0 ?))))) | l -treebank
|
||||||
|
|
||||||
|
|
||||||
|
-- here some participles are not formed correctly
|
||||||
|
gt AdjCN (PastPartAP ( SlashV2a ? ) ) (UseN house_N) | l -treebank
|
||||||
|
|
||||||
gt QuestCl ( PredSCVP (EmbedVP (UseV play_V)) thirsty_VP ) | l -treebank
|
gt QuestCl ( PredSCVP (EmbedVP (UseV play_V)) thirsty_VP ) | l -treebank
|
||||||
gt UseQCl ? ? ( QuestCl (PredSCVP (EmbedVP (UseV play_V)) thirsty_VP) ) | l -treebank
|
gt UseQCl ? ? ( QuestCl (PredSCVP (EmbedVP (UseV play_V)) thirsty_VP) ) | l -treebank
|
||||||
gt UseQCl (TTAnt TCond AAnter) ? (QuestCl (PredSCVP (EmbedVP (UseV play_V)) thirsty_VP)) | l -treebank
|
gt UseQCl (TTAnt TCond AAnter) ? (QuestCl (PredSCVP (EmbedVP (UseV play_V)) thirsty_VP)) | l -treebank
|
||||||
@@ -139,3 +193,8 @@ gt UseCl ? ? ( PredSCVP (EmbedVP (UseV play_V)) (UseComp (CompAP (PositA clean
|
|||||||
|
|
||||||
gt UseCl (TTAnt TPres ASimul) PPos (PredSCVP (EmbedVP (UseV play_V)) (UseComp (CompCN (AdjCN (PositA clean_A) (UseN war_N))))) | l -treebank
|
gt UseCl (TTAnt TPres ASimul) PPos (PredSCVP (EmbedVP (UseV play_V)) (UseComp (CompCN (AdjCN (PositA clean_A) (UseN war_N))))) | l -treebank
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- not implemented
|
||||||
|
|
||||||
|
gt AdjCN (AdjOrd (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3))))) )) (UseN apple_N) | l -treebank
|
||||||
@@ -7,11 +7,17 @@ With what should be correct approach, produces:
|
|||||||
> l DetCN (DetQuant (PossPron i_Pron) NumSg) (ConjCN and_Conj (ConsCN (UseN grammar_N) (BaseCN (UseN apple_N) (UseN flower_N))))
|
> l DetCN (DetQuant (PossPron i_Pron) NumSg) (ConjCN and_Conj (ConsCN (UseN grammar_N) (BaseCN (UseN apple_N) (UseN flower_N))))
|
||||||
мой грамматика , яблоко и цветок
|
мой грамматика , яблоко и цветок
|
||||||
|
|
||||||
|
> l ComplN2 mother_N2 ( DetCN (DetQuant (PossPron i_Pron) NumSg) (ConjCN and_Conj (ConsCN (UseN grammar_N) (BaseCN (UseN apple_N) (UseN flower_N)))) )
|
||||||
|
мать моего грамматики , яблока и цветка
|
||||||
|
|
||||||
Correct text requires AdvNP tricks. Resulting trees are quite artificial, one example:
|
Correct text requires AdvNP tricks. Resulting trees are quite artificial, one example:
|
||||||
|
|
||||||
> l ConjNP and_Conj (ConsNP (AdvNP (DetNP (DetQuant (PossPron i_Pron) NumPl)) (PrepNP obj_no_Prep (DetCN (DetQuant DefArt NumSg) (UseN grammar_N)))) (BaseNP (MassNP (UseN apple_N)) (MassNP (UseN flower_N))))
|
> l ConjNP and_Conj (ConsNP (AdvNP (DetNP (DetQuant (PossPron i_Pron) NumPl)) (PrepNP obj_no_Prep (DetCN (DetQuant DefArt NumSg) (UseN grammar_N)))) (BaseNP (MassNP (UseN apple_N)) (MassNP (UseN flower_N))))
|
||||||
мои грамматика , яблоко и цветок
|
мои грамматика , яблоко и цветок
|
||||||
|
|
||||||
|
> l ComplN2 mother_N2 ( ConjNP and_Conj (ConsNP (AdvNP (DetNP (DetQuant (PossPron i_Pron) NumPl)) (PrepNP obj_no_Prep (DetCN (DetQuant DefArt NumSg) (UseN grammar_N)))) (BaseNP (MassNP (UseN apple_N)) (MassNP (UseN flower_N)))) )
|
||||||
|
мать моих грамматика , яблока и цветка
|
||||||
|
|
||||||
Proper resolution? It's hard to go through Dets and Quants (and will make them more complex). Probably, correct solution would be to make the same as if possessive pronoun is an adjective:
|
Proper resolution? It's hard to go through Dets and Quants (and will make them more complex). Probably, correct solution would be to make the same as if possessive pronoun is an adjective:
|
||||||
|
|
||||||
> l MassNP (AdjCN (PositA red_A) (ConjCN and_Conj (ConsCN (UseN grammar_N) (BaseCN (UseN apple_N) (UseN flower_N)))))
|
> l MassNP (AdjCN (PositA red_A) (ConjCN and_Conj (ConsCN (UseN grammar_N) (BaseCN (UseN apple_N) (UseN flower_N)))))
|
||||||
@@ -53,3 +59,43 @@ AllRus: сколько является яблок у Ивана ?
|
|||||||
AllRusAbs: UseCl (TTAnt TPres ASimul) PNeg (ExistsNP (MassNP (UseN number_N)))
|
AllRusAbs: UseCl (TTAnt TPres ASimul) PNeg (ExistsNP (MassNP (UseN number_N)))
|
||||||
AllRus: не существует число
|
AllRus: не существует число
|
||||||
Should be: не существует числа
|
Should be: не существует числа
|
||||||
|
|
||||||
|
## Copula negation is not that simple
|
||||||
|
|
||||||
|
AllRusAbs: ComplVS hope_VS (UseCl (TTAnt TPres AAnter) PNeg (have_name_Cl (UsePron he_Pron) (UsePN john_PN)))
|
||||||
|
AllRus: надеяться , что нет его имя Иван
|
||||||
|
|
||||||
|
AllRusAbs: UseCl (TTAnt TPres AAnter) PNeg (have_name_Cl (UsePron he_Pron) (UsePN john_PN))
|
||||||
|
AllRus: нет его имя Иван
|
||||||
|
|
||||||
|
AllRusAbs: UseCl (TTAnt TPres AAnter) PNeg (AdvIsNP everywhere_Adv (MassNP (UseN sky_N)))
|
||||||
|
AllRus: небо нет везде
|
||||||
|
(must be: небо не везде есть)
|
||||||
|
|
||||||
|
|
||||||
|
## Some past participles are not correct
|
||||||
|
|
||||||
|
> gt AdjCN (PastPartAP ( SlashV2a ? ) ) (UseN house_N) | l -treebank
|
||||||
|
AllRusAbs: AdjCN (PastPartAP (SlashV2a break_V2)) (UseN house_N)
|
||||||
|
AllRus: прерыван дом - прерываем
|
||||||
|
AllRusAbs: AdjCN (PastPartAP (SlashV2a buy_V2)) (UseN house_N)
|
||||||
|
AllRus: покупан дом - покупаем
|
||||||
|
AllRusAbs: AdjCN (PastPartAP (SlashV2a close_V2)) (UseN house_N)
|
||||||
|
AllRus: закрыван дом - закрываем
|
||||||
|
AllRusAbs: AdjCN (PastPartAP (SlashV2a find_V2)) (UseN house_N)
|
||||||
|
AllRus: нахожен дом - находим(ый)
|
||||||
|
AllRusAbs: AdjCN (PastPartAP (SlashV2a love_V2)) (UseN house_N)
|
||||||
|
AllRus: люблен дом -- любим(ый)
|
||||||
|
AllRusAbs: AdjCN (PastPartAP (SlashV2a seek_V2)) (UseN house_N)
|
||||||
|
AllRus: искан дом -- исканный
|
||||||
|
|
||||||
|
|
||||||
|
## Ordinals
|
||||||
|
|
||||||
|
OrdNumeral (num (pot3 (pot2plus pot01 pot111)))
|
||||||
|
should be: стоодиннадцатитысячное
|
||||||
|
|
||||||
|
> l OrdNumeral (num (pot3 (pot2 pot01)))
|
||||||
|
ста &+ тысячное
|
||||||
|
should be: стотысячное
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user