Merge branch 'master' into fix-must-dolzhen

This commit is contained in:
Roman Suzi
2020-05-21 17:28:04 +03:00
5 changed files with 160 additions and 164 deletions

View File

@@ -487,7 +487,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
_ + "í" => jarniAdjForms s ; _ + "í" => jarniAdjForms s ;
_ + "ův" => otcuvAdjForms s ; _ + "ův" => otcuvAdjForms s ;
_ + "in" => matcinAdjForms s ; _ + "in" => matcinAdjForms s ;
_ => matcinAdjForms ("??" + s) -- Predef.error ("no mkA for" ++ s) _ => matcinAdjForms ("" + s) -- Predef.error ("no mkA for" ++ s)
} ; } ;
-- hard declension -- hard declension

View File

@@ -23,8 +23,7 @@ flags coding = utf8 ;
} ; } ;
prepositive = False} ; prepositive = False} ;
AdAdv ada adv = {s = \\st => ada.s ++ adv.s ! st ; AdAdv ada adv = adv ** {s = \\st => ada.s ++ adv.s ! st} ;
prepositive = adv.prepositive} ;
PositAdAAdj a = {s = a.adv ! Pos } ; PositAdAAdj a = {s = a.adv ! Pos } ;

View File

@@ -52,16 +52,12 @@ flags coding = utf8 ;
anim = pron.anim anim = pron.anim
} ; } ;
PredetNP p np = { PredetNP p np = np ** {
s = \\st => p.s ++ np.s ! st ; s = \\st => p.s ++ np.s ! st ;
prepositive = np.prepositive ;
needPart = np.needPart ;
changePolar = case p.not of { changePolar = case p.not of {
True => True ; True => True ;
False => np.changePolar False => np.changePolar
} ; } ;
meaning = np.meaning ;
anim = np.anim
} ; } ;
PPartNP np v2 = np ** { PPartNP np v2 = np ** {
@@ -180,13 +176,11 @@ flags coding = utf8 ;
DefArt = {s = \\st => "" ; sp = \\st => "これ" ; no = False} ; DefArt = {s = \\st => "" ; sp = \\st => "これ" ; no = False} ;
MassNP cn = { MassNP cn = cn ** {
s = \\st => cn.object ! st ++ cn.s ! Pl ! st ; s = \\st => cn.object ! st ++ cn.s ! Pl ! st ;
prepositive = cn.prepositive ;
needPart = True ; needPart = True ;
changePolar = False ; changePolar = False ;
meaning = SomeoneElse ; meaning = SomeoneElse ;
anim = cn.anim
} ; } ;
PossPron pron = { PossPron pron = {
@@ -245,8 +239,8 @@ flags coding = utf8 ;
False => adv.s ! st ++ cn.object ! st False => adv.s ! st ++ cn.object ! st
} ; } ;
prepositive = \\st => case adv.prepositive of { prepositive = \\st => case adv.prepositive of {
True => adv.s ! st ; True => adv.s ! st ++ cn.prepositive ! st ;
False => [] False => cn.prepositive ! st
} ; } ;
} ; } ;

View File

@@ -17,7 +17,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
} ; } ;
ComplVV v vp = case v.sense of { ComplVV v vp = case v.sense of {
Abil => { Abil => vp ** {
verb = \\sp,a,st,t,p => vp.verb ! sp ! a ! Plain ! TPres ! ResJpn.Pos ++ verb = \\sp,a,st,t,p => vp.verb ! sp ! a ! Plain ! TPres ! ResJpn.Pos ++
"ことが" ++ v.s ! sp ! st ! t ! p ; "ことが" ++ v.s ! sp ! st ! t ! p ;
te = \\sp,a,st,p => vp.verb ! sp ! a ! Plain ! TPres ! ResJpn.Pos ++ "ことが" ++ te = \\sp,a,st,p => vp.verb ! sp ! a ! Plain ! TPres ! ResJpn.Pos ++ "ことが" ++
@@ -28,12 +28,9 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
"ことが" ++ v.i_stem ! sp ; "ことが" ++ v.i_stem ! sp ;
ba = \\sp,a,st,p => vp.verb ! sp ! a ! Plain ! TPres ! ResJpn.Pos ++ "ことが" ++ ba = \\sp,a,st,p => vp.verb ! sp ! a ! Plain ! TPres ! ResJpn.Pos ++ "ことが" ++
v.ba ! sp ! p ; v.ba ! sp ! p ;
prep = vp.prep ;
obj = \\st => vp.obj ! st ;
prepositive = vp.prepositive ;
needSubject = True needSubject = True
} ; } ;
Oblig => { Oblig => vp ** {
verb = \\sp,a,st,t => table { verb = \\sp,a,st,t => table {
Pos => vp.a_stem ! sp ! a ! st ++ "なければ" ++ v.s ! sp ! st ! t ! Neg ; Pos => vp.a_stem ! sp ! a ! st ++ "なければ" ++ v.s ! sp ! st ! t ! Neg ;
Neg => vp.te ! sp ! a ! st ! Pos ++ "は" ++ v.s ! sp ! st ! t ! Neg Neg => vp.te ! sp ! a ! st ! Pos ++ "は" ++ v.s ! sp ! st ! t ! Neg
@@ -48,20 +45,14 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
Pos => vp.a_stem ! sp ! a ! st ++ "なければ" ++ v.ba ! sp ! Pos ; Pos => vp.a_stem ! sp ! a ! st ++ "なければ" ++ v.ba ! sp ! Pos ;
Neg => vp.te ! sp ! a ! st ! Pos ++ "は" ++ v.ba ! sp ! Pos Neg => vp.te ! sp ! a ! st ! Pos ++ "は" ++ v.ba ! sp ! Pos
} ; } ;
prep = vp.prep ;
obj = \\st => vp.obj ! st ;
prepositive = vp.prepositive ;
needSubject = True needSubject = True
} ; } ;
Wish => { Wish => vp ** {
verb = \\sp,a,st,t,p => vp.i_stem ! sp ! a ! st ++ v.s ! sp ! st ! t ! p ; verb = \\sp,a,st,t,p => vp.i_stem ! sp ! a ! st ++ v.s ! sp ! st ! t ! p ;
te = \\sp,a,st,p => vp.i_stem ! sp ! a ! st ++ v.te ! sp ! p ; te = \\sp,a,st,p => vp.i_stem ! sp ! a ! st ++ v.te ! sp ! p ;
a_stem = \\sp,a,st => vp.i_stem ! sp ! a ! st ++ v.a_stem ! sp ; a_stem = \\sp,a,st => vp.i_stem ! sp ! a ! st ++ v.a_stem ! sp ;
i_stem = \\sp,a,st => vp.i_stem ! sp ! a ! st ++ v.i_stem ! sp ; i_stem = \\sp,a,st => vp.i_stem ! sp ! a ! st ++ v.i_stem ! sp ;
ba = \\sp,a,st,p => vp.i_stem ! sp ! a ! st ++ v.ba ! sp ! p ; ba = \\sp,a,st,p => vp.i_stem ! sp ! a ! st ++ v.ba ! sp ! p ;
prep = vp.prep ;
obj = \\st => vp.obj ! st ;
prepositive = vp.prepositive ;
needSubject = True needSubject = True
} }
} ; } ;
@@ -128,7 +119,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
Slash3V3 = Slash2V3 ; Slash3V3 = Slash2V3 ;
SlashV2V v2v vp = { SlashV2V v2v vp = vp ** {
s = \\sp,st,t,p => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ "ように" s = \\sp,st,t,p => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ "ように"
++ v2v.s ! st ! t ! p ; ++ v2v.s ! st ! t ! p ;
a_stem = \\sp => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ a_stem = \\sp => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++
@@ -141,7 +132,6 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
obj = \\st => vp.obj ! st ++ vp.prep ; obj = \\st => vp.obj ! st ++ vp.prep ;
te = \\sp,p => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ te = \\sp,p => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++
v2v.te ! p ; v2v.te ! p ;
prepositive = vp.prepositive ;
v2vType = True v2vType = True
} ; } ;
@@ -206,7 +196,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
} ; } ;
SlashVV v vpslash = case v.sense of { SlashVV v vpslash = case v.sense of {
Abil => { Abil => vpslash ** {
s = \\sp,st,t,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ s = \\sp,st,t,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++
"ことが" ++ v.s ! sp ! st ! t ! p ; "ことが" ++ v.s ! sp ! st ! t ! p ;
te = \\sp,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ことが" ++ te = \\sp,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ことが" ++
@@ -217,12 +207,9 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
v.i_stem ! sp ; v.i_stem ! sp ;
ba = \\sp,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ことが" ++ ba = \\sp,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ことが" ++
v.ba ! sp ! p ; v.ba ! sp ! p ;
prep = vpslash.prep ;
obj = vpslash.obj ;
prepositive = vpslash.prepositive ;
v2vType = False v2vType = False
} ; } ;
Oblig => { Oblig => vpslash ** {
s = \\sp,st,t => table { s = \\sp,st,t => table {
Pos => vpslash.a_stem ! sp ++ "なければ" ++ v.s ! sp ! st ! t ! Neg ; Pos => vpslash.a_stem ! sp ++ "なければ" ++ v.s ! sp ! st ! t ! Neg ;
Neg => vpslash.te ! sp ! Pos ++ "は" ++ v.s ! sp ! st ! t ! Neg Neg => vpslash.te ! sp ! Pos ++ "は" ++ v.s ! sp ! st ! t ! Neg
@@ -237,20 +224,14 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
Pos => vpslash.a_stem ! sp ++ "なければ" ++ v.ba ! sp ! Pos ; Pos => vpslash.a_stem ! sp ++ "なければ" ++ v.ba ! sp ! Pos ;
Neg => vpslash.te ! sp ! Pos ++ "は" ++ v.ba ! sp ! Pos Neg => vpslash.te ! sp ! Pos ++ "は" ++ v.ba ! sp ! Pos
} ; } ;
prep = vpslash.prep ;
obj = vpslash.obj ;
prepositive = vpslash.prepositive ;
v2vType = False v2vType = False
} ; } ;
Wish => { Wish => vpslash ** {
s = \\sp,st,t,p => vpslash.i_stem ! sp ++ v.s ! sp ! st ! t ! p ; s = \\sp,st,t,p => vpslash.i_stem ! sp ++ v.s ! sp ! st ! t ! p ;
te = \\sp,p => vpslash.i_stem ! sp ++ v.te ! sp ! p ; te = \\sp,p => vpslash.i_stem ! sp ++ v.te ! sp ! p ;
a_stem = \\sp => vpslash.i_stem ! sp ++ v.a_stem ! sp ; a_stem = \\sp => vpslash.i_stem ! sp ++ v.a_stem ! sp ;
i_stem = \\sp => vpslash.i_stem ! sp ++ v.i_stem ! sp ; i_stem = \\sp => vpslash.i_stem ! sp ++ v.i_stem ! sp ;
ba = \\sp,p => vpslash.i_stem ! sp ++ v.ba ! sp ! p ; ba = \\sp,p => vpslash.i_stem ! sp ++ v.ba ! sp ! p ;
prep = vpslash.prep ;
obj = vpslash.obj ;
prepositive = vpslash.prepositive ;
v2vType = False v2vType = False
} }
} ; } ;
@@ -268,7 +249,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
v2vType = True v2vType = True
} ; } ;
ReflVP vpslash = { ReflVP vpslash = vpslash ** {
verb = \\sp,a,st,t,p => vpslash.s ! sp ! st ! t ! p ; verb = \\sp,a,st,t,p => vpslash.s ! sp ! st ! t ! p ;
a_stem = \\sp,a,st => vpslash.a_stem ! sp ; a_stem = \\sp,a,st => vpslash.a_stem ! sp ;
i_stem = \\sp,a,st => vpslash.i_stem ! sp ; i_stem = \\sp,a,st => vpslash.i_stem ! sp ;
@@ -276,11 +257,10 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
prep = vpslash.prep ; prep = vpslash.prep ;
obj = \\st => vpslash.obj ! st ++ "自分" ; -- "jibun" obj = \\st => vpslash.obj ! st ++ "自分" ; -- "jibun"
te = \\sp,a,st,p => vpslash.te ! sp ! p ; te = \\sp,a,st,p => vpslash.te ! sp ! p ;
prepositive = vpslash.prepositive ;
needSubject = True needSubject = True
} ; } ;
UseComp comp = { UseComp comp = comp ** {
verb = \\sp,a,st,t,p => comp.verb ! a ! st ! t ! p; verb = \\sp,a,st,t,p => comp.verb ! a ! st ! t ! p;
te = \\sp => comp.te ; te = \\sp => comp.te ;
a_stem = \\sp,a,st => comp.a_stem ! a ! st ; a_stem = \\sp,a,st => comp.a_stem ! a ! st ;
@@ -288,8 +268,6 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
ba = \\sp => comp.ba ; ba = \\sp => comp.ba ;
prep = [] ; prep = [] ;
obj = comp.obj ; obj = comp.obj ;
prepositive = comp.prepositive ;
needSubject = comp.needSubject
} ; } ;
PassV2 v2 = { PassV2 v2 = {
@@ -304,13 +282,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
needSubject = True needSubject = True
} ; } ;
AdvVP vp adv = { AdvVP vp adv = vp ** {
verb = vp.verb ;
te = vp.te ;
a_stem = vp.a_stem ;
i_stem = vp.i_stem ;
ba = vp.ba ;
prep = vp.prep ;
obj = \\st => case adv.prepositive of { obj = \\st => case adv.prepositive of {
True => vp.obj ! st ; True => vp.obj ! st ;
False => adv.s ! st ++ vp.obj ! st False => adv.s ! st ++ vp.obj ! st
@@ -319,30 +291,15 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
True => vp.prepositive ! st ++ adv.s ! st ; True => vp.prepositive ! st ++ adv.s ! st ;
False => vp.prepositive ! st False => vp.prepositive ! st
} ; } ;
needSubject = vp.needSubject
} ; } ;
ExtAdvVP = AdvVP ; ExtAdvVP = AdvVP ;
AdVVP adv vp = { AdVVP adv vp = vp ** {
verb = vp.verb ;
te = vp.te ;
a_stem = vp.a_stem ;
i_stem = vp.i_stem ;
ba = vp.ba ;
prep = vp.prep ;
obj = \\st => adv.s ++ vp.obj ! st ; obj = \\st => adv.s ++ vp.obj ! st ;
prepositive = vp.prepositive ;
needSubject = vp.needSubject
} ; } ;
AdvVPSlash vpslash adv = { AdvVPSlash vpslash adv = vpslash ** {
s = vpslash.s ;
te = vpslash.te ;
a_stem = vpslash.a_stem ;
i_stem = vpslash.i_stem ;
ba = vpslash.ba ;
prep = vpslash.prep ;
obj = \\st => case adv.prepositive of { obj = \\st => case adv.prepositive of {
True => vpslash.obj ! st ; True => vpslash.obj ! st ;
False => adv.s ! st ++ vpslash.obj ! st False => adv.s ! st ++ vpslash.obj ! st
@@ -354,15 +311,8 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
v2vType = False v2vType = False
} ; } ;
AdVVPSlash adv vpslash = { AdVVPSlash adv vpslash = vpslash ** {
s = vpslash.s ;
te = vpslash.te ;
a_stem = vpslash.a_stem ;
i_stem = vpslash.i_stem ;
ba = vpslash.ba ;
prep = vpslash.prep ;
obj = \\st => adv.s ++ vpslash.obj ! st ; obj = \\st => adv.s ++ vpslash.obj ! st ;
prepositive = vpslash.prepositive ;
v2vType = False v2vType = False
} ; } ;
@@ -440,4 +390,3 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in {
needSubject = True needSubject = True
} ; } ;
} }

View File

@@ -8,11 +8,13 @@ concrete ExtendSwe of Extend = CatSwe **
PassVPSlash, PassAgentVPSlash, UttVPShort, ByVP, InOrderToVP, PassVPSlash, PassAgentVPSlash, UttVPShort, ByVP, InOrderToVP,
MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2,
ICompAP,ProDrop,EmbedSSlash, ICompAP,ProDrop,EmbedSSlash,
AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP, AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP,
RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP, RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP,
Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP,
CompoundN, CompoundAP, AdvIsNP CompoundN, CompoundAP, AdvIsNP,
UttAccNP
] ]
with (Grammar = GrammarSwe) with (Grammar = GrammarSwe)
** **
@@ -120,6 +122,56 @@ concrete ExtendSwe of Extend = CatSwe **
ConjVPS = conjunctDistrTable2 Order Agr ; ConjVPS = conjunctDistrTable2 Order Agr ;
lincat
VPS2 = {s : Order => Agr => Str ; c2 : {s : Str; hasPrep : Prelude.Bool}} ;
[VPS2] = {s1,s2 : Order => Agr => Str ; c2 : {s : Str; hasPrep : Prelude.Bool}} ;
lin
BaseVPS2 x y = twoTable2 Order Agr x y ** {c2 = y.c2} ;
ConsVPS2 x xs = consrTable2 Order Agr comma x xs ** {c2 = xs.c2};
MkVPS2 t p vp = {
s = \\o,a =>
let
verb = vp.s ! Act ! VPFinite t.t t.a ;
neg = verb.a1 ! p.p ! a ;
compl = vp.n2 ! a ++ vp.a2 ++ vp.ext ;
pron = vp.n1 ! a
in t.s ++ p.s ++ case o of {
Main => verb.fin ++ neg.p1 ++ verb.inf ++ pron ++ neg.p2 ++ compl ;
Inv => verb.fin ++ neg.p1 ++ verb.inf ++ pron ++ neg.p2 ++ compl ; ----
Sub => neg.p1 ++ neg.p2 ++ verb.fin ++ verb.inf ++ pron ++ compl
} ;
c2 = vp.c2
} ;
ComplVPS2 vps2 np = {
s = \\o,a => vps2.s !o ! a ++ vps2.c2.s ++ np.s ! NPAcc
} ;
ConjVPS2 c xs = conjunctDistrTable2 Order Agr c xs ** {c2 = xs.c2} ;
lincat
VPI2 = {s : VPIForm => Agr => Str ; c2 : {s : Str; hasPrep : Prelude.Bool}} ;
[VPI2] = {s1,s2 : VPIForm => Agr => Str ; c2 : {s : Str; hasPrep : Prelude.Bool}} ;
lin
BaseVPI2 x y = twoTable2 VPIForm Agr x y ** {c2 = y.c2} ;
ConsVPI2 x xs = consrTable2 VPIForm Agr comma x xs ** {c2 = xs.c2} ;
MkVPI2 vp = {
s = \\v,a => infVP vp a ; ---- no sup
c2 = vp.c2
} ;
ConjVPI2 c xs = conjunctDistrTable2 VPIForm Agr c xs ** {c2 = xs.c2} ;
ComplVPI2 vpi2 np = {
s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2.s ++ np.s ! NPAcc
} ;
-----------
ICompAP ap = {s = \\a => hur_IAdv.s ++ ap.s ! a} ; ICompAP ap = {s = \\a => hur_IAdv.s ++ ap.s ! a} ;
ProDrop pro = pro ** {s = \\_ => []} ; ProDrop pro = pro ** {s = \\_ => []} ;
@@ -234,4 +286,6 @@ concrete ExtendSwe of Extend = CatSwe **
AdvIsNP adv np = PredVP {s = \\_ => adv.s ; a = np.a ; isPron = False} (UseComp (CompNP np)) ; AdvIsNP adv np = PredVP {s = \\_ => adv.s ; a = np.a ; isPron = False} (UseComp (CompNP np)) ;
EmbedSSlash ss = {s = "det" ++ ss.s ! Main ++ ss.c2.s ++ ss.n3 ! agrUSgP3} ; EmbedSSlash ss = {s = "det" ++ ss.s ! Main ++ ss.c2.s ++ ss.n3 ! agrUSgP3} ;
UttAccNP np = {s = np.s ! NPAcc} ;
} }