unbounded dep in resource with SlashVS

This commit is contained in:
aarne
2007-11-03 20:41:29 +00:00
parent 6f0009b11b
commit 7003654ca6
18 changed files with 452 additions and 347 deletions
+1
View File
@@ -32,6 +32,7 @@ abstract Cat = Common ** {
RS ; -- relative e.g. "in which she lived" RS ; -- relative e.g. "in which she lived"
Cl ; -- declarative clause, with all tenses e.g. "she looks at this" Cl ; -- declarative clause, with all tenses e.g. "she looks at this"
Slash ; -- clause missing NP (S/NP in GPSG) e.g. "she looks at" Slash ; -- clause missing NP (S/NP in GPSG) e.g. "she looks at"
SlashS ;-- sentence missing NP e.g. "she has looked at"
Imp ; -- imperative e.g. "look at this" Imp ; -- imperative e.g. "look at this"
--2 Questions and interrogatives --2 Questions and interrogatives
+3
View File
@@ -33,6 +33,8 @@ abstract Sentence = Cat ** {
AdvSlash : Slash -> Adv -> Slash ; -- (whom) he sees tomorrow AdvSlash : Slash -> Adv -> Slash ; -- (whom) he sees tomorrow
SlashPrep : Cl -> Prep -> Slash ; -- (with whom) he walks SlashPrep : Cl -> Prep -> Slash ; -- (with whom) he walks
SlashVS : NP -> VS -> SlashS -> Slash ; -- (whom) he says that she loves
--2 Imperatives --2 Imperatives
-- An imperative is straightforwardly formed from a verb phrase. -- An imperative is straightforwardly formed from a verb phrase.
@@ -60,6 +62,7 @@ abstract Sentence = Cat ** {
UseCl : Tense -> Ant -> Pol -> Cl -> S ; UseCl : Tense -> Ant -> Pol -> Cl -> S ;
UseQCl : Tense -> Ant -> Pol -> QCl -> QS ; UseQCl : Tense -> Ant -> Pol -> QCl -> QS ;
UseRCl : Tense -> Ant -> Pol -> RCl -> RS ; UseRCl : Tense -> Ant -> Pol -> RCl -> RS ;
UseSlash : Tense -> Ant -> Pol -> Slash -> SlashS ;
-- An adverb can be added to the beginning of a sentence. -- An adverb can be added to the beginning of a sentence.
+2 -2
View File
@@ -66,11 +66,11 @@ oper
let let
paccp = case acc of { paccp = case acc of {
CRefl => <reflPron n p Acc, p,True> ; CRefl => <reflPron n p Acc, p,True> ;
CPron a => <argPron a.g a.n a.p Acc, a.p,True> ; CPron ag an ap => <argPron ag an ap Acc, ap,True> ;
_ => <[],P2,False> _ => <[],P2,False>
} ; } ;
pdatp = case dat of { pdatp = case dat of {
CPron a => <argPron a.g a.n a.p dative, a.p,True> ; CPron ag an ap => <argPron ag an ap dative, ap,True> ;
_ => <[],P2,False> _ => <[],P2,False>
} }
in case <paccp.p2, pdatp.p2> of { in case <paccp.p2, pdatp.p2> of {
+4 -4
View File
@@ -27,7 +27,7 @@ lin
-- can_VV = mkVV (verbV (poder_58 "poder")) ; -- can_VV = mkVV (verbV (poder_58 "poder")) ;
during_Prep = mkPreposition "durant" ; ---- during_Prep = mkPreposition "durant" ; ----
either7or_DConj = {s1,s2 = "o" ; n = Sg} ; either7or_DConj = {s1,s2 = "o" ; n = Sg} ;
everybody_NP = mkNP ["tothom"] Masc Sg ; everybody_NP = makeNP ["tothom"] Masc Sg ;
every_Det = {s = \\_,_ => "cada" ; n = Sg} ; every_Det = {s = \\_,_ => "cada" ; n = Sg} ;
everything_NP = pn2np (mkPN ["tot"] Masc) ; everything_NP = pn2np (mkPN ["tot"] Masc) ;
everywhere_Adv = ss ["a tot arreu"] ; everywhere_Adv = ss ["a tot arreu"] ;
@@ -91,12 +91,12 @@ lin
Pl => \\g,c => prepCase c ++ genForms "aquells" "aquelles" ! g Pl => \\g,c => prepCase c ++ genForms "aquells" "aquelles" ! g
} }
} ; } ;
that_NP = mkNP ["alló"] Masc Sg ; that_NP = makeNP ["alló"] Masc Sg ;
there_Adv = mkAdv "allà" ; -- allá there_Adv = mkAdv "allà" ; -- allá
there7to_Adv = mkAdv ["cap a allà"] ; there7to_Adv = mkAdv ["cap a allà"] ;
there7from_Adv = mkAdv ["d'allà"] ; there7from_Adv = mkAdv ["d'allà"] ;
therefore_PConj = ss ["per tant"] ; therefore_PConj = ss ["per tant"] ;
these_NP = mkNP ["aquestes"] Fem Pl ; these_NP = makeNP ["aquestes"] Fem Pl ;
they_Pron = mkPronoun they_Pron = mkPronoun
"elles" "les" "les" "elles" "elles" "les" "les" "elles"
["el seu"] ["la seva"] ["llurs"] ["llurs"] ["el seu"] ["la seva"] ["llurs"] ["llurs"]
@@ -108,7 +108,7 @@ lin
} }
} ; } ;
this_NP = pn2np (mkPN ["això"] Masc) ; this_NP = pn2np (mkPN ["això"] Masc) ;
those_NP = mkNP ["aquelles"] Fem Pl ; those_NP = makeNP ["aquelles"] Fem Pl ;
through_Prep = mkPreposition "mitjançant" ; through_Prep = mkPreposition "mitjançant" ;
too_AdA = ss "massa" ; too_AdA = ss "massa" ;
to_Prep = complDat ; to_Prep = complDat ;
+1
View File
@@ -9,6 +9,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
S = {s : Str} ; S = {s : Str} ;
QS = {s : QForm => Str} ; QS = {s : QForm => Str} ;
RS = {s : Agr => Str ; c : Case} ; -- c for it clefts RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
SlashS = {s : Str ; c2 : Str} ;
-- Sentence -- Sentence
+17 -4
View File
@@ -37,16 +37,29 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
SlashPrep cl prep = cl ** {c2 = prep.s} ; SlashPrep cl prep = cl ** {c2 = prep.s} ;
SlashVS np vs slash =
mkClause (np.s ! Nom) np.a
(insertObj (\\_ => conjThat ++ slash.s) (predV vs)) **
{c2 = slash.c2} ;
EmbedS s = {s = conjThat ++ s.s} ; EmbedS s = {s = conjThat ++ s.s} ;
EmbedQS qs = {s = qs.s ! QIndir} ; EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr
UseCl t a p cl = {s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! ODir} ; UseCl t a p cl = {
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! q} ; s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! ODir
} ;
UseQCl t a p cl = {
s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! q
} ;
UseRCl t a p cl = { UseRCl t a p cl = {
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! r ; s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! r ;
c = cl.c c = cl.c
} ; } ;
UseSlash t a p cl = {
s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! ODir ;
c2 = cl.c2
} ;
AdvS a s = {s = a.s ++ "," ++ s.s} ; AdvS a s = {s = a.s ++ "," ++ s.s} ;
@@ -61,4 +74,4 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
mkClause (np.s ! Nom) np.a mkClause (np.s ! Nom) np.a
(insertObj (\\_ => conjThat ++ s.s) (predV vs)) ** (insertObj (\\_ => conjThat ++ s.s) (predV vs)) **
{c2 = s.c2} ; {c2 = s.c2} ;
-} -}
+1
View File
@@ -9,6 +9,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
S = {s : Str} ; S = {s : Str} ;
QS = {s : Str} ; QS = {s : Str} ;
RS = {s : Agr => Str ; c : NPForm} ; RS = {s : Agr => Str ; c : NPForm} ;
SlashS = {s : Str ; c2 : Compl} ;
-- Sentence -- Sentence
+15 -1
View File
@@ -53,6 +53,16 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin in {
c2 = prep c2 = prep
} ; } ;
SlashVS np vs slash = {
s = \\t,a,p =>
(mkClause (subjForm np vs.sc) np.a
(insertExtrapos ("että" ++ slash.s)
(predV vs))
).s ! t ! a ! p ! SDecl ;
c2 = slash.c2
} ;
EmbedS s = {s = "että" ++ s.s} ; EmbedS s = {s = "että" ++ s.s} ;
EmbedQS qs = {s = qs.s} ; EmbedQS qs = {s = qs.s} ;
EmbedVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp} ; --- case,pol,agr EmbedVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp} ; --- case,pol,agr
@@ -63,7 +73,11 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin in {
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ; s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ;
c = cl.c c = cl.c
} ; } ;
UseSlash t a p cl = {
s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ;
c2 = cl.c2
} ;
AdvS a s = {s = a.s ++ "," ++ s.s} ; AdvS a s = {s = a.s ++ s.s} ;
} }
+1
View File
@@ -11,6 +11,7 @@ concrete CatGer of Cat =
S = {s : Order => Str} ; S = {s : Order => Str} ;
QS = {s : QForm => Str} ; QS = {s : QForm => Str} ;
RS = {s : GenNum => Str ; c : Case} ; RS = {s : GenNum => Str ; c : Case} ;
SlashS = {s : Order => Str} ** {c2 : Preposition} ;
-- Sentence -- Sentence
+11 -2
View File
@@ -39,11 +39,16 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
SlashPrep cl prep = cl ** {c2 = prep} ; SlashPrep cl prep = cl ** {c2 = prep} ;
SlashVS np vs slash =
mkClause (np.s ! Nom) np.a
(insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)) **
{c2 = slash.c2} ;
EmbedS s = {s = conjThat ++ s.s ! Sub} ; EmbedS s = {s = conjThat ++ s.s ! Sub} ;
EmbedQS qs = {s = qs.s ! QIndir} ; EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = useInfVP False vp} ; EmbedVP vp = {s = useInfVP False vp} ;
UseCl t a p cl = { UseCl t a p cl = {
s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.m ! t.t ! a.a ! p.p ! o s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.m ! t.t ! a.a ! p.p ! o
} ; } ;
UseQCl t a p cl = { UseQCl t a p cl = {
@@ -53,7 +58,11 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.m ! t.t ! a.a ! p.p ! r ; s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.m ! t.t ! a.a ! p.p ! r ;
c = cl.c c = cl.c
} ; } ;
UseSlash t a p cl = {
s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.m ! t.t ! a.a ! p.p ! o ;
c2 = cl.c2
} ;
AdvS a s = {s = \\o => a.s ++ "," ++ s.s ! o} ; AdvS a s = {s = \\o => a.s ++ s.s ! Inv} ;
} }
+5
View File
@@ -11,6 +11,11 @@ incomplete concrete CatRomance of Cat =
S = {s : Mood => Str} ; S = {s : Mood => Str} ;
QS = {s : QForm => Str} ; QS = {s : QForm => Str} ;
RS = {s : Mood => Agr => Str ; c : Case} ; RS = {s : Mood => Agr => Str ; c : Case} ;
SlashS = {
s : AAgr => Mood => Str ;
c2 : Compl
} ;
-- Sentence -- Sentence
+2 -1
View File
@@ -9,7 +9,8 @@ incomplete concrete NounRomance of Noun =
g = cn.g ; g = cn.g ;
n = det.n n = det.n
in { in {
s = \\c => det.s ! g ! npform2case c ++ cn.s ! n ; s = \\c => let cs = npform2case c in
prepCase cs ++ det.s ! g ! cs ++ cn.s ! n ;
a = agrP3 g n ; a = agrP3 g n ;
hasClit = False hasClit = False
} ; } ;
+21 -2
View File
@@ -43,16 +43,35 @@ incomplete concrete SentenceRomance of Sentence =
c2 = {s = prep.s ; c = prep.c ; isDir = False} c2 = {s = prep.s ; c = prep.c ; isDir = False}
} ; } ;
SlashVS np vs slash =
{s = \\d,ag =>
(mkClause
(np.s ! Aton Nom) np.hasClit np.a
(insertExtrapos (\\b => conjThat ++ slash.s ! ag ! (vs.m ! b)) --- ag?
(predV vs))
).s ! d ;
c2 = slash.c2
} ;
EmbedS s = {s = conjThat ++ s.s ! Indic} ; --- mood EmbedS s = {s = conjThat ++ s.s ! Indic} ; --- mood
EmbedQS qs = {s = qs.s ! QIndir} ; EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = infVP vp (agrP3 Masc Sg)} ; --- agr ---- compl EmbedVP vp = {s = infVP vp (agrP3 Masc Sg)} ; --- agr ---- compl
UseCl t a p cl = {s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! DDir ! t.t ! a.a ! p.p ! o} ; UseCl t a p cl = {
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ; s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! DDir ! t.t ! a.a ! p.p ! o
} ;
UseQCl t a p cl = {
s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q
} ;
UseRCl t a p cl = { UseRCl t a p cl = {
s = \\r,ag => t.s ++ a.s ++ p.s ++ cl.s ! ag ! t.t ! a.a ! p.p ! r ; s = \\r,ag => t.s ++ a.s ++ p.s ++ cl.s ! ag ! t.t ! a.a ! p.p ! r ;
c = cl.c c = cl.c
} ; } ;
UseSlash t a p cl = {
s = \\agr,mo =>
t.s ++ a.s ++ p.s ++ cl.s ! DDir ! agr ! t.t ! a.a ! p.p ! mo ;
c2 = cl.c2
} ;
AdvS a s = {s = \\o => a.s ++ "," ++ s.s ! o} ; AdvS a s = {s = \\o => a.s ++ "," ++ s.s ! o} ;
+1
View File
@@ -11,6 +11,7 @@ concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
S = {s : Str} ; S = {s : Str} ;
QS = {s : QForm => Str} ; QS = {s : QForm => Str} ;
RS = {s : GenNum => Case => Animacy => Str} ; RS = {s : GenNum => Case => Animacy => Str} ;
SlashS = {s : Str; s2: Str ; c: Case} ;
-- Sentence -- Sentence
-- clause (variable tense) e.g. "John walks"/"John walked" -- clause (variable tense) e.g. "John walks"/"John walked"
+105 -84
View File
@@ -1,90 +1,111 @@
--# -path=.:../abstract:../common:../../prelude --# -path=.:../abstract:../common:../../prelude
concrete SentenceRus of Sentence = CatRus ** open Prelude, ResRus in { concrete SentenceRus of Sentence = CatRus ** open Prelude, ResRus in {
flags optimize=all_subs ; coding=utf8 ; flags optimize=all_subs ; coding=utf8 ;
lin lin
PredVP Ya tebyaNeVizhu = { s = \\b,clf => PredVP Ya tebyaNeVizhu = { s = \\b,clf =>
let { let {
ya = Ya.s ! (case clf of { ya = Ya.s ! (case clf of {
ClInfinit => (mkPronForm Acc No NonPoss); ClInfinit => (mkPronForm Acc No NonPoss);
_ => (mkPronForm Nom No NonPoss) _ => (mkPronForm Nom No NonPoss)
}); });
ne = case b of {Pos=>""; Neg=>"не"}; ne = case b of {Pos=>""; Neg=>"не"};
vizhu = tebyaNeVizhu.s ! clf ! (pgNum Ya.g Ya.n)! Ya.p; vizhu = tebyaNeVizhu.s ! clf ! (pgNum Ya.g Ya.n)! Ya.p;
khorosho = tebyaNeVizhu.s2 ; khorosho = tebyaNeVizhu.s2 ;
tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n
} }
in in
if_then_else Str tebyaNeVizhu.negBefore if_then_else Str tebyaNeVizhu.negBefore
(ya ++ ne ++ vizhu ++ tebya ++ khorosho) (ya ++ ne ++ vizhu ++ tebya ++ khorosho)
(ya ++ vizhu ++ ne ++ tebya ++ khorosho) (ya ++ vizhu ++ ne ++ tebya ++ khorosho)
} ; } ;
PredSCVP sc vp = { s = \\b,clf => PredSCVP sc vp = { s = \\b,clf =>
let { let {
ne = case b of {Pos=>""; Neg=>"не"}; ne = case b of {Pos=>""; Neg=>"не"};
vizhu = vp.s ! clf ! (ASg Neut)! P3; vizhu = vp.s ! clf ! (ASg Neut)! P3;
tebya = vp.s3 ! Neut ! Sg tebya = vp.s3 ! Neut ! Sg
} }
in in
if_then_else Str vp.negBefore if_then_else Str vp.negBefore
(sc.s ++ ne ++ vizhu ++ tebya) (sc.s ++ ne ++ vizhu ++ tebya)
(sc.s ++ vizhu ++ ne ++ tebya) (sc.s ++ vizhu ++ ne ++ tebya)
} ; } ;
SlashV2 ivan lubit = { s=\\b,clf => ivan.s ! PF Nom No NonPoss ++ SlashV2 ivan lubit = { s=\\b,clf => ivan.s ! PF Nom No NonPoss ++
lubit.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ; lubit.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ;
s2=lubit.s2; c=lubit.c }; s2=lubit.s2; c=lubit.c };
SlashVVV2 ivan khotet lubit = SlashVVV2 ivan khotet lubit =
{ s=\\b,clf => ivan.s ! PF Nom No NonPoss ++ khotet.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ++ lubit.s! VFORM Act VINF ; { s=\\b,clf => ivan.s ! PF Nom No NonPoss ++ khotet.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ++ lubit.s! VFORM Act VINF ;
s2=lubit.s2; s2=lubit.s2;
c=lubit.c }; c=lubit.c };
AdvSlash slash adv = { AdvSlash slash adv = {
s = \\b,clf => slash.s ! b ! clf ++ adv.s ; s = \\b,clf => slash.s ! b ! clf ++ adv.s ;
c = slash.c; c = slash.c;
s2 = slash.s2; s2 = slash.s2;
} ; } ;
SlashPrep cl p = {s=cl.s; s2=p.s; c=p.c} ; SlashPrep cl p = {s=cl.s; s2=p.s; c=p.c} ;
ImpVP inf = {s = \\pol, g,n => --- AR 3/11/2007
let SlashVS ivan vidit tuUlubaeshsya = {
dont = case pol of { s=\\b,clf => ivan.s ! PF Nom No NonPoss ++
Neg => "не" ; vidit.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ++
_ => [] [", что"] ++ tuUlubaeshsya.s ;
} s2=tuUlubaeshsya.s2;
in c=tuUlubaeshsya.c
dont ++ inf.s ! ClImper ! (gNum g n )!P2 ++ } ;
inf.s2++inf.s3!g!n
} ;
EmbedS s = {s = "что" ++ s.s} ; ImpVP inf = {s = \\pol, g,n =>
-- In Russian "Whether you go" transformed in "go whether you": let
EmbedQS qs = {s = qs.s ! QIndir} ; dont = case pol of {
EmbedVP vp = {s = vp.s2 ++ vp.s!ClInfinit!(ASg Masc) !P3 ++ vp.s3!Masc!Sg} ; Neg => "не" ;
_ => []
UseCl t a p cl = {s = case t.t of { }
in
dont ++ inf.s ! ClImper ! (gNum g n )!P2 ++
inf.s2++inf.s3!g!n
} ;
EmbedS s = {s = "что" ++ s.s} ;
-- In Russian "Whether you go" transformed in "go whether you":
EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = vp.s2 ++ vp.s!ClInfinit!(ASg Masc) !P3 ++ vp.s3!Masc!Sg} ;
UseCl t a p cl = {s = case t.t of {
Cond => cl.s! p.p ! ClCondit ; --# notpresent Cond => cl.s! p.p ! ClCondit ; --# notpresent
_ => cl.s! p.p ! ClIndic (getTense t.t) a.a}}; _ => cl.s! p.p ! ClIndic (getTense t.t) a.a}};
UseQCl t a p qcl= {s = case t.t of { UseQCl t a p qcl= {s = case t.t of {
Cond => qcl.s! p.p ! ClCondit ; --# notpresent Cond => qcl.s! p.p ! ClCondit ; --# notpresent
_ => qcl.s!p.p! ClIndic (getTense t.t) a.a }}; _ => qcl.s!p.p! ClIndic (getTense t.t) a.a }};
UseRCl t a p rcl ={s = \\gn,c,anim => case t.t of { UseRCl t a p rcl ={s = \\gn,c,anim => case t.t of {
Cond => [", "] ++ rcl.s! p.p ! ClCondit ! gn !c !anim ; --# notpresent Cond => [", "] ++ rcl.s! p.p ! ClCondit ! gn !c !anim ; --# notpresent
_ => [", "] ++ rcl.s! p.p ! ClIndic (getTense t.t) a.a !gn !c !anim}}; _ => [", "] ++ rcl.s! p.p ! ClIndic (getTense t.t) a.a !gn !c !anim}};
UseSlash t a p cl = {
s = case t.t of {
Cond => cl.s! p.p ! ClCondit ; --# notpresent
_ => cl.s! p.p ! ClIndic (getTense t.t) a.a
} ;
s2 = cl.s2 ;
c = cl.c
};
AdvS a s = {s = a.s ++ "," ++ s.s} ; ---- AR 19/6/2007 AdvS a s = {s = a.s ++ "," ++ s.s} ; ---- AR 19/6/2007
} }
+243 -243
View File
@@ -1,243 +1,243 @@
--# -path=.:../abstract:../common:../../prelude --# -path=.:../abstract:../common:../../prelude
concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in {
flags optimize=all_subs ; coding=utf8 ; flags optimize=all_subs ; coding=utf8 ;
lin lin
CompNP masha = CompNP masha =
{ s=\\clf,gn,p => case clf of { s=\\clf,gn,p => case clf of
{ {
(ClIndic Present _) => masha.s ! (mkPronForm Nom No NonPoss) ; (ClIndic Present _) => masha.s ! (mkPronForm Nom No NonPoss) ;
(ClIndic PastRus _) => case gn of (ClIndic PastRus _) => case gn of
{ (ASg Fem) =>"была"++masha.s ! (mkPronForm Inst No NonPoss); { (ASg Fem) =>"была"++masha.s ! (mkPronForm Inst No NonPoss);
(ASg Masc) =>"был" ++ masha.s!(mkPronForm Inst No NonPoss); (ASg Masc) =>"был" ++ masha.s!(mkPronForm Inst No NonPoss);
(ASg Neut) =>"было" ++ masha.s!(mkPronForm Inst No NonPoss); (ASg Neut) =>"было" ++ masha.s!(mkPronForm Inst No NonPoss);
APl => "были" ++ masha.s ! (mkPronForm Inst No NonPoss) APl => "были" ++ masha.s ! (mkPronForm Inst No NonPoss)
}; };
(ClIndic Future _) => case gn of (ClIndic Future _) => case gn of
{ APl => case p of { APl => case p of
{ P3 => "будут"++masha.s ! (mkPronForm Inst No NonPoss); { P3 => "будут"++masha.s ! (mkPronForm Inst No NonPoss);
P2 => "будете"++masha.s !(mkPronForm Inst No NonPoss); P2 => "будете"++masha.s !(mkPronForm Inst No NonPoss);
P1 => "будем"++masha.s ! (mkPronForm Inst No NonPoss) P1 => "будем"++masha.s ! (mkPronForm Inst No NonPoss)
}; };
(ASg _) => case p of (ASg _) => case p of
{ P3=>"будет"++masha.s!(mkPronForm Inst No NonPoss) ; { P3=>"будет"++masha.s!(mkPronForm Inst No NonPoss) ;
P2 => "будешь"++ masha.s ! (mkPronForm Inst No NonPoss) ; P2 => "будешь"++ masha.s ! (mkPronForm Inst No NonPoss) ;
P1=> "буду"++ masha.s ! (mkPronForm Inst No NonPoss) P1=> "буду"++ masha.s ! (mkPronForm Inst No NonPoss)
} --case p } --case p
}; --case gn }; --case gn
ClCondit => "" ; ClCondit => "" ;
ClImper => case (numGNum gn) of ClImper => case (numGNum gn) of
{Sg => "будь" ++ masha.s ! (mkPronForm Inst No NonPoss); {Sg => "будь" ++ masha.s ! (mkPronForm Inst No NonPoss);
Pl => "будьте" ++ masha.s ! (mkPronForm Inst No NonPoss) Pl => "будьте" ++ masha.s ! (mkPronForm Inst No NonPoss)
}; };
ClInfin => "быть" ++ masha.s ! (mkPronForm Inst No NonPoss) ClInfin => "быть" ++ masha.s ! (mkPronForm Inst No NonPoss)
}; -- case clf }; -- case clf
asp = Imperfective ; asp = Imperfective ;
w = Act; w = Act;
negBefore = True; negBefore = True;
s2 = ""; s2 = "";
s3 = \\g,n => "" s3 = \\g,n => ""
} ; } ;
CompAP zloj ={ CompAP zloj ={
s= \\clf,gn,p => case clf of { s= \\clf,gn,p => case clf of {
-- person is ignored ! -- person is ignored !
ClInfinit => "быть" ++ zloj.s ! AF Inst Animate (ASg Masc) ; ClInfinit => "быть" ++ zloj.s ! AF Inst Animate (ASg Masc) ;
ClImper => case gn of ClImper => case gn of
{ (ASg _) => "будь" ++ zloj.s ! AF Inst Animate (ASg Masc); { (ASg _) => "будь" ++ zloj.s ! AF Inst Animate (ASg Masc);
APl => "будьте" ++ zloj.s ! AF Inst Animate APl APl => "будьте" ++ zloj.s ! AF Inst Animate APl
}; };
-- infinitive does not save GenNum, -- infinitive does not save GenNum,
-- but indicative does for the sake of adjectival predication ! -- but indicative does for the sake of adjectival predication !
ClIndic Present _ => zloj.s ! AF Nom Animate gn ; ClIndic Present _ => zloj.s ! AF Nom Animate gn ;
ClIndic PastRus _ => case gn of ClIndic PastRus _ => case gn of
{ (ASg Fem) => "была" ++ zloj.s! AF Nom Animate (ASg Fem); { (ASg Fem) => "была" ++ zloj.s! AF Nom Animate (ASg Fem);
(ASg Masc) => "был" ++ zloj.s! AF Nom Animate (ASg Masc); (ASg Masc) => "был" ++ zloj.s! AF Nom Animate (ASg Masc);
(ASg Neut) => "был" ++ zloj.s! AF Nom Animate (ASg Neut); (ASg Neut) => "был" ++ zloj.s! AF Nom Animate (ASg Neut);
APl => "были" ++ zloj.s! AF Nom Animate APl APl => "были" ++ zloj.s! AF Nom Animate APl
}; };
ClIndic Future _ => case gn of ClIndic Future _ => case gn of
{ APl => case p of { APl => case p of
{ P3 => "будут" ++ zloj.s! AF Nom Animate APl; { P3 => "будут" ++ zloj.s! AF Nom Animate APl;
P2 => "будете" ++ zloj.s! AF Nom Animate APl; P2 => "будете" ++ zloj.s! AF Nom Animate APl;
P1 => "будем" ++ zloj.s! AF Nom Animate APl P1 => "будем" ++ zloj.s! AF Nom Animate APl
} ; } ;
(ASg _) => case p of (ASg _) => case p of
{P3 => "будет" ++ zloj.s! AF Nom Animate (ASg (genGNum gn)); {P3 => "будет" ++ zloj.s! AF Nom Animate (ASg (genGNum gn));
P2 => "будешь"++ zloj.s! AF Nom Animate (ASg (genGNum gn)); P2 => "будешь"++ zloj.s! AF Nom Animate (ASg (genGNum gn));
P1=> "буду" ++ zloj.s! AF Nom Animate (ASg (genGNum gn)) P1=> "буду" ++ zloj.s! AF Nom Animate (ASg (genGNum gn))
} }
}; };
ClCondit => "" ClCondit => ""
} ; } ;
asp = Imperfective ; asp = Imperfective ;
w = Act; w = Act;
negBefore = True; negBefore = True;
s2 = ""; s2 = "";
s3 = \\g,n=> "" s3 = \\g,n=> ""
} ; } ;
-- Verb phrases can also be formed from adjectives (" молод"), -- Verb phrases can also be formed from adjectives (" молод"),
-- common nouns (" человек"), and noun phrases (" самый молодой"). -- common nouns (" человек"), and noun phrases (" самый молодой").
-- The third rule is overgenerating: " каждый человек" has to be ruled out -- The third rule is overgenerating: " каждый человек" has to be ruled out
-- on semantic grounds. -- on semantic grounds.
-- Note: we omit a dash "-" because it will cause problems with negation word order: -- Note: we omit a dash "-" because it will cause problems with negation word order:
-- "Я не - волшебник". Alternatively, we can consider verb-based VP and -- "Я не - волшебник". Alternatively, we can consider verb-based VP and
-- all the rest. -- all the rest.
CompAdv zloj = CompAdv zloj =
{ s= \\clf,gn,p => case clf of { { s= \\clf,gn,p => case clf of {
ClImper => case gn of ClImper => case gn of
{ ASg _ => "будь" ++ zloj.s; -- person is ignored ! { ASg _ => "будь" ++ zloj.s; -- person is ignored !
APl => "будьте" ++ zloj.s APl => "будьте" ++ zloj.s
}; };
ClInfinit => "быть" ++ zloj.s; ClInfinit => "быть" ++ zloj.s;
ClIndic Present _ => zloj.s ; ClIndic Present _ => zloj.s ;
ClIndic PastRus _ => case gn of ClIndic PastRus _ => case gn of
{ (ASg Fem) => "была" ++ zloj.s; { (ASg Fem) => "была" ++ zloj.s;
(ASg Masc) => "был" ++ zloj.s; (ASg Masc) => "был" ++ zloj.s;
(ASg Neut) => "было" ++ zloj.s; (ASg Neut) => "было" ++ zloj.s;
APl => "были" ++ zloj.s APl => "были" ++ zloj.s
}; };
ClIndic Future _ => case gn of ClIndic Future _ => case gn of
{ (ASg _) => "будет" ++ zloj.s; { (ASg _) => "будет" ++ zloj.s;
APl => "будут" ++ zloj.s APl => "будут" ++ zloj.s
}; };
ClCondit => "" ClCondit => ""
} ; } ;
asp = Imperfective ; asp = Imperfective ;
w = Act; w = Act;
s2 = ""; s2 = "";
negBefore = True; negBefore = True;
s3 = \\g,n => "" s3 = \\g,n => ""
} ; } ;
UseComp comp = comp ; UseComp comp = comp ;
UseVS, UseVQ = \vv -> {s = vv.s ; asp = vv.asp; s2 = [] ; c = Acc} ; UseVS, UseVQ = \vv -> {s = vv.s ; asp = vv.asp; s2 = [] ; c = Acc} ;
-- CompAP ap = ap ; -- CompAP ap = ap ;
-- CompNP np = {s = \\_ => np.s ! Acc} ; -- CompNP np = {s = \\_ => np.s ! Acc} ;
-- CompAdv a = {s = \\_ => a.s} ; -- CompAdv a = {s = \\_ => a.s} ;
-- A simple verb can be made into a verb phrase with an empty complement. -- A simple verb can be made into a verb phrase with an empty complement.
-- There are two versions, depending on if we want to negate the verb. -- There are two versions, depending on if we want to negate the verb.
-- N.B. negation is *not* a function applicable to a verb phrase, since -- N.B. negation is *not* a function applicable to a verb phrase, since
-- double negations with "inte" are not grammatical. -- double negations with "inte" are not grammatical.
UseV se = UseV se =
{s=\\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ; {s=\\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ;
asp = se.asp ; asp = se.asp ;
w=Act; w=Act;
s2 = ""; s2 = "";
negBefore = True; negBefore = True;
s3 = table{_=> table{_ => ""}} s3 = table{_=> table{_ => ""}}
} ; } ;
-- The rule for using transitive verbs is the complementization rule: -- The rule for using transitive verbs is the complementization rule:
ComplV2 se tu = ComplV2 se tu =
{s =\\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) {s =\\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p)
++ se.s2 ++ tu.s ! (mkPronForm se.c No NonPoss) ; ++ se.s2 ++ tu.s ! (mkPronForm se.c No NonPoss) ;
asp = se.asp ; asp = se.asp ;
w = Act; w = Act;
s2 = ""; s2 = "";
s3 = \\g,n => ""; s3 = \\g,n => "";
negBefore = True negBefore = True
} ; } ;
ComplV3 dat tu pivo = ComplV3 dat tu pivo =
let let
tebepivo = dat.s2 ++ tebepivo = dat.s2 ++
tu.s ! PF dat.c No NonPoss ++ dat.s4 ++ pivo.s ! PF dat.c2 Yes NonPoss tu.s ! PF dat.c No NonPoss ++ dat.s4 ++ pivo.s ! PF dat.c2 Yes NonPoss
in in
{s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ tebepivo ; {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ tebepivo ;
asp = dat.asp ; asp = dat.asp ;
w = Act; w = Act;
negBefore = True; negBefore = True;
s2 = ""; s2 = "";
s3 = \\g,n=> "" s3 = \\g,n=> ""
} ; } ;
ReflV2 v = ReflV2 v =
{ s = \\clf,gn,p => v.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ v.s2 ++ sebya!v.c; { s = \\clf,gn,p => v.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ v.s2 ++ sebya!v.c;
asp = v.asp ; asp = v.asp ;
w = Act; w = Act;
negBefore = True; negBefore = True;
s2 = ""; s2 = "";
s3 = \\g,n=> "" s3 = \\g,n=> ""
} ; } ;
-- To generate "сказал, что Иван гуляет" / "не сказал, что Иван гуляет": -- To generate "сказал, что Иван гуляет" / "не сказал, что Иван гуляет":
ComplVS vidit tuUlubaeshsya = ComplVS vidit tuUlubaeshsya =
{s = \\clf,gn,p => vidit.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) {s = \\clf,gn,p => vidit.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p)
++ [", что"] ++ tuUlubaeshsya.s ; ++ [", что"] ++ tuUlubaeshsya.s ;
asp = vidit.asp; asp = vidit.asp;
w = Act; w = Act;
s2=""; s2="";
negBefore = True; negBefore = True;
s3 = \\g,n => "" s3 = \\g,n => ""
} ; } ;
-- To generate "can walk"/"can't walk"; "tries to walk"/"does not try to walk": -- To generate "can walk"/"can't walk"; "tries to walk"/"does not try to walk":
-- The contraction of "not" is not provided, since it would require changing -- The contraction of "not" is not provided, since it would require changing
-- the verb parameter type. -- the verb parameter type.
ComplVV putatsya bezhat = ComplVV putatsya bezhat =
{ s = \\clf,gn,p => putatsya.s ! (getActVerbForm clf (genGNum gn) { s = \\clf,gn,p => putatsya.s ! (getActVerbForm clf (genGNum gn)
(numGNum gn) p) ++ bezhat.s!ClInfinit !gn!p ; (numGNum gn) p) ++ bezhat.s!ClInfinit !gn!p ;
asp = putatsya.asp ; asp = putatsya.asp ;
w = Act; w = Act;
negBefore = True; negBefore = True;
s2 = ""; s2 = "";
s3 =\\g,n => "" s3 =\\g,n => ""
} ; } ;
ComplVQ dat esliOnPridet = ComplVQ dat esliOnPridet =
{s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ esliOnPridet.s ! QDir ; {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ esliOnPridet.s ! QDir ;
asp = dat.asp ; asp = dat.asp ;
w = Act; w = Act;
negBefore = True; negBefore = True;
s2 = ""; s2 = "";
s3 = \\g,n=> "" s3 = \\g,n=> ""
} ; } ;
ComplVA vuglyadet molodoj = ComplVA vuglyadet molodoj =
{s = \\clf,gn,p => vuglyadet.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ; {s = \\clf,gn,p => vuglyadet.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ;
asp = vuglyadet.asp ; asp = vuglyadet.asp ;
w = Act; w = Act;
negBefore = True; negBefore = True;
s2 = ""; s2 = "";
s3 = \\g,n => molodoj.s!(AF Inst Animate (gNum g n)) s3 = \\g,n => molodoj.s!(AF Inst Animate (gNum g n))
} ; } ;
ComplV2A obechat tu molodoj = ComplV2A obechat tu molodoj =
{s = \\clf,gn,p => obechat.s2++ {s = \\clf,gn,p => obechat.s2++
obechat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ obechat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++
tu.s ! PF obechat.c No NonPoss ++ tu.s ! PF obechat.c No NonPoss ++
molodoj.s!AF Inst tu.anim (pgNum tu.g tu.n) ; molodoj.s!AF Inst tu.anim (pgNum tu.g tu.n) ;
asp = obechat.asp ; asp = obechat.asp ;
w = Act; w = Act;
negBefore = True; negBefore = True;
s2 = ""; s2 = "";
s3 = \\g,n =>"" s3 = \\g,n =>""
} ; } ;
AdvVP poet khorosho = AdvVP poet khorosho =
{s = \\clf,gn,p => poet.s ! clf!gn!p; s2 = poet.s2 ++ khorosho.s; s3 = poet.s3; {s = \\clf,gn,p => poet.s ! clf!gn!p; s2 = poet.s2 ++ khorosho.s; s3 = poet.s3;
asp = poet.asp; w = poet.w; t = poet.t ; negBefore = poet.negBefore } ; asp = poet.asp; w = poet.w; t = poet.t ; negBefore = poet.negBefore } ;
AdVVP khorosho poet = AdVVP khorosho poet =
{s = \\clf,gn,p => poet.s ! clf!gn!p; s2 = khorosho.s ++ poet.s2; s3 = poet.s3; {s = \\clf,gn,p => poet.s ! clf!gn!p; s2 = khorosho.s ++ poet.s2; s3 = poet.s3;
asp = poet.asp; w = poet.w; t = poet.t ; negBefore = poet.negBefore } ; asp = poet.asp; w = poet.w; t = poet.t ; negBefore = poet.negBefore } ;
PassV2 se = PassV2 se =
{s=\\clf,gn,p => se.s ! (getPassVerbForm clf (genGNum gn) (numGNum gn) p) ; {s=\\clf,gn,p => se.s ! (getPassVerbForm clf (genGNum gn) (numGNum gn) p) ;
asp=se.asp; w=Pass; s2 = se.s2; asp=se.asp; w=Pass; s2 = se.s2;
negBefore = True; negBefore = True;
s3 = table{_=> table{_ => ""}} s3 = table{_=> table{_ => ""}}
}; };
} }
@@ -10,6 +10,7 @@ incomplete concrete CatScand of Cat =
S = {s : Order => Str} ; S = {s : Order => Str} ;
QS = {s : QForm => Str} ; QS = {s : QForm => Str} ;
RS = {s : Agr => Str ; c : NPForm} ; RS = {s : Agr => Str ; c : NPForm} ;
SlashS = {s : Order => Str} ** {c2 : Str} ;
-- Sentence -- Sentence
+18 -4
View File
@@ -36,16 +36,30 @@ incomplete concrete SentenceScand of Sentence =
SlashPrep cl prep = cl ** {c2 = prep.s} ; SlashPrep cl prep = cl ** {c2 = prep.s} ;
SlashVS np vs slash =
mkClause
(np.s ! nominative) np.a
(insertObj (\\_ => conjThat ++ slash.s ! Sub) (predV vs)) **
{c2 = slash.c2} ;
EmbedS s = {s = conjThat ++ s.s ! Sub} ; EmbedS s = {s = conjThat ++ s.s ! Sub} ;
EmbedQS qs = {s = qs.s ! QIndir} ; EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = infMark ++ infVP vp (agrP3 utrum Sg)} ; --- agr EmbedVP vp = {s = infMark ++ infVP vp (agrP3 utrum Sg)} ; --- agr
UseCl t a p cl = {s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! o} ; UseCl t a p cl = {
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ; s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! o
} ;
UseQCl t a p cl = {
s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q
} ;
UseRCl t a p cl = { UseRCl t a p cl = {
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ; s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ;
c = cl.c c = cl.c
} ; } ;
UseSlash t a p cl = {
s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! o ;
c2 = cl.c2
} ;
AdvS a s = {s = \\o => a.s ++ "," ++ s.s ! o} ; AdvS a s = {s = \\o => a.s ++ s.s ! Inv} ;
} }