1
0
forked from GitHub/gf-rgl
This commit is contained in:
krangelov
2021-04-27 08:43:35 +02:00
11 changed files with 49722 additions and 37153 deletions

View File

@@ -72,6 +72,7 @@ for lang in $langs; do
for mod in $modules_langs $modules_api; do for mod in $modules_langs $modules_api; do
if [ $mod == "Compatibility" ] && [[ "$langs_compat" != *"$lang"* ]]; then continue; fi if [ $mod == "Compatibility" ] && [[ "$langs_compat" != *"$lang"* ]]; then continue; fi
if [ $mod == "Try" ] && [[ "$langs_try" != *"$lang"* ]]; then continue; fi if [ $mod == "Try" ] && [[ "$langs_try" != *"$lang"* ]]; then continue; fi
if [ $mod == "Symbol" ] && [[ "$langs_try" != *"$lang"* ]]; then continue; fi
if [ $mod == "Symbolic" ] && [[ "$langs_symbolic" != *"$lang"* ]]; then continue; fi if [ $mod == "Symbolic" ] && [[ "$langs_symbolic" != *"$lang"* ]]; then continue; fi
for file in "${src}"/*/"${mod}${lang}".gf; do for file in "${src}"/*/"${mod}${lang}".gf; do
if [ ! -f "$file" ]; then continue; fi if [ ! -f "$file" ]; then continue; fi

View File

@@ -69,6 +69,7 @@ abstract Extend = Cat ** {
MkVPS2 : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved MkVPS2 : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved
ConjVPS2 : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates ConjVPS2 : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates
ComplVPS2 : VPS2 -> NP -> VPS ; -- has loved and now hates that person ComplVPS2 : VPS2 -> NP -> VPS ; -- has loved and now hates that person
ReflVPS2 : VPS2 -> RNP -> VPS ; -- have loved and now hate myself and my car
MkVPI2 : VPSlash -> VPI2 ; -- to love MkVPI2 : VPSlash -> VPI2 ; -- to love
ConjVPI2 : Conj -> [VPI2] -> VPI2 ; -- to love and hate ConjVPI2 : Conj -> [VPI2] -> VPI2 ; -- to love and hate
@@ -124,6 +125,11 @@ abstract Extend = Cat ** {
ProgrVPSlash : VPSlash -> VPSlash; ProgrVPSlash : VPSlash -> VPSlash;
-- construct VPSlash from A2 and N2
A2VPSlash : A2 -> VPSlash ; -- is married to (that person)
N2VPSlash : N2 -> VPSlash ; -- is a mother of (that person)
-- existential for mathematics -- existential for mathematics
ExistsNP : NP -> Cl ; -- there exists a number / there exist numbers ExistsNP : NP -> Cl ; -- there exists a number / there exist numbers
@@ -134,7 +140,7 @@ abstract Extend = Cat ** {
ExistMassCN : CN -> Cl ; -- there is beer / there is no beer ExistMassCN : CN -> Cl ; -- there is beer / there is no beer
ExistPluralCN : CN -> Cl ; -- there are trees / there are no trees ExistPluralCN : CN -> Cl ; -- there are trees / there are no trees
-- generalisation of existential, with adverb as a parameter -- generalisation of existential, with adverb as an argument
AdvIsNP : Adv -> NP -> Cl ; -- here is the tree / here are the trees AdvIsNP : Adv -> NP -> Cl ; -- here is the tree / here are the trees
AdvIsNPAP : Adv -> NP -> AP -> Cl ; -- here are the instructions documented AdvIsNPAP : Adv -> NP -> AP -> Cl ; -- here are the instructions documented

View File

@@ -32,6 +32,7 @@ lin
MkVPS2 = variants {} ; -- : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved MkVPS2 = variants {} ; -- : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved
ConjVPS2 = variants {} ; -- : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates ConjVPS2 = variants {} ; -- : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates
ComplVPS2 = variants {} ; -- : VPS2 -> NP -> VPS ; -- has loved and now hates that person ComplVPS2 = variants {} ; -- : VPS2 -> NP -> VPS ; -- has loved and now hates that person
ReflVPS2 = variants {} ; -- : VPS2 -> RNP -> VPS ; -- have loved and now hate myself and my car
MkVPI2 = variants {} ; -- : Ant -> Pol -> VPSlash -> VPI2 ; -- to have loved MkVPI2 = variants {} ; -- : Ant -> Pol -> VPSlash -> VPI2 ; -- to have loved
ConjVPI2 = variants {} ; -- : Conj -> [VPI2] -> VPI2 ; -- to love and have hated ConjVPI2 = variants {} ; -- : Conj -> [VPI2] -> VPI2 ; -- to love and have hated
ComplVPI2 = variants {} ; -- : VPI2 -> NP -> VPI ; -- to love and hate that person ComplVPI2 = variants {} ; -- : VPI2 -> NP -> VPI ; -- to love and hate that person
@@ -51,6 +52,8 @@ lin
PastPartAgentAP = variants {} ; -- VPSlash -> NP -> AP ; -- (opportunity) lost by the company PastPartAgentAP = variants {} ; -- VPSlash -> NP -> AP ; -- (opportunity) lost by the company
NominalizeVPSlashNP = variants {} ; -- VPSlash -> NP -> NP ; NominalizeVPSlashNP = variants {} ; -- VPSlash -> NP -> NP ;
ProgrVPSlash = variants {} ; -- VPSlash -> VPSlash ; ProgrVPSlash = variants {} ; -- VPSlash -> VPSlash ;
A2VPSlash = variants {} ; -- A2 -> VPSlash ;
N2VPSlash = variants {} ; -- N2 -> VPSlash ;
ExistsNP = ExistNP ; -- NP -> Cl ; -- there exists a number / there exist numbers ExistsNP = ExistNP ; -- NP -> Cl ; -- there exists a number / there exist numbers
ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ; ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ;
ExistMassCN cn = ExistNP (MassNP cn) ; ExistMassCN cn = ExistNP (MassNP cn) ;

View File

@@ -5,18 +5,19 @@ concrete ExtendEng of Extend =
[ [
VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList, VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList,
AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdvIsNP, AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdvIsNP,
BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, QuestVPS, SQuestVPS,
MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2, MkVPS2, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, ReflVPS2,
MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2,
Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN, Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN,
CompIQuant, CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP, CompIQuant, CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP,
CompoundN, ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash, CompoundN, ConjRNP, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash,
ExistsNP, ExistCN, ExistMassCN, ExistPluralCN, ExistsNP, ExistCN, ExistMassCN, ExistPluralCN,
FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP, FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP,
GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, MkVPS, NominalizeVPSlashNP, GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, NominalizeVPSlashNP,
PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN, PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPSVV, PredetRNP, PrepCN,
EmbedSSlash, PredIAdvVP, PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash, EmbedSSlash, PredIAdvVP, PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash,
UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2 UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, A2VPSlash, N2VPSlash
] ]
with with
(Grammar = GrammarEng) ** (Grammar = GrammarEng) **
@@ -69,21 +70,63 @@ concrete ExtendEng of Extend =
} ; } ;
lincat lincat
VPS = {s : Agr => Str} ; VPS = {s : Order => Agr => {fin, inf : Str}} ;
[VPS] = {s1,s2 : Agr => Str} ; [VPS] = {s1,s2 : Order => Agr => Str ; fin : Order => Agr => Str} ;
VPI = {s : VVType => Agr => Str} ; VPI = {s : VVType => Agr => Str} ;
[VPI] = {s1,s2 : VVType => Agr => Str} ; [VPI] = {s1,s2 : VVType => Agr => Str} ;
lin lin
BaseVPS = twoTable Agr ; BaseVPS x y =
ConsVPS = consrTable Agr comma ; let baseX : OneFinVPS = baseVPS x ;
baseY : OneFinVPS = baseVPS y ;
in twoTable2 Order Agr baseX baseY ** {fin = baseX.fin} ;
ConsVPS x xs =
let baseX : OneFinVPS = baseVPS x ;
in consrTable2 Order Agr comma baseX xs ** {fin = baseX.fin} ; -- keep only the first fin
oper
{- IL 03/2021 for VPS conjunction: separate the first finite verb for questions
[do]:fin (you) [eat bread and sleep?]:inf
(you) [ ]:fin [eat bread and sleep]:inf
The fin field becomes empty for ODir, but no problem: order is just subj++fin++inf.
Weird results for CompNP/AP/…, but coordination of those already covered in RGL. -}
OneFinVPS : Type = {s : Order => Agr => Str ; fin : Order => Agr => Str} ;
baseVPS : VPS -> OneFinVPS = \vps -> {
s = \\o,a => let vp = vps.s ! o ! a in
case o of {
OQuest => vp.inf ;
ODir _ => vp.fin ++ vp.inf
} ;
fin = \\o,a => let vp = vps.s ! o ! a in
case o of {
OQuest => vp.fin ;
ODir _ => []
}
} ;
lin
BaseVPI = twoTable2 VVType Agr ; BaseVPI = twoTable2 VVType Agr ;
ConsVPI = consrTable2 VVType Agr comma ; ConsVPI = consrTable2 VVType Agr comma ;
MkVPS t p vp = mkVPS (lin Temp t) (lin Pol p) (lin VP vp) ; MkVPS t p vp = mkVPS (lin Temp t) (lin Pol p) (lin VP vp) ;
ConjVPS c xs = conjunctDistrTable Agr c xs ; ConjVPS c xs = {
PredVPS np vps = {s = np.s ! npNom ++ vps.s ! np.a} ; s = \\o,a => {
fin = xs.fin ! o ! a ;
inf = c.s1 ++ xs.s1 ! o ! a ++ c.s2 ++ xs.s2 ! o ! a}
} ;
PredVPS np vps = let vp = vps.s ! oDir ! np.a in {
s = np.s ! npNom ++ vp.fin ++ vp.inf
} ;
SQuestVPS np vps = let
vp = vps.s ! OQuest ! np.a ;
vpindir = vps.s ! oDir ! np.a in {
s = table {
QDir => vp.fin ++ np.s ! npNom ++ vp.inf ;
QIndir => "if" ++ np.s ! npNom ++ vpindir.fin ++ vpindir.inf}
} ;
QuestVPS ip vps = let vp = vps.s ! oDir ! toAgr ip.n P3 Neutr in {
s = \\q => ip.s ! npNom ++ vp.fin ++ vp.inf
} ;
MkVPI vp = mkVPI (lin VP vp) ; MkVPI vp = mkVPI (lin VP vp) ;
@@ -94,8 +137,11 @@ concrete ExtendEng of Extend =
-------- two-place verb conjunction -------- two-place verb conjunction
lincat lincat
VPS2 = {s : Agr => Str ; c2 : Str} ; VPS2 = {s : Order => Agr => {fin,inf : Str} ; c2 : Str} ;
[VPS2] = {s1,s2 : Agr => Str ; c2 : Str} ; [VPS2] = {
fin : Order => Agr => Str ; -- Q: do ; DIR:
s1,s2 : Order => Agr => Str ; -- Q: eat, drink ; DIR: eat, drink
c2 : Str} ;
VPI2 = {s : VVType => Agr => Str ; c2 : Str} ; VPI2 = {s : VVType => Agr => Str ; c2 : Str} ;
[VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Str} ; [VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Str} ;
@@ -103,33 +149,40 @@ concrete ExtendEng of Extend =
MkVPS2 t p vpsl = mkVPS (lin Temp t) (lin Pol p) (lin VP vpsl) ** {c2 = vpsl.c2} ; MkVPS2 t p vpsl = mkVPS (lin Temp t) (lin Pol p) (lin VP vpsl) ** {c2 = vpsl.c2} ;
MkVPI2 vpsl = mkVPI (lin VP vpsl) ** {c2 = vpsl.c2} ; MkVPI2 vpsl = mkVPI (lin VP vpsl) ** {c2 = vpsl.c2} ;
BaseVPS2 x y = twoTable Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb BaseVPS2 x y = BaseVPS x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
ConsVPS2 x xs = consrTable Agr comma x xs ** {c2 = xs.c2} ; ConsVPS2 x xs = ConsVPS x xs ** {c2 = xs.c2} ;
BaseVPI2 x y = twoTable2 VVType Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb BaseVPI2 x y = twoTable2 VVType Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ; ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ;
ConjVPS2 c xs = conjunctDistrTable Agr c xs ** {c2 = xs.c2} ; ConjVPS2 c xs = ConjVPS c xs ** {c2 = xs.c2} ;
ConjVPI2 c xs = conjunctDistrTable2 VVType Agr c xs ** {c2 = xs.c2} ; ConjVPI2 c xs = conjunctDistrTable2 VVType Agr c xs ** {c2 = xs.c2} ;
ComplVPS2 vps2 np = { ComplVPS2 vps2 np = {
s = \\a => vps2.s ! a ++ vps2.c2 ++ np.s ! NPAcc s = \\o,a => let vps2s = vps2.s ! o ! a in
vps2s ** {inf = vps2s.inf ++ vps2.c2 ++ np.s ! NPAcc} -- keep fin, add object to inf
} ; } ;
ComplVPI2 vpi2 np = { ComplVPI2 vpi2 np = {
s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2 ++ np.s ! NPAcc s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2 ++ np.s ! NPAcc
} ; } ;
ReflVPS2 vps2 rnp = {
s = \\o,a => let vps2s = vps2.s ! o ! a in
vps2s ** {inf = vps2s.inf ++ vps2.c2 ++ rnp.s ! a}
} ;
oper oper
mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS { mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS {
s = \\a => s = \\o,a =>
let let
verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ; verb = vp.s ! t.t ! t.a ! p.p ! o ! a ; -- choice of Order determines aux or not
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ; compl = vp.s2 ! a ++ vp.ext
in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext in {fin = verb.aux ;
inf = verb.adv ++ vp.ad ! a ++ verb.fin ++ verb.inf ++ vp.p ++ compl} ;
} ; } ;
linVPS : Agr -> {s : Order => Agr => {fin,inf : Str}} -> Str = \agr,vps -> let vpss = vps.s ! ODir True ! agr in vpss.fin ++ vpss.inf ;
mkVPI : VP -> VPI = \vp -> lin VPI { mkVPI : VP -> VPI = \vp -> lin VPI {
s = table { s = table {
VVAux => \\a => vp.ad ! a ++ vp.inf ++ vp.p ++ vp.s2 ! a ; VVAux => \\a => vp.ad ! a ++ vp.inf ++ vp.p ++ vp.s2 ! a ;
@@ -138,6 +191,10 @@ concrete ExtendEng of Extend =
} }
} ; } ;
linref
VPS = linVPS (agrP3 Sg) ;
VPS2 = \vps -> linVPS (agrP3 Sg) vps ++ vps.c2 ;
-- Conjunction of copula complements -- Conjunction of copula complements
lincat [Comp] = {s1,s2 : Agr => Str} ; lincat [Comp] = {s1,s2 : Agr => Str} ;
@@ -239,6 +296,19 @@ lin BaseImp = twoTable2 CPolarity ImpForm ;
ProgrVPSlash vp = insertObjc (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a) ProgrVPSlash vp = insertObjc (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a)
(predAux auxBe ** {c2 = vp.c2; gapInMiddle = vp.gapInMiddle; missingAdv = vp.missingAdv}); (predAux auxBe ** {c2 = vp.c2; gapInMiddle = vp.gapInMiddle; missingAdv = vp.missingAdv});
N2VPSlash n2 =
let prep : Prep = mkPrep n2.c2 ;
dummyVPS : VPSlash = SlashV2a (mkV2 (mkV "dummy") prep);
in dummyVPS ** -- has necessary fields for VPSlash, and c2 from the N2
UseComp (CompCN (UseN2 n2)) ; -- has all the right fields except for c2
A2VPSlash a2 =
let prep : Prep = mkPrep a2.c2 ;
dummyVPS : VPSlash = SlashV2a (mkV2 (mkV "dummy") prep) ;
in dummyVPS ** -- has necessary fields for VPSlash, and c2 from the A2
UseComp (CompAP (UseA2 a2)) ; -- has all the right fields except for c2
--- AR 7/3/2013 --- AR 7/3/2013
ComplSlashPartLast vps np = case vps.gapInMiddle of { ComplSlashPartLast vps np = case vps.gapInMiddle of {
_ => insertObjPartLast (\\_ => vps.c2 ++ np.s ! NPAcc) vps --- _ => insertObjPartLast (\\_ => vps.c2 ++ np.s ! NPAcc) vps ---
@@ -377,7 +447,4 @@ lin BaseImp = twoTable2 CPolarity ImpForm ;
UncontractedNeg = {s = [] ; p = CNeg False} ; UncontractedNeg = {s = [] ; p = CNeg False} ;
UttVPShort vp = {s = infVP VVAux vp False Simul CPos (agrP3 Sg)} ; UttVPShort vp = {s = infVP VVAux vp False Simul CPos (agrP3 Sg)} ;
} }

View File

@@ -14,6 +14,7 @@ concrete ExtendFin of Extend =
open open
GrammarFin, GrammarFin,
ResFin, ResFin,
StemFin,
(S=StemFin), (S=StemFin),
IdiomFin, IdiomFin,
Coordination, Coordination,
@@ -43,21 +44,56 @@ oper
lincat lincat
VPS = {s : Agr => Str } ; VPS = {
[VPS] = {s1,s2 : Agr => Str } ; s : Agr => Str ;
sc : SubjCase ; --- can be different for diff parts
h : Harmony --- can be different for diff parts
} ;
[VPS] = {
s1,s2 : Agr => Str ;
sc : SubjCase ; --- take the first: minä osaan kutoa ja täytyy virkata
h : Harmony --- take the first: osaanko minä kutoa ja käyn koulua
} ;
VPI = {s : VVType => Agr => Str ; sc : SubjCase } ; -- Agr needed for possessive suffix: VPI = {s : VVType => Agr => Str ; sc : SubjCase } ; -- Agr needed for possessive suffix:
[VPI] = {s1,s2 : VVType => Agr => Str ; sc : SubjCase } ; -- e.g. toivon nukkuva+ni [VPI] = {s1,s2 : VVType => Agr => Str ; sc : SubjCase } ; -- e.g. toivon nukkuva+ni
lin lin
BaseVPS = twoTable Agr ; MkVPS t p vp0 = let vp = vp2old_vp vp0 in
ConsVPS = consrTable Agr comma ; { -- Temp -> Pol -> VP -> VPS ;
s = \\a =>
let
agrfin = case vp.sc of {
SCNom => <a,True> ;
_ => <agrP3 Sg,False> -- minun täytyy, minulla on
} ;
vps = vp.s ! VIFin t.t ! t.a ! p.p ! agrfin.p1
in
t.s ++ p.s ++
vps.fin ++ vps.inf ++
vp.s2 ! agrfin.p2 ! p.p ! a ++
vp.adv ! p.p ++
vp.ext ;
sc = vp.sc ;
h = vp.h
} ;
BaseVPS x y = twoTable Agr x y ** {sc = x.sc ; h = x.h} ;
ConsVPS x y = consrTable Agr comma x y ** {sc = x.sc ; h = x.h} ;
ConjVPS conj ss = conjunctDistrTable Agr conj ss ** {
sc = ss.sc ; h = ss.h
} ;
PredVPS np vps = { -- NP -> VPS -> S ;
s = subjForm np vps.sc Pos ++ vps.s ! np.a
} ;
BaseVPI = twoTable2 VVType Agr ; BaseVPI = twoTable2 VVType Agr ;
ConsVPI = consrTable2 VVType Agr comma ; ConsVPI = consrTable2 VVType Agr comma ;
MkVPS t p vp = mkVPS t p (lin VP vp) ;
ConjVPS c xs = conjunctDistrTable Agr c xs ;
PredVPS np vps = {s = np.s ! NPCase Nom ++ vps.s ! np.a} ;
MkVPI vp = mkVPI vp ; MkVPI vp = mkVPI vp ;
@@ -74,15 +110,15 @@ oper
lincat lincat
-- Polarity needed to pick the right object case -- Polarity needed to pick the right object case
VPS2 = {s : Agr => Str ; c2 : Compl ; p : Polarity } ; VPS2 = {s : Agr => Str ; c2 : Compl ; p : Polarity ; sc : SubjCase ; h : Harmony} ;
[VPS2] = {s1,s2 : Agr => Str ; c2 : Compl ; p : Polarity } ; [VPS2] = {s1,s2 : Agr => Str ; c2 : Compl ; p : Polarity ; sc : SubjCase ; h : Harmony} ;
-- A version with -- A version with
VPI2 = {s : VVType => Agr => Str ; c2 : Compl ; sc : SubjCase } ; VPI2 = {s : VVType => Agr => Str ; c2 : Compl ; sc : SubjCase } ;
[VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Compl ; sc : SubjCase } ; [VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Compl ; sc : SubjCase } ;
lin lin
-- : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved -- : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved
MkVPS2 t p vpsl = mkVPS t p (lin VP vpsl) ** {c2 = vpsl.c2 ; p = p.p } ; MkVPS2 t p vpsl = mkVPS t p (lin VP vpsl) ** {c2 = vpsl.c2 ; p = p.p} ;
-- : VPSlash -> VPI2 ; -- to love -- : VPSlash -> VPI2 ; -- to love
MkVPI2 vpsl = mkVPI (lin VP vpsl) ** {c2 = vpsl.c2} ; MkVPI2 vpsl = mkVPI (lin VP vpsl) ** {c2 = vpsl.c2} ;
@@ -94,19 +130,21 @@ oper
ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ; ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ;
ConjVPS2 c xs = conjunctDistrTable Agr c xs ** {c2 = xs.c2 ; p = xs.p } ; ConjVPS2 c xs = conjunctDistrTable Agr c xs ** {c2 = xs.c2 ; p = xs.p ; sc = xs.sc ; h = xs.h} ;
ConjVPI2 c xs = conjunctDistrTable2 VVType Agr c xs ** {c2 = xs.c2 ; p = xs.p ; sc = xs.sc } ; ConjVPI2 c xs = conjunctDistrTable2 VVType Agr c xs ** {c2 = xs.c2 ; p = xs.p ; sc = xs.sc } ;
-- appCompl : Bool -> Polarity -> Compl -> ResFin.NP -> Str -- appCompl : Bool -> Polarity -> Compl -> ResFin.NP -> Str
ComplVPS2 v np = { s = \\agr => v.s ! agr ++ appCompl True v.p v.c2 np } ; ComplVPS2 v np = v ** { s = \\agr => v.s ! agr ++ appCompl True v.p v.c2 np } ;
-- TODO: Version with variable polarity? -- TODO: Version with variable polarity?
ComplVPI2 v np = v ** { s = \\vt,a => v.s ! vt ! a ++ appCompl True Pos v.c2 np }; ComplVPI2 v np = v ** { s = \\vt,a => v.s ! vt ! a ++ appCompl True Pos v.c2 np };
oper oper
mkVPS : Temp -> Pol -> VP -> VPS = \tem,pol,vp -> lin VPS { mkVPS : Temp -> Pol -> VP -> VPS = \tem,pol,vp -> lin VPS {
s = \\agr => (UseCl tem pol (S.mkClause (\_ -> []) agr vp)).s } ; s = \\agr => (UseCl tem pol (S.mkClause (\_ -> []) agr vp)).s ;
h = vp.s.h ; sc = vp.s.sc
} ;
mkVPI : VP -> VPI = \vp -> lin VPI { mkVPI : VP -> VPI = \vp -> lin VPI {
s = \\vt,agr => S.infVP vp.s.sc Pos agr vp (vvtype2infform vt) ; s = \\vt,agr => S.infVP vp.s.sc Pos agr vp (vvtype2infform vt) ;

View File

@@ -2,7 +2,12 @@
concrete ExtendGer of Extend = concrete ExtendGer of Extend =
CatGer ** ExtendFunctor CatGer ** ExtendFunctor
- [InOrderToVP] - [
InOrderToVP,
VPS, ListVPS, VPI, ListVPI,
MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV
]
with with
(Grammar = GrammarGer) ** (Grammar = GrammarGer) **
open open
@@ -12,8 +17,93 @@ concrete ExtendGer of Extend =
Prelude, Prelude,
ParadigmsGer in { ParadigmsGer in {
lincat
VPI = {s : Bool => Str} ;
[VPI] = {s1,s2 : Bool => Str} ;
VPS = {s : Order => Agr => Str} ;
[VPS] = {s1,s2 : Order => Agr => Str} ;
lin lin
InOrderToVP vp = {s = "um" ++ useInfVP False vp} ; InOrderToVP vp = {s = "um" ++ useInfVP False vp} ;
BaseVPI = twoTable Bool ;
ConsVPI = consrTable Bool comma ;
MkVPI vp = {s = \\b => useInfVP b vp} ;
ConjVPI = conjunctDistrTable Bool ;
ComplVPIVV v vpi =
-- insertInf (vpi.s ! v.isAux) (
insertInf {s=(vpi.s ! v.isAux);isAux=v.isAux;ctrl=SubjC} ( -- HL ??
predVGen v.isAux v) ; ----
BaseVPS = twoTable2 Order Agr ;
ConsVPS = consrTable2 Order Agr comma ;
PredVPS np vpi =
let
subj = np.s ! NPC Nom ++ bigNP np ;
agr = np.a ;
in {
s = \\o =>
let verb = vpi.s ! o ! agr
in case o of {
Main => subj ++ verb ;
Inv => verb ++ subj ; ---- älskar henne och sover jag
Sub => subj ++ verb
}
} ;
MkVPS tm p vp =
let vps = useVP vp in {
s = \\o,agr =>
let
ord = case o of {
Sub => True ; -- glue prefix to verb
_ => False
} ;
b = p.p ;
a = tm.a ;
t = tm.t ;
m = tm.m ;
subj = [] ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
-- obj1 = (vp.nn ! agr).p1 ;
-- obj = (vp.nn ! agr).p2 ;
-- compl = obj1 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ nonpronouns
obj2 = (vp.nn ! agr).p3 ; -- pp-objects
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
inf = vp.inf.s ++ verb.inf ++ verb.inf2 ;
extra = vp.ext ;
infE : Str = -- HL 30/6/2019
case <t,a,vp.isAux> of {
<Fut|Cond,Simul,True> => inf ; --# notpresent
<Fut|Cond,Anter,True> -- Duden 318: kommen wollen haben => haben kommen wollen --# notpresent
=> verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
<_,Anter,True> => inf ; --# notpresent
_ => verb.inf ++ verb.inf2 ++ vp.inf.s } ;
inffin : Str =
case <t,a,vp.isAux> of {
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
=> verb.fin ++ verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
<_,Anter,True> --# notpresent
=> verb.fin ++ inf ; -- double inf --# notpresent
_ => inf ++ verb.fin --- or just auxiliary vp
} ;
in
case o of {
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ infE ++ extra ;
Inv => verb.fin ++ subj ++ compl ++ vp.infExt ++ infE ++ extra ;
Sub => subj ++ compl ++ vp.infExt ++ inffin ++ extra
}
} ;
ConjVPS = conjunctDistrTable2 Order Agr ;
} }

View File

@@ -24620,6 +24620,7 @@ lin pienentyä_V = mkV {s = c52A "pienentyä"} ;
lin pienentää_V = mkV {s = c54A "pienentää"} ; lin pienentää_V = mkV {s = c54A "pienentää"} ;
lin pienetä_V = mkV {s = c72 "pienetä"} ; lin pienetä_V = mkV {s = c72 "pienetä"} ;
lin pieni_A = mkA (mkN {s = d26 "pieni"}) ; lin pieni_A = mkA (mkN {s = d26 "pieni"}) ;
lin pieni_N = mkN {s = d26 "pieni"} ;
lin pieniä_V = mkV {s = c61 "pieniä"} ; lin pieniä_V = mkV {s = c61 "pieniä"} ;
lin piennar_N = mkN {s = d49A "piennar"} ; lin piennar_N = mkN {s = d49A "piennar"} ;
lin pienoinen_N = mkN {s = d38 "pienoinen"} ; lin pienoinen_N = mkN {s = d38 "pienoinen"} ;

View File

@@ -24614,6 +24614,7 @@ fun pienentyä_V : V ;
fun pienentää_V : V ; fun pienentää_V : V ;
fun pienetä_V : V ; fun pienetä_V : V ;
fun pieni_A : A ; fun pieni_A : A ;
fun pieni_N : N ;
fun pieniä_V : V ; fun pieniä_V : V ;
fun piennar_N : N ; fun piennar_N : N ;
fun pienoinen_N : N ; fun pienoinen_N : N ;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,13 +8,14 @@ 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, MkVPS2, ConjVPS2, ComplVPS2, ReflVPS2, 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, ReflPossPron, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, ReflPossPron,
CompoundN, CompoundAP, AdvIsNP, CompoundN, CompoundAP, AdvIsNP,
UttAccNP UttAccNP,
A2VPSlash, N2VPSlash
] ]
with (Grammar = GrammarSwe) with (Grammar = GrammarSwe)
** **
@@ -75,6 +76,40 @@ in {
c2 = vp.c2 c2 = vp.c2
} ; } ;
N2VPSlash n2 =
let vp : CatSwe.VP = UseComp (CompCN (UseN2 n2)) ;
dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ;
in dummyVPS ** -- has necessary fields for VPSlash
vp ** -- has all the right fields except for c2
{c2 = n2.c2} ; -- has the right c2
A2VPSlash a2 =
let vp : CatSwe.VP = UseComp (CompAP (UseA2 a2)) ;
dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ;
in dummyVPS ** -- has necessary fields for VPSlash
vp ** -- has all the right fields except for c2
{c2 = a2.c2} ; -- has the right c2
N2VPSlash n2 =
let vp : CatSwe.VP = UseComp (CompCN (UseN2 n2)) ;
dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ;
in dummyVPS ** -- has necessary fields for VPSlash
vp ** -- has all the right fields except for c2
{c2 = n2.c2} ; -- has the right c2
A2VPSlash a2 =
let vp : CatSwe.VP = UseComp (CompAP (UseA2 a2)) ;
dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ;
in dummyVPS ** -- has necessary fields for VPSlash
vp ** -- has all the right fields except for c2
{c2 = a2.c2} ; -- has the right c2
lin UttVPShort vp = {s = infVP vp (agrP3 Utr Sg)} ; lin UttVPShort vp = {s = infVP vp (agrP3 Utr Sg)} ;
lincat lincat
@@ -152,11 +187,14 @@ in {
} ; } ;
c2 = vp.c2 c2 = vp.c2
} ; } ;
ComplVPS2 vps2 np = { ComplVPS2 vps2 np = {
s = \\o,a => vps2.s !o ! a ++ vps2.c2.s ++ np.s ! NPAcc s = \\o,a => vps2.s !o ! a ++ vps2.c2.s ++ np.s ! NPAcc
} ; } ;
ReflVPS2 vps2 rnp = {
s = \\o,a => vps2.s ! o ! a ++ vps2.c2.s ++ rnp.s ! a
} ;
ConjVPS2 c xs = conjunctDistrTable2 Order Agr c xs ** {c2 = xs.c2} ; ConjVPS2 c xs = conjunctDistrTable2 Order Agr c xs ** {c2 = xs.c2} ;
lincat lincat
@@ -248,7 +286,7 @@ lin BaseImp = twoTable2 Polarity Number ;
Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ; Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
ReflPossPron = M.mkQuant "sin" "sitt" "sina" ; ReflPossPron = M.mkQuant "sin" "sitt" "sina" ;
lin lin
ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ; ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ;