mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
added UseComp and CompAP in Slovenian. This also implements the complicated word order
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
concrete PhraseSlv of Phrase = CatSlv ** open Prelude, ResSlv in {
|
concrete PhraseSlv of Phrase = CatSlv ** open Prelude, ResSlv, (P=ParamX) in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||||
@@ -10,7 +10,7 @@ concrete PhraseSlv of Phrase = CatSlv ** open Prelude, ResSlv in {
|
|||||||
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc ! Sg} ;
|
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc ! Sg} ;
|
||||||
|
|
||||||
UttNP np = {s = np.s ! Nom} ;
|
UttNP np = {s = np.s ! Nom} ;
|
||||||
UttVP vp = {s = vp.s ! VInf ++ vp.s2 ! {g=Masc; n=Sg; p=P3}} ;
|
UttVP vp = {s = vp.s ! P.Pos ! VInf ++ vp.s2 ! {g=Masc; n=Sg; p=P3}} ;
|
||||||
UttAdv adv = adv ;
|
UttAdv adv = adv ;
|
||||||
UttCN n = {s = n.s ! Indef ! Nom ! Sg} ;
|
UttCN n = {s = n.s ! Indef ! Nom ! Sg} ;
|
||||||
UttCard n = {s = n.s ! Fem ! Nom} ;
|
UttCard n = {s = n.s ! Fem ! Nom} ;
|
||||||
|
|||||||
@@ -46,43 +46,64 @@ oper
|
|||||||
p = b.p
|
p = b.p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
VP = {s : VForm => Str; s2 : Agr => Str} ;
|
VP = {s : Polarity => VForm => Str; s2 : Agr => Str; isCop : Bool} ;
|
||||||
|
|
||||||
neg : Polarity => Tense => Str =
|
ne : Polarity => Str =
|
||||||
table {Pos => \\_ => "" ;
|
table {Pos => "" ;
|
||||||
Neg => table {Past => "ni"; _ => "ne"}
|
Neg => "ne"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ni : Polarity => Str =
|
||||||
|
table {Pos => "" ;
|
||||||
|
Neg => "ni"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
predV : Bool -> (VForm => Str) -> Tense => Polarity => Agr => Str =
|
predV : Bool -> Bool -> (Polarity => VForm => Str) -> Tense => Polarity => Agr => Str =
|
||||||
\ispron,v -> table {
|
\ispron,iscop,v -> table {
|
||||||
Pres => \\p,a => neg ! p ! Pres ++ v ! VPres a.n a.p ;
|
Pres => \\p,a => v ! p ! VPres a.n a.p ;
|
||||||
Past => \\p,a => case <ispron,p> of {
|
Past => \\p,a => case <ispron,p> of {
|
||||||
<True,Pos> => v ! VPastPart a.g a.n ++ sem_V ! a.n ! a.p ;
|
<True,Pos> => v ! Pos ! VPastPart a.g a.n ++ copula ! p ! VPres a.n a.p ;
|
||||||
<_ ,_ > => neg ! p ! Past + sem_V ! a.n ! a.p ++ v ! VPastPart a.g a.n } ;
|
<_ ,_ > => copula ! p ! VPres a.n a.p ++ v ! Pos ! VPastPart a.g a.n } ;
|
||||||
Fut => \\p,a => case <ispron,p> of {
|
Fut => \\p,a => case <ispron,p> of {
|
||||||
<True,Pos> => v ! VPastPart a.g a.n ++ bom_V ! a.n ! a.p ;
|
<True,Pos> => case iscop of {
|
||||||
<_ ,_ > => neg ! p ! Fut ++ bom_V ! a.n ! a.p ++ v ! VPastPart a.g a.n } ;
|
False => v ! Pos ! VPastPart a.g a.n ++ bom_V ! a.n ! a.p ;
|
||||||
Cond => \\p,a => neg ! p ! Cond ++ "bi" ++ v ! VPastPart a.g a.n
|
True => bom_V ! a.n ! a.p
|
||||||
|
} ;
|
||||||
|
<_ ,_ > => case iscop of {
|
||||||
|
False => ne ! p ++ bom_V ! a.n ! a.p ++ v ! Pos ! VPastPart a.g a.n ;
|
||||||
|
True => ne ! p ++ bom_V ! a.n ! a.p
|
||||||
|
} } ;
|
||||||
|
Cond => \\p,a => ne ! p ++ "bi" ++ v ! Pos ! VPastPart a.g a.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
sem_V : Number => Person => Str =
|
copula : Polarity => VForm => Str = \\p =>
|
||||||
table {
|
table {
|
||||||
Sg => table {
|
VInf => ne ! p ++ "biti";
|
||||||
P1 => "sem" ;
|
VSup => ne ! p ++ "bit";
|
||||||
P2 => "si" ;
|
VPastPart Masc Sg => ne ! p ++ "bil";
|
||||||
P3 => "je"
|
VPastPart Masc Dl => ne ! p ++ "bila";
|
||||||
} ;
|
VPastPart Masc Pl => ne ! p ++ "bili";
|
||||||
Dl => table {
|
VPastPart Fem Sg => ne ! p ++ "bila";
|
||||||
P1 => "sva" ;
|
VPastPart Fem Dl => ne ! p ++ "bili";
|
||||||
P2 => "sta" ;
|
VPastPart Fem Pl => ne ! p ++ "bile";
|
||||||
P3 => "sta"
|
VPastPart Neut Sg => ne ! p ++ "bilo";
|
||||||
} ;
|
VPastPart Neut Dl => ne ! p ++ "bili";
|
||||||
Pl => table {
|
VPastPart Neut Pl => ne ! p ++ "bila";
|
||||||
P1 => "smo" ;
|
VPres Sg P1 => ni ! p + "sem";
|
||||||
P2 => "ste" ;
|
VPres Sg P2 => ni ! p + "si";
|
||||||
P3 => "so"
|
VPres Sg P3 => case p of {Pos=>"je"; Neg=>"ni"};
|
||||||
}
|
VPres Dl P1 => ni ! p + "sva";
|
||||||
} ;
|
VPres Dl P2 => ni ! p + "sta";
|
||||||
|
VPres Dl P3 => ni ! p + "sta";
|
||||||
|
VPres Pl P1 => ni ! p + "smo";
|
||||||
|
VPres Pl P2 => ni ! p + "ste";
|
||||||
|
VPres Pl P3 => ni ! p + "so";
|
||||||
|
VImper1Sg => ne ! p ++ "bodita";
|
||||||
|
VImper1Dl => ne ! p ++ "bodite";
|
||||||
|
VImper2 Sg => ne ! p ++ "bodi";
|
||||||
|
VImper2 Dl => ne ! p ++ "bodiva";
|
||||||
|
VImper2 Pl => ne ! p ++ "bodimo"
|
||||||
|
};
|
||||||
|
|
||||||
bom_V : Number => Person => Str =
|
bom_V : Number => Person => Str =
|
||||||
table {
|
table {
|
||||||
@@ -111,8 +132,11 @@ oper
|
|||||||
\subj,agr,ispron,vp -> {
|
\subj,agr,ispron,vp -> {
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
case ispron of {
|
case ispron of {
|
||||||
False => subj ++ predV ispron vp.s ! t ! p ! agr ++ vp.s2 ! agr ;
|
False => subj ++ predV ispron vp.isCop vp.s ! t ! p ! agr ++ vp.s2 ! agr ;
|
||||||
True => predV ispron vp.s ! t ! p ! agr ++ vp.s2 ! agr
|
True => case vp.isCop of {
|
||||||
|
False => predV ispron vp.isCop vp.s ! t ! p ! agr ++ vp.s2 ! agr ;
|
||||||
|
True => vp.s2 ! agr ++ predV ispron vp.isCop vp.s ! t ! p ! agr
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -130,4 +154,11 @@ oper
|
|||||||
ANeut => Neut
|
ANeut => Neut
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
inanimateGender : Gender -> AGender = \g ->
|
||||||
|
case g of {
|
||||||
|
Masc => AMasc Inanimate ;
|
||||||
|
Fem => AFem ;
|
||||||
|
Neut => ANeut
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ lin
|
|||||||
PredVP np vp = mkClause (np.s ! Nom) np.a np.isPron vp ;
|
PredVP np vp = mkClause (np.s ! Nom) np.a np.isPron vp ;
|
||||||
|
|
||||||
ImpVP vp = {
|
ImpVP vp = {
|
||||||
s = \\pol,g,n => vp.s ! VImper2 n ++ vp.s2 ! {g=g; n=n; p=P2} ;
|
s = \\p,g,n => vp.s ! p ! VImper2 n ++ vp.s2 ! {g=g; n=n; p=P2} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UseCl t p cl = {
|
UseCl t p cl = {
|
||||||
|
|||||||
@@ -1,20 +1,32 @@
|
|||||||
concrete VerbSlv of Verb = CatSlv ** open ResSlv, Prelude in {
|
concrete VerbSlv of Verb = CatSlv ** open ResSlv, ParamX, Prelude in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
UseV v =
|
UseV v =
|
||||||
{ s = v.s ;
|
{ s = \\p,vform => ne ! p ++ v.s ! vform ;
|
||||||
s2 = \\a => ""
|
s2 = \\a => "" ;
|
||||||
|
isCop = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashV2a v =
|
SlashV2a v =
|
||||||
{ s = v.s ;
|
{ s = \\p,vform => ne ! p ++ v.s ! vform ;
|
||||||
s2 = \\a => "" ;
|
s2 = \\a => "" ;
|
||||||
c2 = v.c2
|
c2 = v.c2 ;
|
||||||
|
isCop = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplSlash vp np =
|
ComplSlash vp np =
|
||||||
insertObj (\\_ => vp.c2.s ++ np.s ! vp.c2.c) vp ;
|
insertObj (\\_ => vp.c2.s ++ np.s ! vp.c2.c) vp;
|
||||||
|
|
||||||
|
UseComp comp = {
|
||||||
|
s = copula ;
|
||||||
|
s2 = comp.s ;
|
||||||
|
isCop = True
|
||||||
|
} ;
|
||||||
|
|
||||||
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||||
|
|
||||||
|
CompAP ap = {
|
||||||
|
s = \\agr => ap.s ! Indef ! inanimateGender agr.g ! Nom ! agr.n
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user