1
0
forked from GitHub/gf-rgl

More to constructors, using maybe now; fixes to RCl

This commit is contained in:
Roman Suzi
2020-07-31 18:44:25 +03:00
parent f22f5d4abf
commit f9437f01a9
13 changed files with 74 additions and 28 deletions

View File

@@ -41,8 +41,8 @@ lin
-- : A2 -> AP ; -- married to itself - замужем за собой
ReflA2 a2 = let af=adjFormsAdjective a2 in {
s = \\gn,anim,cas => af.s ! gn ! anim ! cas ++ a2.c.s ++ sam.s ! (a2.c.c) ;
short = \\a=>af.short ! a ++ a2.c.s ++ sam.s ! (a2.c.c) ;
s = \\gn,anim,cas => af.s ! gn ! anim ! cas ++ a2.c.s ++ sebya.s ! (a2.c.c) ;
short = \\a=>af.short ! a ++ a2.c.s ++ sebya.s ! (a2.c.c) ;
isPost = False ;
preferShort = a2.preferShort
} ;

View File

@@ -89,7 +89,7 @@ lincat
compl,adv : AgrTable ;
verb : VerbForms ;
dep : Str ; -- dependent infinitives and such
a : Agr
a : MaybeAgr
} ;
Prep = ResRus.ComplementCase ;

View File

@@ -1,6 +1,8 @@
concrete ConstructionRus of Construction = CatRus **
open Predef, SyntaxRus, SymbolicRus, (P=ParadigmsRus), ResRus, Prelude,
QuestionRus, SentenceRus, AdverbRus, AdjectiveRus, VerbRus, (N=NounRus), IdiomRus, (E=ExtendRus), (EX=ExtraRus) in {
QuestionRus, SentenceRus, AdverbRus, AdjectiveRus, VerbRus,
(L=LexiconRus),
(N=NounRus), IdiomRus, (E=ExtendRus), (EX=ExtraRus) in {
lin
hungry_VP = mkVP (P.mkA "голодный" "" "1*a/c'" PrefShort) ;
@@ -8,11 +10,21 @@ lin
tired_VP = mkVP (P.mkA "усталый" "" "1*a/c'" PrefFull) ;
scared_VP = mkVP (P.mkV Imperfective "бояться" "боюсь" "боится") ; -- intran
ill_VP = mkVP ( P.mkA "больной" "" "1*b" PrefShort) ;
ready_VP = mkVP (P.mkA "готовый" "" "1a" PrefFull) ;
ready_VP = mkVP L.ready_A ;
-- : NP -> QCl ; -- what is x's name / wie heisst x (Ger)
what_name_QCl np = E.PredIAdvVP how_IAdv (ComplSlash (SlashV2a (P.mkV2 (P.mkV Imperfective "звать" "зову" "зовёт") Acc)) np) ;
-- : NP -> NP -> Cl ; -- x's name is y / x s'appelle y (Fre)
have_name_Cl np np1 = {
subj=[];
adv=np.s ! Acc ++ L.name_N.snom;
verb=copulaEll ; -- ???
dep=[] ;
compl=np1.s ! Nom ;
a=Ag (GSg L.name_N.g) P3 ;
} ;
-- languages
lincat
Language = N ;
@@ -33,10 +45,11 @@ oper
lin
-- : Card -> Timeunit -> Adv ; -- (for) three hours
timeunitAdv card time = P.mkAdv ((cardCN card time).s ! Nom) ;
timeunitAdv card time = P.mkAdv ((cardCN (lin Card card) time).s ! Nom) ;
-- : Card -> Card -> Timeunit -> Adv ; -- (cats live) ten to twenty years
timeunitRange l u time = P.mkAdv (applyPrep from_Prep (cardCN l (ellNoun time)) ++ applyPrep EX.on_to_Prep (cardCN u time)) ;
timeunitRange l u time = P.mkAdv (applyPrep from_Prep (cardCN (lin Card l) (lin N (ellNoun time)))
++ applyPrep EX.on_to_Prep (cardCN (lin Card u) time)) ;
oneHour = mkHour "1" ;
twoHour = mkHour "2" ;
@@ -141,10 +154,10 @@ lin
second_Timeunit = P.mkN "секунда" ;
minute_Timeunit = P.mkN "минута" ;
hour_Timeunit = P.mkN "час" Masc Inanimate "1c" ;
day_Timeunit = P.mkN "день" Masc Inanimate "2*b" ;
day_Timeunit = L.day_N ;
week_Timeunit = P.mkN "неделя" Fem Inanimate "2a" ;
month_Timeunit = P.mkN "месяц" Masc Inanimate "5a" ;
year_Timeunit = lin N ((mkNplus (P.mkN "год")) ** {sloc="году"; pgen="лет"}) ;
year_Timeunit = L.year_N ;
monday_Weekday = P.mkN "понедельник" Masc Inanimate ;
tuesday_Weekday = P.mkN "вторник" Masc Inanimate ;

View File

@@ -2,8 +2,10 @@
concrete ExtendRus of Extend =
CatRus ** ExtendFunctor - [
iFem_Pron,
theyFem_Pron, weFem_Pron, youFem_Pron, youPlFem_Pron, youPolFem_Pron, youPolPlFem_Pron, youPolPl_Pron,
-- iFem_Pron,
theyFem_Pron, weFem_Pron,
-- youFem_Pron,
youPlFem_Pron, youPolFem_Pron, youPolPlFem_Pron, youPolPl_Pron,
VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList,
UseComp, RelNP, UseComp_estar, SubjRelNP, PredAPVP, ImpersCl, UseComp, CompAP, EmbedVP, ExistNP, UseQCl,
QuestCl, ExistNP, UseQCl, ExistIP, AdvVP, AdvVP, AdvVP, UseComp, CompAP, ExistS, ExistNPQS, ExistIPQS,
@@ -40,4 +42,7 @@ lin
-- : IAdv -> VP -> QCl ; -- how to walk?
PredIAdvVP iadv vp = QuestIAdv iadv (GenericCl vp) ; -- DEFAULT how does one walk
iFem_Pron = personalPron (Ag (GSg Fem) P1) ;
youFem_Pron = personalPron (Ag (GSg Fem) P2) ;
} ;

View File

@@ -62,7 +62,13 @@ lin
s = p1 ++ pol.s ++ vp.adv ! a ++ np.s ! Nom ++ parts.p2 ++ vp.dep ++ vp.compl ! a
} ;
-- TODO: SelfAdvVP : VP -> VP ; -- is at home himself
-- TODO: SelfAdVVP : VP -> VP ; -- is himself at home
-- TODO: SelfNP : NP -> NP ; -- the president himself (is at home)
-- : VP -> VP ; -- is at home himself
SelfAdvVP vp = vp ** {compl=\\a => vp.compl ! a ++ (adjFormsAdjective sam).s ! agrGenNum a ! Animate ! Nom} ;
-- : VP -> VP ; -- is himself at home
SelfAdVVP vp = vp ** {adv=\\a => (adjFormsAdjective sam).s ! agrGenNum a ! Animate ! Nom ++ vp.adv ! a} ;
-- : NP -> NP ; -- the president himself (is at home)
SelfNP np = np ** {
s=\\cas => ((adjFormsAdjective sam).s ! agrGenNum np.a ! Animate ! cas ) ++ np.s ! cas
} ;
}

View File

@@ -52,8 +52,8 @@ lin
camera_N = mkN "фотоаппарат" ;
cap_N = mkN "чашка" ;
car_N = mkN "машина" ;
carpet_N = mkN "ковёр" masculine inanimate "1b" ;
cat_N = mkN "кошка" feminine animate "1*a" ;
carpet_N = mkN "ковёр" masculine inanimate "1*b" ;
cat_N = mkN "кошка" feminine animate "3*a" ;
ceiling_N = mkN "потолок" masculine inanimate "3*b";
chair_N = (mkNplus (mkN "стул" masculine inanimate "1a")) ** {pnom="стулья";pgen="стульев";pdat="стульям";pacc="стулья";pins="стульями";pprep="стульях"} ;
cheese_N = mkN "сыр" ;
@@ -80,7 +80,7 @@ lin
dirty_A = mkA "грязный" ;
distance_N3 = mkN3 (mkN "расстояние") from_Prep on_to_Prep ;
do_V2 = mkV2 (mkV imperfective "делать" "делаю");
doctor_N = mkN "доктор" masculine animate ;
doctor_N = mkN "доктор" masculine animate "1c(1)" ;
dog_N = mkN "собака" feminine animate ;
door_N = mkN "дверь" ;
drink_V2 = mkV2 (mkV imperfective "пить" "пью" "пьёт");
@@ -111,7 +111,7 @@ lin
float_V = mkV imperfective intransitive "плавать" "плаваю";
floor_N = mkN "пол" ;
flow_V = mkV imperfective intransitive "течь" "теку" "течёт";
flower_N = mkN "цветок";
flower_N = mkN "цветок" masculine inanimate "3*b";
fly_V = mkV imperfective intransitive "летать" "летаю" ;
fog_N = mkN "туман" ;
foot_N = mkN "ступня" feminine inanimate "2*b" ;
@@ -151,7 +151,7 @@ lin
horse_N = mkN "лошадь" feminine animate "8e" ;
hot_A = mkA "горячий" "" "4a/b";
house_N = mkN "дом" masculine inanimate "1c(1)" ;
hunt_V2 = mkV2 (mkV imperfective intransitive "охотиться" "охочусь" "охотится") {s="на" ; c=Acc ; hasPrep=True};
hunt_V2 = mkV2 (mkV imperfective intransitive "охотиться" "охочусь" "охотится") (lin Prep {s="на" ; c=Acc ; hasPrep=True}) ;
husband_N = (mkNplus (mkN "муж" masculine animate "4c")) ** {pnom="мужья";pgen="мужей";pdat="мужьям";pacc="мужей";pins="мужьями";pprep="мужьях"};
ice_N = (mkNplus (mkN "лёд" masculine animate "1b")) ** {sloc="льду";sptv="льду"} ;
important_A = mkA "важный" ;

View File

@@ -231,7 +231,7 @@ oper
FirstE => (Z.sg1StemFromVerb sg1) + "ёт" ;
Second | SecondA => (Z.sg1StemFromVerb sg1) + "ит" ;
_ => (Z.sg1StemFromVerb sg1) + "ет"
} in (guessVerbForms asp Transitive inf sg1 sg3);
} in (guessVerbForms asp Transitive inf sg1 sg3) ** {lock_V=<>} ;
------------------------
-- Adverbs, prepositions, conjunctions, ...

View File

@@ -1,4 +1,4 @@
resource ParamRus = ParamX, CommonX [Temp] ** open Prelude in {
resource ParamRus = ParamX, CommonX [Temp] ** open Prelude, Maybe in {
-- Mostly follows https://en.wikipedia.org/wiki/List_of_glossing_abbreviations
-- see theory.txt
@@ -33,6 +33,7 @@ param
SpecialFuture = NormalFuture | BeFuture | CanFuture | WantFuture | NullFuture ;
DetType = NormalDet | EmptyDef | EmptyIndef ; -- artificial parameter to side-step DetNP parsing issues
oper
MaybeAgr = Maybe Agr ;
-- GenNum helpers and coercions
MSg = GSg Masc ;
FSg = GSg Fem ;

View File

@@ -2,6 +2,7 @@ concrete RelativeRus of Relative = CatRus ** open
ParadigmsRus,
ResRus,
MorphoRus,
Maybe,
Prelude, Coordination in {
lin
@@ -12,7 +13,7 @@ lin
verb=cl.verb ;
dep=cl.dep ;
compl=\\a=>cl.compl ;
a=cl.a
a=Just Agr cl.a
} ;
-- : RP -> ClSlash -> RCl ; -- whom John loves
RelSlash rp cls = {
@@ -21,7 +22,7 @@ lin
verb=cls.verb ;
dep=cls.dep ;
compl=\\a=> cls.compl ;
a=cls.a
a=Just Agr cls.a
} ;
-- : RP -> VP -> RCl ; -- who loves John
@@ -31,7 +32,7 @@ lin
verb=vp.verb ;
dep=vp.dep ;
compl=vp.compl ;
a=rp.a
a=Nothing Agr (Ag (GSg Neut) P3)
} ;
-- : RP ; -- which

View File

@@ -967,7 +967,20 @@ oper
Ag GPl _ => doReflexivePron "сами" a
};
sam = pronFormsPronoun (reflexivePron (Ag (GSg Masc) P3)) ;
sebya = pronFormsPronoun (reflexivePron (Ag (GSg Masc) P3)) ;
sam = (guessAdjectiveForms "самый") ** {
fsnom="сама" ;
msnom="сам" ;
nsnom="само" ;
fsacc="саму" ;
fsins=variants {"самой"; "самою"} ;
msins="самим";
nsins="самим";
pgen="самих" ;
pnom="сами" ;
pins="самими" ;
sp="сами"
} ;
all_Pron = pronoun2AstB "весь" ;
only_Pron = guessAdjectiveForms "единственный" ;

View File

@@ -1,4 +1,4 @@
concrete SentenceRus of Sentence = CatRus ** open Prelude, TenseRus, ParamRus, Coordination, (R=ResRus) in {
concrete SentenceRus of Sentence = CatRus ** open Prelude, TenseRus, ParamRus, Coordination, Maybe, (R=ResRus) in {
flags optimize=all_subs ; coding=utf8 ;
lin
-- : Adv -> S -> S ; -- then I will go home
@@ -24,7 +24,8 @@ lin
-- : Temp -> Pol -> RCl -> RS ; -- that had not slept
UseRCl temp pol rcl = {
s = \\gn,anim,cas =>
let parts = R.verbAgr rcl.verb Ind temp.t (genNumAgrP3 gn) pol.p 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 ++ parts.p1 ++ rcl.subj ! gn ! anim ! Nom ++ rcl.adv ! (genNumAgrP3 gn) ++ pol.s ++ parts.p2 ++ rcl.dep ++ rcl.compl ! (genNumAgrP3 gn)
} ;

View File

@@ -130,7 +130,7 @@ lin
-- : VPSlash -> VP ; -- love himself
ReflVP vps = vps ** {
compl=\\a => vps.compl ! a ++ vps.c.s ++ sam.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 -- TODO: use applyPronounPrep (search all ".c.s" also)
} ;
-- : Comp -> VP ; -- be warm

View File

@@ -29,3 +29,9 @@ AllRusAbs> l UseCl (TTAnt TPres ASimul) PPos (ImpersCl (ReflVP (SlashV2A paint_V
AllRusAbs> p "рисуешь горячий себя"
UseCl (TTAnt TPres ASimul) PPos (GenericCl (ReflVP (SlashV2A paint_V2A (PositA hot_A))))
AllRusAbs: UseCl (TTAnt TPres AAnter) PPos (CleftNP (UsePron youSg_Pron) (UseRCl (TTAnt TPast AAnter) PPos (RelVP IdRP ready_VP)))
AllRus: это ты , который бы &+ ло готовым
-> ?
AllRus: это ты , который был готовым