(Est) 7 InfForms -> 2 stems + gluing suffixes

This commit is contained in:
Inari Listenmaa
2022-04-13 17:38:17 +08:00
parent b1b752673d
commit e8503511ca
8 changed files with 104 additions and 91 deletions

View File

@@ -82,8 +82,8 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
V, VS, VQ = Verb1 ; -- = {s : VForm => Str ; sc : Case} ; V, VS, VQ = Verb1 ; -- = {s : VForm => Str ; sc : Case} ;
V2, VA, V2Q, V2S = Verb2 ; V2, VA, V2Q, V2S = Verb2 ;
V2A, V3 = Verb3 ; V2A, V3 = Verb3 ;
VV = Verb1 ** {vi : InfForm} ; VV = Verb1 ** {vi : InfForms} ;
V2V = Verb2 ** {vi : InfForm} ; -- infinitive form V2V = Verb2 ** {vi : InfForms} ;
A = Adjective ** {infl : Infl} ; A = Adjective ** {infl : Infl} ;
A2 = A ** {c2 : Compl} ; A2 = A ** {c2 : Compl} ;

View File

@@ -142,6 +142,8 @@ oper
--verb = sverb2verbSep verb0 ; --verb = sverb2verbSep verb0 ;
vfin : ResEst.VForm -> Str = \f -> vfin : ResEst.VForm -> Str = \f ->
verb.s ! f ; verb.s ! f ;
vinf : ResEst.InfForms -> Str = \if ->
applyInfFormsV if verb.s ;
nounNounHeading : Parameter -> Parameter -> Str = \n1,n2 -> nounNounHeading : Parameter -> Parameter -> Str = \n1,n2 ->
(S.mkUtt (G.PossNP (S.mkCN n1) (S.mkNP n2))).s ; (S.mkUtt (G.PossNP (S.mkCN n1) (S.mkNP n2))).s ;
@@ -218,15 +220,16 @@ oper
heading3 (heading infinitive_Parameter) ++ heading3 (heading infinitive_Parameter) ++
frameTable ( frameTable (
tr (intagAttr "th" "rowspan=2" "da" ++ tr (intagAttr "th" "rowspan=2" "da" ++
th (heading nominative_Parameter) ++ td (vfin (Inf InfDa))) ++ th (heading nominative_Parameter) ++ td (vinf InfDa)) ++
tr (th (heading inessive_Parameter) ++ td (vfin (Inf InfDes))) ++ tr (th (heading inessive_Parameter) ++ td (vinf InfDes)) ++
tr (intagAttr "th" "rowspan=5" "ma" ++ tr (intagAttr "th" "rowspan=6" "ma" ++
th (heading illative_Parameter) ++ td (vfin (Inf InfMa))) ++ th (heading illative_Parameter) ++ td (vinf InfMa)) ++
tr (th (heading inessive_Parameter) ++ td (vfin (Inf InfMas))) ++ tr (th (heading inessive_Parameter) ++ td (vinf InfMas)) ++
tr (th (heading elative_Parameter) ++ td (vfin (Inf InfMast))) ++ tr (th (heading elative_Parameter) ++ td (vinf InfMast)) ++
tr (th (heading abessive_Parameter) ++ td (vfin (Inf InfMata))) ++ tr (th (heading abessive_Parameter) ++ td (vinf InfMata)) ++
tr (th (heading translative_Parameter) ++ td (vfin (Inf InfMaks))) tr (th (heading abessive_Parameter) ++ td (vinf InfMaks)) ++
tr (th (heading translative_Parameter) ++ td (vinf InfMine))
) ++ ) ++
heading3 (heading participle_Parameter) ++ heading3 (heading participle_Parameter) ++

View File

@@ -40,7 +40,7 @@ concrete ExtendEst of Extend =
Prelude, Prelude,
MorphoEst, MorphoEst,
LexiconEst, LexiconEst,
ParadigmsEst in { ParadigmsEst in {
--------------------------------- ---------------------------------
-- VPS, VPI, VPS2 + list versions -- VPS, VPI, VPS2 + list versions
@@ -176,7 +176,7 @@ concrete ExtendEst of Extend =
A2VPSlash a2 = UseComp (CompAP (UseA2 a2)) ** {c2 = a2.c2} ; A2VPSlash a2 = UseComp (CompAP (UseA2 a2)) ** {c2 = a2.c2} ;
-- : VP -> Adv ; -- : VP -> Adv ;
ByVP vp = {s = vp2adv vp True (VIInf InfDes)} ; ByVP = GerundAdv ;
--------------------------------- ---------------------------------
-- C -- C
@@ -220,15 +220,8 @@ concrete ExtendEst of Extend =
lin lin
{- TODO: need to change VP to get EmbedPresPart and various Gerunds to work: -- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore) / ___ga abielus olemine,
1) Add "mine" form into VP (or switch to a BIND solution and just add a stem) EmbedPresPart vp = {s = infVP (NPCase Gen) Pos (agrP3 Sg) vp InfMine } ;
2) Change s2 in VP so that we can manipulate the complement to be in genitive!
-- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore)
EmbedPresPart vp =
let vpGen = vp ; --** { s2 = \\_,_,_ => vp.s2 ! True ! Pos ! }
{s = vp2adv vp True VI } ;
-}
EmbedSSlash s = {s = s.s ++ s.c2.s} ; EmbedSSlash s = {s = s.s ++ s.c2.s} ;
@@ -302,14 +295,13 @@ concrete ExtendEst of Extend =
GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ; GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ;
-- : VP -> Adv -- : VP -> Adv
GerundAdv vp = {s = vp2adv vp True (VIInf InfDes)} ; GerundAdv vp = {s = infVPdefault vp InfDes} ;
-- : VP -> CN -- publishing of the document (can get a determiner) -- : VP -> CN -- publishing of the document (can get a determiner)
-- GerundCN vp = {} ; GerundCN vp = {s = \\nf => infVPdefault vp InfMine} ;
-- : VP -> NP -- publishing the document (by nature definite) -- : VP -> NP -- publishing the document (by nature definite)
-- GerundNP vp = {} ; GerundNP vp = MassNP (GerundCN vp) ;
--------------------------------- ---------------------------------
-- I - N -- I - N
@@ -322,9 +314,8 @@ concrete ExtendEst of Extend =
-- : Adv -> IAdv ; -- "how often" -- : Adv -> IAdv ; -- "how often"
IAdvAdv adv = { s = "kui" ++ adv.s } ; IAdvAdv adv = { s = "kui" ++ adv.s } ;
-- : VP -> Adv -- : VP -> Adv -- et raamatut paremini näha
InOrderToVP vp = -- et raamatut paremini näha InOrderToVP vp = {s = "et" ++ infVPdefault vp InfDa} ;
{ s = "et" ++ vp2adv vp True (VIInf InfDa) } ;
-- : N2 -> VPSlash -- : N2 -> VPSlash
N2VPSlash n2 = UseComp (CompCN (UseN2 n2)) ** {c2 = n2.c2} ; N2VPSlash n2 = UseComp (CompCN (UseN2 n2)) ** {c2 = n2.c2} ;
@@ -380,7 +371,7 @@ concrete ExtendEst of Extend =
in existClause noSubj (agrP3 Sg) heaOlla ; in existClause noSubj (agrP3 Sg) heaOlla ;
-- : IAdv -> VP -> QCl ; -- how to walk? -- : IAdv -> VP -> QCl ; -- how to walk?
PredIAdvVP iadv vp = {s = \\t,a,p => iadv.s ++ vp2adv vp True (VIInf InfMa)} ; PredIAdvVP iadv vp = {s = \\t,a,p => iadv.s ++ infVPdefault vp InfMa} ;
PrepCN prep cn = PrepNP prep (MassNP cn) ; PrepCN prep cn = PrepNP prep (MassNP cn) ;
@@ -391,12 +382,19 @@ concrete ExtendEst of Extend =
PurposeVP = InOrderToVP ; --- is there a difference? PurposeVP = InOrderToVP ; --- is there a difference?
oper oper
-- calling infVP with the "default arguments": NPCase Nom, Pos, agrP3 Sg
infVPdefault : VP -> InfForms -> Str = infVP (NPCase Nom) Pos (agrP3 Sg) ;
vp2adv : R.VP -> Bool -> VIForm -> Str = \vp,sentIsPos,vif -> vp2adv : R.VP -> Bool -> VIForm -> Str = \vp,sentIsPos,vif ->
vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut let vpforms : {fin,inf : Str} = case vif of {
++ vp.adv -- paremini VIInf if => applyInfFormsVP {stem=if ; suf="a"} vp ; --- this oper shouldn't be used if you want to use an InfForm but just trying to be robust here
++ vp.p -- ära _ => mkVPForms vp.v ! vif ! Simul ! Pos ! agrP3 Sg} ;
++ (mkVPForms vp.v ! vif ! Simul ! Pos ! agrP3 Sg).fin -- tunda/tundes/tundmata/... in vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut
++ vp.ext ; ++ vp.adv -- paremini
++ vp.p -- ära
++ vpforms.fin -- tunda/tundes/tundmata/...
++ vpforms.inf -- TODO is this necessary???
++ vp.ext ;
--------------------------------- ---------------------------------
-- S - W -- S - W
@@ -415,14 +413,11 @@ concrete ExtendEst of Extend =
UttDatIP ip = {s = ip.s ! NPCase Part} ; -- is partitive a reasonable translation? UttDatIP ip = {s = ip.s ! NPCase Part} ; -- is partitive a reasonable translation?
UttDatNP np = {s = np.s ! NPCase Part} ; UttDatNP np = {s = np.s ! NPCase Part} ;
-- : VP -> Utt ; -- There's no "short form", so just using InfMa instead of InfDa -- : VP -> Utt ; -- There's no "short form", so just using InfDa instead of InfMa
UttVPShort vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfMa} ; UttVPShort vp = {s = infVPdefault vp InfDa} ;
--TODO: maybe InfMa should be default in PhraseEst and InfDa here?
-- : VP -> Adv ; -- ilma raamatut nägemata
WithoutVP vp = {s = "ilma" ++ infVPdefault vp InfMata} ;
WithoutVP vp = -- ilma raamatut nägemata
{ s = "ilma" ++ vp2adv vp False (VIInf InfMata) } ;
} }

View File

@@ -27,18 +27,24 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
lin CN { s = \\nf => np.s ! NPCase c ++ cn.s ! nf } ; lin CN { s = \\nf => np.s ! NPCase c ++ cn.s ! nf } ;
lincat lincat
VPI = {s : InfForm => Str} ; VPI = {s : InfStem => Str} ;
[VPI] = {s1,s2 : InfForm => Str} ; [VPI] = {s1,s2 : InfStem => Str} ;
-- VPI = {s : Str} ; -- VPI = {s : Str} ;
-- [VPI] = {s1,s2 : Str} ; -- [VPI] = {s1,s2 : Str} ;
lin lin
BaseVPI = twoTable InfForm ; BaseVPI = twoTable InfStem ;
ConsVPI = consrTable InfForm comma ; ConsVPI = consrTable InfStem comma ;
MkVPI vp = {s = \\i => infVP (NPCase Nom) Pos (agrP3 Sg) vp i} ; MkVPI vp = {s = \\i => infVPIF (NPCase Nom) Pos (agrP3 Sg) vp i} ;
ConjVPI = conjunctDistrTable InfForm ; ConjVPI = conjunctDistrTable InfStem ;
ComplVPIVV vv vpi = ComplVPIVV vv vpi =
insertObj (\\_,_,_ => vpi.s ! vv.vi) (predV vv) ; insertObj (\\_,_,_ => vpi.s ! vv.vi.stem) (predV vv) ;
oper
-- Version that uses InfStem
infVPIF : NPForm -> Polarity -> Agr -> VP -> InfStem -> Str = \sc,pol,agr,vp,if ->
infVPAnt Simul sc pol agr vp {stem=if ; suf="a"} ;
lincat lincat
VPS = { VPS = {

View File

@@ -41,18 +41,10 @@ concrete IdiomEst of Idiom = CatEst **
GenericCl vp = mkClause noSubj (agrP3 Sg) (passiveVP vp) ; GenericCl vp = mkClause noSubj (agrP3 Sg) (passiveVP vp) ;
ProgrVP vp = ProgrVP vp = vp ** {
let v = verbOlema ;
inf = (mkVPForms vp.v ! VIInf InfMas ! Simul ! Pos ! agrP3 Sg).fin ; s2 = \\b,p,a => vp.s2 ! b ! p ! a ++ (applyInfFormsVP InfMas vp).fin ;
on = predV olla } ;
in {
v = verbOlema ;
s2 = \\b,p,a => vp.s2 ! b ! p ! a ++ inf ;
adv = vp.adv ;
p = vp.p ;
ext = vp.ext ;
sc = vp.sc ;
} ;
-- This gives "otetaan oluet" instead of "ottakaamme oluet". -- This gives "otetaan oluet" instead of "ottakaamme oluet".
-- The imperative is not available in a $VP$. -- The imperative is not available in a $VP$.

View File

@@ -27,6 +27,7 @@ resource ParadigmsEst = open
(Predef=Predef), (Predef=Predef),
Prelude, Prelude,
MorphoEst, MorphoEst,
(ResEst=ResEst),
HjkEst, HjkEst,
CatEst CatEst
in { in {
@@ -62,6 +63,8 @@ oper
abessive : Case ; -- e.g. "karbita" abessive : Case ; -- e.g. "karbita"
comitative : Case ; -- e.g. "karbiga" comitative : Case ; -- e.g. "karbiga"
InfForm : Type ;
infDa : InfForm ; -- e.g. "lugeda" infDa : InfForm ; -- e.g. "lugeda"
infDes : InfForm ; -- e.g. "lugedes" infDes : InfForm ; -- e.g. "lugedes"
infMa : InfForm ; -- e.g. "lugema" infMa : InfForm ; -- e.g. "lugema"
@@ -69,6 +72,7 @@ oper
infMaks : InfForm ; -- e.g. "lugemaks" infMaks : InfForm ; -- e.g. "lugemaks"
infMast : InfForm ; -- e.g. "lugemast" infMast : InfForm ; -- e.g. "lugemast"
infMata : InfForm ; -- e.g. "lugemata" infMata : InfForm ; -- e.g. "lugemata"
infMine : InfForm ; -- e.g. "lugemine"
-- The following type is used for defining *rection*, i.e. complements -- The following type is used for defining *rection*, i.e. complements
-- of many-place verbs and adjective. A complement can be defined by -- of many-place verbs and adjective. A complement can be defined by
@@ -293,8 +297,10 @@ oper
abessive = Abess ; abessive = Abess ;
comitative = Comit ; comitative = Comit ;
-- combination of stem + suffix, e.g. infDes = {stem = InfD ; suf = "es"} ;
InfForm = ResEst.InfForms ;
infDa = InfDa ; infMa = InfMa ; infMast = InfMast ; infDa = InfDa ; infMa = InfMa ; infMast = InfMast ;
infDes = InfDes ; infMas = InfMas ; infMaks = InfMaks ; infMata = InfMata ; infDes = InfDes ; infMas = InfMas ; infMaks = InfMaks ; infMata = InfMata ; infMine = InfMine ;
prePrep : Case -> Str -> Prep = prePrep : Case -> Str -> Prep =
\c,p -> {c = NPCase c ; s = p ; isPre = True ; lock_Prep = <>} ; \c,p -> {c = NPCase c ; s = p ; isPre = True ; lock_Prep = <>} ;
@@ -856,7 +862,7 @@ oper
mkVV : V -> VV = \v -> mkVVf v infDa ; mkVV : V -> VV = \v -> mkVVf v infDa ;
mkVV : Str -> VV = \str -> mkVVf (mkV str) infDa ; mkVV : Str -> VV = \str -> mkVVf (mkV str) infDa ;
} ; } ;
mkVVf v f = v ** {vi = f ; lock_VV = <>} ; mkVVf v f = lin VV (v ** {vi = f}) ;
mkVQ = overload { mkVQ = overload {
mkVQ : V -> VQ = \v -> v ** {lock_VQ = <>} ; mkVQ : V -> VQ = \v -> v ** {lock_VQ = <>} ;
mkVQ : Str -> VQ = \str -> (mkV str) ** {lock_VQ = <>} ; mkVQ : Str -> VQ = \str -> (mkV str) ** {lock_VQ = <>} ;

View File

@@ -12,7 +12,7 @@ concrete PhraseEst of Phrase = CatEst ** open ResEst, (P = Prelude) in {
UttIP ip = {s = ip.s ! NPCase Nom} ; UttIP ip = {s = ip.s ! NPCase Nom} ;
UttIAdv iadv = iadv ; UttIAdv iadv = iadv ;
UttNP np = {s = np.s ! NPCase Nom} ; UttNP np = {s = np.s ! NPCase Nom} ;
UttVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfDa} ; UttVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfMa} ;
UttAdv adv = adv ; UttAdv adv = adv ;
UttCN np = {s = np.s ! NCase Sg Nom} ; UttCN np = {s = np.s ! NCase Sg Nom} ;
UttAP np = {s = np.s ! P.False ! NCase Sg Nom} ; UttAP np = {s = np.s ! P.False ! NCase Sg Nom} ;

View File

@@ -81,7 +81,7 @@ oper
param param
VForm = VForm =
Inf InfForm Inf InfStem
| Presn Number Person | Presn Number Person
| Impf Number Person | Impf Number Person
| Condit Number Person | Condit Number Person
@@ -99,16 +99,32 @@ param
Voice = Act | Pass ; Voice = Act | Pass ;
InfForm = InfStem =
InfDa -- lugeda InfD -- luge+da/des, but can be irregular: tulla, tulles
| InfDes -- lugedes | InfM -- lugema/mas/mast/maks/mata/mine
| InfMa -- lugema
| InfMas -- lugemas
| InfMast -- lugemast
| InfMata -- lugemata
| InfMaks -- lugemaks
; ;
oper
InfForms : Type = {stem : InfStem ; suf : Str} ;
InfDa, InfDes, InfMa, InfMas, InfMast, InfMata, InfMaks, InfMine : InfForms ;
InfDa = {stem = InfD ; suf = "a"} ; -- lugeda
InfDes = {stem = InfD ; suf = "es"} ; -- lugedes
InfMa = {stem = InfM ; suf = "a"} ; -- lugema
InfMas = {stem = InfM ; suf = "as"} ; -- lugemas
InfMast = {stem = InfM ; suf = "ast"} ; -- lugemast
InfMata = {stem = InfM ; suf = "ata"} ; -- lugemata
InfMaks = {stem = InfM ; suf = "aks"} ; -- lugemaks
InfMine = {stem = InfM ; suf = "ine"} ; -- lugemine
applyInfFormsVP : InfForms -> VP -> {fin,inf : Str} = \if,vp ->
let vpforms : VPForms = mkVPForms vp.v ;
stemOnly : {fin,inf : Str} = vpforms ! VIInf if.stem ! Simul ! Pos ! agrP3 Sg ;
in stemOnly ** {fin = glue stemOnly.fin if.suf} ; -- Despite the name, the infinite form is in the "fin" field, "inf" contains participle
applyInfFormsV : InfForms -> (VForm => Str) -> Str = \if,vf ->
glue (vf ! Inf if.stem) if.suf ;
param
SType = SDecl | SQuest | SInv ; SType = SDecl | SQuest | SInv ;
--2 For $Relative$ --2 For $Relative$
@@ -180,13 +196,12 @@ param
Verb2 : Type = Verb1 ** {c2 : Compl} ; Verb2 : Type = Verb1 ** {c2 : Compl} ;
Verb3 : Type = Verb2 ** {c3 : Compl} ; Verb3 : Type = Verb2 ** {c3 : Compl} ;
linV : Verb -> Str = \v -> v.s ! Inf InfMa ++ v.p ; linV2, linV : Verb -> Str = \v -> applyInfFormsV InfMa v.s ++ v.p ;
linV2 : Verb -> Str = \v -> v.s ! Inf InfMa ++ v.p ;
param param
VIForm = VIForm =
VIFin Tense VIFin Tense
| VIInf InfForm | VIInf InfStem
| VIPass Tense | VIPass Tense
| VIPresPart | VIPresPart
| VIImper | VIImper
@@ -276,7 +291,7 @@ oper
} ; } ;
predV : Verb1 -> VP = \verb -> { predV : Verb1 -> VP = \verb -> {
v = verb ; -- ignoring the subject v = verb ; -- ignoring the subject case of Verb, it is stored in VP.sc later
s2 = \\_,_,_ => [] ; s2 = \\_,_,_ => [] ;
adv = [] ; adv = [] ;
ext = [] ; --relative clause ext = [] ; --relative clause
@@ -405,17 +420,18 @@ oper
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b -> subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
appCompl False b {s = [] ; c = sc ; isPre = True} np ; appCompl False b {s = [] ; c = sc ; isPre = True} np ;
infVP : NPForm -> Polarity -> Agr -> VP -> InfForm -> Str = infVPAnt Simul ; infVP : NPForm -> Polarity -> Agr -> VP -> InfForms -> Str = infVPAnt Simul ;
infVPAnt : Anteriority -> NPForm -> Polarity -> Agr -> VP -> InfForm -> Str = infVPAnt : Anteriority -> NPForm -> Polarity -> Agr -> VP -> InfForms -> Str =
\ant,sc,pol,agr,vp,vi -> \ant,sc,pol,agr,vp,vi ->
let let
fin = case sc of { -- subject case complCase = case sc of { -- choosing case for the complement. sometimes this function is called so that sc is the VP's subject case, but other times it's some other form.
NPCase Nom => True ; -- mina tahan joosta NPCase Nom => True ;
_ => False -- minul peab auto olema _ => False
} ; } ;
verb = mkVPForms vp.v ! VIInf vi ! ant ! Pos ! agr ; -- no "ei" verbStem = mkVPForms vp.v ! VIInf vi.stem ! ant ! Pos ! agr ; -- no "ei"
compl = vp.s2 ! fin ! pol ! agr ; -- but compl. case propagated verb = verbStem ** {fin = glue verbStem.fin vi.suf} ;
compl = vp.s2 ! complCase ! pol ! agr ; -- but compl. case propagated
adv = vp.adv adv = vp.adv
in in
-- inverted word order; e.g. -- inverted word order; e.g.
@@ -512,8 +528,8 @@ oper
tulgu = (init tulge) + "u" ; tulgu = (init tulge) + "u" ;
in in
{s = table { {s = table {
Inf InfDa => tulla ; Inf InfD => tull_ ;
Inf InfDes => tulles ; Inf InfM => init tulema ;
Presn Sg P1 => tule_ + "n" ; Presn Sg P1 => tule_ + "n" ;
Presn Sg P2 => tule_ + "d" ; Presn Sg P2 => tule_ + "d" ;
Presn Sg P3 => tuleb ; Presn Sg P3 => tuleb ;
@@ -547,12 +563,7 @@ oper
PresPart Act => laulev ; PresPart Act => laulev ;
PresPart Pass => tuld_ + "av" ; --d or t PresPart Pass => tuld_ + "av" ; --d or t
PastPart Act => tulnud ; PastPart Act => tulnud ;
PastPart Pass => tuldud ; PastPart Pass => tuldud
Inf InfMa => tulema ;
Inf InfMas => tulema + "s" ;
Inf InfMast => tulema + "st" ;
Inf InfMata => tulema + "ta" ;
Inf InfMaks => tulema + "ks"
} ; } ;
sc = NPCase Nom ; sc = NPCase Nom ;
p = [] p = []