mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
(Est) Improve interrogative agreement
This commit is contained in:
@@ -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 ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,53 +44,48 @@ 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
|
||||
k : Case = npform2case n c ;
|
||||
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 ** {
|
||||
s = \\c =>
|
||||
let
|
||||
k = npform2case n c ;
|
||||
in
|
||||
idet.s ! k ;
|
||||
case idet.isNum of {
|
||||
True => idet.s ! Nom ++ idet.post ! k ;
|
||||
False => idet.s ! k ++ idet.post ! k
|
||||
} ;
|
||||
|
||||
n = n
|
||||
} ;
|
||||
|
||||
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
|
||||
-- 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} ;
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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
|
||||
} ;
|
||||
|
||||
Reference in New Issue
Block a user