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

View File

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

View File

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