(Est) Improve interrogative agreement

This commit is contained in:
Inari Listenmaa
2022-05-02 20:39:03 +08:00
parent 263ee4319d
commit f1e14bbd5f
4 changed files with 36 additions and 38 deletions

View File

@@ -22,7 +22,7 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
QCl = {s : ResEst.Tense => Anteriority => Polarity => Str} ; QCl = {s : ResEst.Tense => Anteriority => Polarity => Str} ;
IP = ResEst.IPhrase ; IP = ResEst.IPhrase ;
IComp = {s : Agr => Str} ; IComp = {s : Agr => Str} ;
IDet = {s : Case => Str ; n : Number ; isNum : Bool} ; IDet = ResEst.IDeterminer ;
IQuant = {s : Number => Case => Str} ; IQuant = {s : Number => Case => Str} ;
-- Relative -- Relative
@@ -98,8 +98,8 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
NP = linNP (NPCase Nom) ; NP = linNP (NPCase Nom) ;
CN = linCN (NCase Sg Nom) ; CN = linCN (NCase Sg Nom) ;
V,VS,VQ = linV ; V,VS,VQ = linV ;
V2,VA,V2S,V2Q = linV2 ; V2,VA,V2S,V2Q,V3 = linV2 ;
IDet = linIDet ;
} }

View File

@@ -44,53 +44,48 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
postmod = ip.postmod ++ adv.s ; postmod = ip.postmod ++ adv.s ;
} ; } ;
-- The computation of $ncase$ is a special case of that in $NounEst.DetCN$, -- The computation of $IdetCN$ is a special case of that in $NounEst.DetCN$,
-- since we don't have possessive suffixes or definiteness. -- because the interrogative doesn't agree.
--- It could still be nice to have a common oper...
IdetCN idet cn = let n = idet.n in emptyIP ** { IdetCN idet cn = emptyIP ** {
s = \\c => s = \\c =>
let let
k : Case = npform2case n c ; k : Case = npform2case n c ;
icase : Case = Nom ; --case k of { --mis kassiga ncase : NForm = case <k,idet.isNum> of {
-- (Ess|Abess|Comit|Termin) => Gen ; <Nom, True> => NCase Sg Part ; -- TODO estonian example (Fin was "mitkä kolme kytkintä")
-- _ => k <_, True> => NCase Sg k ; -- TODO estonian example (Fin was "miksi kolmeksi kytkimeksi")
-- } ; _ => NCase n k -- TODO estonian example (Fin was "mitkä kytkimet")
ncase : NForm = case <icase,idet.isNum> of {
<Nom, True> => NCase Sg Part ; -- mitkä kolme kytkintä
<_, True> => NCase Sg k ; -- miksi kolmeksi kytkimeksi
_ => NCase n k -- mitkä kytkimet
} }
in in
idet.s ! icase ++ cn.s ! ncase ; idet.s ! Nom ++ -- mis
n = n idet.post ! k ++ -- kolme
} ; cn.s ! ncase ; -- kassi+ga
n = idet.n ; -- needed for agreement, "mis kolm kassi mängivad"
} where {
n : Number = case idet.isNum of {
True => Sg ;
False => idet.n } ;
} ;
IdetIP idet = let n = idet.n in emptyIP ** { IdetIP idet = let n = idet.n in emptyIP ** {
s = \\c => s = \\c =>
let let
k = npform2case n c ; k = npform2case n c ;
in in
idet.s ! k ; case idet.isNum of {
True => idet.s ! Nom ++ idet.post ! k ;
False => idet.s ! k ++ idet.post ! k
} ;
n = n n = n
} ; } ;
-- The quant and the num may be inflected in different cases:
IdetQuant idet num = -- * mis kolme koeraga, mis kolmega
let -- * millega
n = num.n ; -- * mille 3-ga (this would be the preferable output, but currently outputs "mis 3ga")
isn = num.isNum IdetQuant idet num = num ** {
in { s = \\c => idet.s ! num.n ! c ;
s = \\k => post = \\c => num.s ! Sg ! c ;
let
ncase = case <k,isn> of {
<Nom, True> => NCase Sg Part ; -- mitkä kolme kytkintä
<_, True> => NCase Sg k ; -- miksi kolmeksi kytkimeksi
_ => NCase n k -- mitkä kytkimet
}
in
idet.s ! n ! k ++ num.s ! Sg ! k ;
n = n ;
isNum = isn
} ; } ;
AdvIAdv i a = {s = i.s ++ a.s} ; AdvIAdv i a = {s = i.s ++ a.s} ;

View File

@@ -806,7 +806,9 @@ oper
isDef : Bool -- True (verb agrees in Pl, Nom is not Part) --I: actually, can we get rid of this? isDef : Bool -- True (verb agrees in Pl, Nom is not Part) --I: actually, can we get rid of this?
} ; } ;
IDeterminer : Type = {s : Case => Str ; n : Number ; isNum : Bool} ; IDeterminer : Type = {s, post : Case => Str ; n : Number ; isNum : Bool} ;
linIDet : IDeterminer -> Str = \idet -> idet.s ! Nom ++ idet.post ! Nom ;
heavyDet : PDet -> Determiner = \d -> d ** {sp = d.s} ; heavyDet : PDet -> Determiner = \d -> d ** {sp = d.s} ;
PDet : Type = { PDet : Type = {

View File

@@ -48,6 +48,7 @@ concrete StructuralEst of Structural = CatEst **
how8much_IAdv = ss "kui palju" ; how8much_IAdv = ss "kui palju" ;
how8many_IDet = { how8many_IDet = {
s = \\c => "kui" ++ (mkN "mitu" "mitme" "mitut" "TODO" "TODO" "TODO").s ! NCase Sg c ; s = \\c => "kui" ++ (mkN "mitu" "mitme" "mitut" "TODO" "TODO" "TODO").s ! NCase Sg c ;
post = \\c => [] ;
n = Sg ; n = Sg ;
isNum = False isNum = False
} ; } ;