mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
(Est) Remove param SType from Cl
unnecessary apram, can form question by adding string "kas" when needed
This commit is contained in:
@@ -13,7 +13,7 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
|
|||||||
|
|
||||||
-- Sentence
|
-- Sentence
|
||||||
|
|
||||||
Cl = {s : ResEst.Tense => Anteriority => Polarity => SType => Str} ;
|
Cl = {s : ResEst.Tense => Anteriority => Polarity => Str} ;
|
||||||
ClSlash = {s : ResEst.Tense => Anteriority => Polarity => Str ; c2 : Compl} ;
|
ClSlash = {s : ResEst.Tense => Anteriority => Polarity => Str ; c2 : Compl} ;
|
||||||
Imp = {s : Polarity => Agr => Str} ;
|
Imp = {s : Polarity => Agr => Str} ;
|
||||||
|
|
||||||
|
|||||||
@@ -260,12 +260,12 @@ concrete ExtendEst of Extend =
|
|||||||
-- : NP -> VS -> Utt -> Cl ; -- "I am here", she said
|
-- : NP -> VS -> Utt -> Cl ; -- "I am here", she said
|
||||||
FrontComplDirectVS np vs utt =
|
FrontComplDirectVS np vs utt =
|
||||||
let cl : Cl = PredVP np (UseV vs) ;
|
let cl : Cl = PredVP np (UseV vs) ;
|
||||||
in cl ** {s = \\t,a,p,o => utt.s ++ bindComma ++ cl.s ! t ! a ! p ! o} ;
|
in cl ** {s = \\t,a,p => utt.s ++ bindComma ++ cl.s ! t ! a ! p} ;
|
||||||
|
|
||||||
-- : NP -> VQ -> Utt -> Cl ; -- "where", she asked
|
-- : NP -> VQ -> Utt -> Cl ; -- "where", she asked
|
||||||
FrontComplDirectVQ np vq utt =
|
FrontComplDirectVQ np vq utt =
|
||||||
let cl : Cl = PredVP np (UseV vq) ;
|
let cl : Cl = PredVP np (UseV vq) ;
|
||||||
in cl ** {s = \\t,a,p,o => utt.s ++ bindComma ++ cl.s ! t ! a ! p ! o} ;
|
in cl ** {s = \\t,a,p => utt.s ++ bindComma ++ cl.s ! t ! a ! p} ;
|
||||||
|
|
||||||
|
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
|
|||||||
(\\_,b,_ => linNP (NPCase Nom) np)
|
(\\_,b,_ => linNP (NPCase Nom) np)
|
||||||
(predV (verbOlema ** {sc = NPCase Nom}))) ;
|
(predV (verbOlema ** {sc = NPCase Nom}))) ;
|
||||||
in
|
in
|
||||||
cl.s ! t ! ant ! bo ! SDecl ;
|
cl.s ! t ! ant ! bo ;
|
||||||
c = NPCase Nom
|
c = NPCase Nom
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -144,18 +144,20 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
|
|||||||
(\\_,b,_ => linNP (NPCase Nom) np) (predV v)) ;
|
(\\_,b,_ => linNP (NPCase Nom) np) (predV v)) ;
|
||||||
|
|
||||||
ICompExistNP adv np =
|
ICompExistNP adv np =
|
||||||
let cl = mkClause (\_ -> adv.s ! np.a) np.a (insertObj
|
let subj : Polarity -> Str = \_ -> adv.s ! np.a ;
|
||||||
(\\_,b,_ => linNP (NPCase Nom) np) (predV (verbOlema ** {sc = NPCase Nom}))) ;
|
pred : VP = insertObj
|
||||||
in {
|
(\\_,b,_ => linNP (NPCase Nom) np)
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
(predV (verbOlema ** {sc = NPCase Nom})) ;
|
||||||
} ;
|
in mkClause subj np.a pred ;
|
||||||
|
|
||||||
|
|
||||||
IAdvPredNP iadv v np =
|
IAdvPredNP iadv v np =
|
||||||
let cl = mkClause (\_ -> iadv.s) np.a (insertObj
|
let subj : Polarity -> Str = \_ -> iadv.s ;
|
||||||
(\\_,b,_ => linNP v.sc np) (predV v)) ;
|
pred : VP = insertObj
|
||||||
in {
|
(\\_,b,_ => linNP v.sc np)
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
(predV v) ;
|
||||||
} ;
|
in mkClause subj np.a pred ;
|
||||||
|
|
||||||
|
|
||||||
-- i_implicPron = mkPronoun [] "minun" "minua" "minuna" "minuun" Sg P1 ;
|
-- i_implicPron = mkPronoun [] "minun" "minua" "minuna" "minuun" Sg P1 ;
|
||||||
whatPart_IP = emptyIP ** {
|
whatPart_IP = emptyIP ** {
|
||||||
|
|||||||
@@ -5,23 +5,17 @@ concrete IdiomEst of Idiom = CatEst **
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
let
|
let cas : Polarity -> NPForm = \p -> case p of {
|
||||||
cas : Polarity -> NPForm = \p -> case p of {
|
Pos => NPCase Nom ; -- on olemas lammas
|
||||||
Pos => NPCase Nom ; -- on olemas lammas
|
Neg => NPCase Part } ; -- ei ole olemas lammast
|
||||||
Neg => NPCase Part -- ei ole olemas lammast
|
vp = insertObj (\\_,b,_ => "olemas" ++ linNP (cas b) np) (predV olla)
|
||||||
} ;
|
in existClause noSubj (agrP3 Sg) vp ;
|
||||||
vp = insertObj (\\_,b,_ => "olemas" ++ linNP (cas b) np) (predV olla)
|
|
||||||
in
|
|
||||||
existClause noSubj (agrP3 Sg) vp ;
|
|
||||||
|
|
||||||
ExistIP ip =
|
ExistIP ip =
|
||||||
let
|
let cas : NPForm = NPCase Nom ; ---- also partitive in Extra
|
||||||
cas : NPForm = NPCase Nom ; ---- also partitive in Extra
|
vp : VP = insertObj (\\_,b,_ => "olemas") (predV olla) ;
|
||||||
vp = insertObj (\\_,b,_ => "olemas") (predV olla) ;
|
subj : NP = ip ** {isPron = False ; a = agrP3 ip.n} ;
|
||||||
cl = existClause (subjForm (ip ** {isPron = False ; a = agrP3 ip.n}) cas) (agrP3 Sg) vp
|
in existClause (subjForm subj cas) (agrP3 Sg) vp ;
|
||||||
in {
|
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- Notice the nominative in the cleft $NP$: "se on Matti josta Liisa pitää"
|
-- Notice the nominative in the cleft $NP$: "se on Matti josta Liisa pitää"
|
||||||
-- Est: "see on Mati, kellest Liis lugu peab"
|
-- Est: "see on Mati, kellest Liis lugu peab"
|
||||||
|
|||||||
@@ -5,15 +5,10 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
QuestCl cl = {
|
QuestCl cl = {
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SQuest
|
s = \\t,a,p => "kas" ++ cl.s ! t ! a ! p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestVP ip vp =
|
QuestVP ip vp = mkClause (subjForm (ip ** {isPron = False ; a = agrP3 ip.n}) vp.sc) (agrP3 ip.n) vp ;
|
||||||
let
|
|
||||||
cl = mkClause (subjForm (ip ** {isPron = False ; a = agrP3 ip.n}) vp.sc) (agrP3 ip.n) vp
|
|
||||||
in {
|
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
|
||||||
} ;
|
|
||||||
|
|
||||||
QuestSlash ip slash = {
|
QuestSlash ip slash = {
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
@@ -25,7 +20,7 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestIAdv iadv cl = {
|
QuestIAdv iadv cl = {
|
||||||
s = \\t,a,p => iadv.s ++ cl.s ! t ! a ! p ! SDecl
|
s = \\t,a,p => iadv.s ++ cl.s ! t ! a ! p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestIComp icomp np = {
|
QuestIComp icomp np = {
|
||||||
@@ -34,7 +29,7 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
|
|||||||
vp = predV (verbOlema ** {sc = NPCase Nom}) ;
|
vp = predV (verbOlema ** {sc = NPCase Nom}) ;
|
||||||
cl = mkClause (subjForm np vp.sc) np.a vp ;
|
cl = mkClause (subjForm np vp.sc) np.a vp ;
|
||||||
in
|
in
|
||||||
icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl
|
icomp.s ! np.a ++ cl.s ! t ! a ! p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PrepIP p ip = {s =
|
PrepIP p ip = {s =
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ concrete RelativeEst of Relative = CatEst ** open Prelude, ResEst, MorphoEst in
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
RelCl cl = {
|
RelCl cl = {
|
||||||
s = \\t,a,p,_ => "nii" ++ "et" ++ cl.s ! t ! a ! p ! SDecl ;
|
s = \\t,a,p,_ => "nii" ++ "et" ++ cl.s ! t ! a ! p ;
|
||||||
---- sellainen
|
---- sellainen
|
||||||
c = NPCase Nom
|
c = NPCase Nom
|
||||||
} ;
|
} ;
|
||||||
@@ -23,7 +23,7 @@ concrete RelativeEst of Relative = CatEst ** open Prelude, ResEst, MorphoEst in
|
|||||||
vp.sc)
|
vp.sc)
|
||||||
agr vp
|
agr vp
|
||||||
in
|
in
|
||||||
cl.s ! t ! ant ! b ! SDecl ;
|
cl.s ! t ! ant ! b ;
|
||||||
c = NPCase Nom
|
c = NPCase Nom
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -180,8 +180,6 @@ oper
|
|||||||
glue (vf ! Inf if.stem) if.suf ;
|
glue (vf ! Inf if.stem) if.suf ;
|
||||||
|
|
||||||
param
|
param
|
||||||
SType = SDecl | SQuest | SInv ;
|
|
||||||
|
|
||||||
--2 For $Relative$
|
--2 For $Relative$
|
||||||
|
|
||||||
RAgr = RNoAg | RAg Agr ;
|
RAgr = RNoAg | RAg Agr ;
|
||||||
@@ -365,51 +363,34 @@ oper
|
|||||||
-- For $Sentence$.
|
-- For $Sentence$.
|
||||||
|
|
||||||
Clause : Type = {
|
Clause : Type = {
|
||||||
s : Tense => Anteriority => Polarity => SType => Str
|
s : Tense => Anteriority => Polarity => Str
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ClausePlus : Type = {
|
ClausePlus : Type = {
|
||||||
s : Tense => Anteriority => Polarity => {subj,fin,inf,compl,adv,p,ext : Str}
|
s : Tense => Anteriority => Polarity => {subj,fin,inf,compl,adv,p,ext : Str}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- The Finnish version of SQuest featured a word order change and
|
|
||||||
-- the question particle "ko". The Estonian version just prefixes the
|
|
||||||
-- declarative sentence with the yes/no-queryword "kas".
|
|
||||||
-- SQuest: "kas" + SDecl
|
|
||||||
-- It would be also correct to use the Finnish structure, just without the ko-particle.
|
|
||||||
-- Inari: added a third SType, SInv.
|
|
||||||
-- Not sure if SInv is needed, but keeping it for possible future use.
|
|
||||||
-- There's need for an inverted word order with auxiliary verbs; infVP handles that. ComplVV calls infVP, which inverts the word order for the complement VP, and puts it into the resulting VP's `compl' field.
|
|
||||||
-- SInv made by mkClause would be for cases where you just need to construct an inverted word order, and then call it from some other place; application grammar (TODO: api oper for SType) or ExtraEst.
|
|
||||||
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
|
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
|
||||||
{ s = \\t,a,b =>
|
{ s = \\t,a,b =>
|
||||||
let
|
let
|
||||||
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
|
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
|
||||||
-- saan sinust aru 0
|
|
||||||
-- ma olen täna sinust aru saanud
|
|
||||||
declCl = c.subj ++ c.fin ++ c.adv ++ c.compl ++ c.p ++ c.inf ++ c.ext ;
|
|
||||||
-- [sind näha] 0 tahtnud
|
|
||||||
-- täna olen ma sinust aru saanud
|
|
||||||
invCl = c.adv ++ c.fin ++ c.subj ++ c.compl ++ c.p ++ c.inf ++ c.ext
|
|
||||||
in
|
in
|
||||||
table {
|
-- saan sinust aru
|
||||||
SDecl => declCl ;
|
-- ma olen täna sinust aru saanud
|
||||||
SQuest => "kas" ++ declCl ;
|
c.subj ++ c.fin ++ c.adv ++ c.compl ++ c.p ++ c.inf ++ c.ext ;
|
||||||
SInv => invCl
|
} ;
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
existClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
|
existClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
|
||||||
{ s = \\t,a,b =>
|
{ s = \\t,a,b =>
|
||||||
let
|
let
|
||||||
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
|
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
|
||||||
-- (mis) on olnud olemas (lammas)
|
|
||||||
declCl = c.subj ++ c.fin ++ c.inf ++ c.compl ;
|
|
||||||
in
|
in
|
||||||
table {
|
-- c.subj ++ c.fin ++ c.inf ++ c.compl ;
|
||||||
SQuest => "kas" ++ declCl ;
|
-- saan sinust aru
|
||||||
_ => declCl
|
-- ma olen täna sinust aru saanud
|
||||||
}
|
-- (mis) on olnud täna olemas …
|
||||||
|
c.subj ++ c.fin ++ c.inf ++ c.adv ++ c.p ++ c.compl ++ c.ext ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkClausePlus : (Polarity -> Str) -> Agr -> VP -> ClausePlus =
|
mkClausePlus : (Polarity -> Str) -> Agr -> VP -> ClausePlus =
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in {
|
|||||||
|
|
||||||
-- The object case is formed at the use site of $c2$, in $Relative$ and $Question$.
|
-- The object case is formed at the use site of $c2$, in $Relative$ and $Question$.
|
||||||
|
|
||||||
SlashVP np vp = {
|
SlashVP np vp = mkClause (subjForm np vp.sc) np.a vp ** {
|
||||||
s = \\t,a,p => (mkClause (subjForm np vp.sc) np.a vp).s ! t ! a ! p ! SDecl ;
|
|
||||||
c2 = vp.c2
|
c2 = vp.c2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -29,26 +28,23 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in {
|
|||||||
c2 = slash.c2
|
c2 = slash.c2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashPrep cl prep = {
|
SlashPrep cl prep = cl ** {
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl ;
|
|
||||||
c2 = prep
|
c2 = prep
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashVS np vs slash = {
|
SlashVS np vs slash =
|
||||||
s = \\t,a,p =>
|
let cl : Clause =
|
||||||
(mkClause (subjForm np vs.sc) np.a
|
mkClause
|
||||||
(insertExtrapos (etta_Conj ++ slash.s)
|
(subjForm np vs.sc) np.a
|
||||||
(predV vs))
|
(insertExtrapos (etta_Conj ++ slash.s) (predV vs))
|
||||||
).s ! t ! a ! p ! SDecl ;
|
in cl ** {c2 = slash.c2} ;
|
||||||
c2 = slash.c2
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
EmbedS s = {s = etta_Conj ++ s.s} ;
|
EmbedS s = {s = etta_Conj ++ s.s} ;
|
||||||
EmbedQS qs = {s = qs.s} ;
|
EmbedQS qs = {s = qs.s} ;
|
||||||
EmbedVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfDa} ; --- case,pol,agr,infform
|
EmbedVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfDa} ; --- case,pol,agr,infform
|
||||||
|
|
||||||
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! SDecl} ;
|
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
||||||
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
||||||
UseRCl t p cl = {
|
UseRCl t p cl = {
|
||||||
s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! r ;
|
s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! r ;
|
||||||
|
|||||||
Reference in New Issue
Block a user