forked from GitHub/gf-rgl
(Som) Add QuestSlash + make it possible for IPs to contract with stm
This commit is contained in:
@@ -23,7 +23,7 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in {
|
|||||||
-- Constructed in QuestionSom.
|
-- Constructed in QuestionSom.
|
||||||
|
|
||||||
QCl = ResSom.QClause ;
|
QCl = ResSom.QClause ;
|
||||||
IP = ResSom.NounPhrase ;
|
IP = ResSom.NounPhrase ** {contractSTM : Bool} ;
|
||||||
IComp = SS ; -- interrogative complement of copula e.g. "where"
|
IComp = SS ; -- interrogative complement of copula e.g. "where"
|
||||||
IDet = ResSom.Determiner ; -- interrogative determiner e.g. "how many"
|
IDet = ResSom.Determiner ; -- interrogative determiner e.g. "how many"
|
||||||
IQuant = ResSom.Quant ; -- interrogative quantifier e.g. "which"
|
IQuant = ResSom.Quant ; -- interrogative quantifier e.g. "which"
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
concrete QuestionSom of Question = CatSom ** open
|
concrete QuestionSom of Question = CatSom ** open
|
||||||
Prelude, ResSom, (VS=VerbSom), (NS=NounSom), (AS=AdverbSom) in {
|
Prelude, ResSom, ParadigmsSom, (VS=VerbSom), (NS=NounSom), (AS=AdverbSom) in {
|
||||||
|
|
||||||
-- A question can be formed from a clause ('yes-no question') or
|
-- A question can be formed from a clause ('yes-no question') or
|
||||||
-- with an interrogative.
|
-- with an interrogative.
|
||||||
|
|
||||||
lin
|
lin
|
||||||
-- : Cl -> QCl ;
|
-- : Cl -> QCl ;
|
||||||
QuestCl = cl2qcl ;
|
QuestCl = cl2qcl True;
|
||||||
|
|
||||||
-- : IP -> VP -> QCl ;
|
-- : IP -> VP -> QCl ;
|
||||||
QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP
|
QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP
|
||||||
@@ -16,10 +16,16 @@ concrete QuestionSom of Question = CatSom ** open
|
|||||||
<_,Pos> => "baa" ;
|
<_,Pos> => "baa" ;
|
||||||
_ => clRaw.stm ! clt ! p }
|
_ => clRaw.stm ! clt ! p }
|
||||||
}
|
}
|
||||||
in cl2qcl cl ;
|
in cl2qcl (notB ip.contractSTM) cl ;
|
||||||
|
|
||||||
-- : IP -> ClSlash -> QCl ; -- whom does John love
|
-- : IP -> ClSlash -> QCl ; -- whom does John love
|
||||||
--QuestSlash ip cls = ;
|
QuestSlash ip cls =
|
||||||
|
let clsIPFocus = cls ** {
|
||||||
|
subj = cls.subj ** {noun = ip.s ! Nom} ; -- place IP first in the sentence, keep old subject pronoun.
|
||||||
|
obj2 = cls.obj2 ** {s = cls.subj.noun ++ cls.obj2.s} -- move old subject noun before object.
|
||||||
|
} ;
|
||||||
|
in cl2qcl (notB ip.contractSTM) clsIPFocus ;
|
||||||
|
|
||||||
|
|
||||||
-- : IAdv -> Cl -> QCl ; -- why does John walk
|
-- : IAdv -> Cl -> QCl ; -- why does John walk
|
||||||
QuestIAdv iadv cls =
|
QuestIAdv iadv cls =
|
||||||
@@ -33,7 +39,7 @@ concrete QuestionSom of Question = CatSom ** open
|
|||||||
_ => clRaw.stm ! Question ! p ++ sbj.pron ++ sbj.noun } ;
|
_ => clRaw.stm ! Question ! p ++ sbj.pron ++ sbj.noun } ;
|
||||||
subj = sbj ** {noun, pron = []} -- to force subject after baa
|
subj = sbj ** {noun, pron = []} -- to force subject after baa
|
||||||
} ;
|
} ;
|
||||||
in cl2qcl cl ;
|
in cl2qcl True cl ; -- TODO: add contractSTM field to IAdv as well
|
||||||
|
|
||||||
-- : IComp -> NP -> QCl ; -- where is John?
|
-- : IComp -> NP -> QCl ; -- where is John?
|
||||||
-- QuestIComp icomp np = ;
|
-- QuestIComp icomp np = ;
|
||||||
@@ -42,10 +48,10 @@ concrete QuestionSom of Question = CatSom ** open
|
|||||||
-- determiners, with or without a noun.
|
-- determiners, with or without a noun.
|
||||||
|
|
||||||
-- : IDet -> CN -> IP ; -- which five songs
|
-- : IDet -> CN -> IP ; -- which five songs
|
||||||
IdetCN = NS.DetCN ;
|
IdetCN idet cn = {contractSTM = False} ** NS.DetCN idet cn ;
|
||||||
|
|
||||||
-- : IDet -> IP ; -- which five
|
-- : IDet -> IP ; -- which five
|
||||||
IdetIP = NS.DetNP ;
|
IdetIP idet = {contractSTM = False} ** NS.DetNP idet ;
|
||||||
|
|
||||||
-- They can be modified with adverbs.
|
-- They can be modified with adverbs.
|
||||||
-- : IP -> Adv -> IP ; -- who in Paris
|
-- : IP -> Adv -> IP ; -- who in Paris
|
||||||
@@ -58,7 +64,9 @@ concrete QuestionSom of Question = CatSom ** open
|
|||||||
|
|
||||||
-- Interrogative adverbs can be formed prepositionally.
|
-- Interrogative adverbs can be formed prepositionally.
|
||||||
-- : Prep -> IP -> IAdv ; -- with whom
|
-- : Prep -> IP -> IAdv ; -- with whom
|
||||||
PrepIP = AS.PrepNP ;
|
PrepIP prep ip =
|
||||||
|
let ipAbs : Str = ip.s ! Abs
|
||||||
|
in prepNP (mkPrep prep ipAbs [] []) emptyNP ;
|
||||||
|
|
||||||
-- They can be modified with other adverbs.
|
-- They can be modified with other adverbs.
|
||||||
|
|
||||||
|
|||||||
@@ -776,6 +776,9 @@ oper
|
|||||||
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
||||||
vp ** insertCompLite vp (nplite np) ;
|
vp ** insertCompLite vp (nplite np) ;
|
||||||
|
|
||||||
|
insertCompCl : ClSlash -> NounPhrase -> ClSlash = \cls,np ->
|
||||||
|
cls ** insertCompLite cls (nplite np) ;
|
||||||
|
|
||||||
insertAdv : VerbPhrase -> Adverb -> VerbPhrase = \vp,adv ->
|
insertAdv : VerbPhrase -> Adverb -> VerbPhrase = \vp,adv ->
|
||||||
vp ** insertAdvLite vp adv ;
|
vp ** insertAdvLite vp adv ;
|
||||||
|
|
||||||
@@ -931,11 +934,10 @@ oper
|
|||||||
in mkClause Subord isRel hasSubjPron hasSTM ;
|
in mkClause Subord isRel hasSubjPron hasSTM ;
|
||||||
|
|
||||||
-- Question clauses: subject pronoun not included, STM is
|
-- Question clauses: subject pronoun not included, STM is
|
||||||
cl2qcl : ClSlash -> Clause =
|
cl2qcl : Bool -> ClSlash -> Clause =
|
||||||
let hasSubjPron : Bool = False ;
|
let hasSubjPron : Bool = False ;
|
||||||
hasSTM : Bool = True ;
|
|
||||||
isRel : Bool = False ;
|
isRel : Bool = False ;
|
||||||
in mkClause Question isRel hasSubjPron hasSTM ;
|
in mkClause Question isRel hasSubjPron ;
|
||||||
|
|
||||||
-- Sentence: include subject pronoun and STM.
|
-- Sentence: include subject pronoun and STM.
|
||||||
-- When subordinate, include "in".
|
-- When subordinate, include "in".
|
||||||
|
|||||||
@@ -152,10 +152,16 @@ lin with_Prep = mkPrep la ;
|
|||||||
lin whatPl_IP = ;
|
lin whatPl_IP = ;
|
||||||
lin whatSg_IP = ;
|
lin whatSg_IP = ;
|
||||||
lin whoPl_IP = ;
|
lin whoPl_IP = ;
|
||||||
lin whoSg_IP = ;
|
|
||||||
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
lin whoSg_IP = emptyNP ** {
|
||||||
|
s = table {
|
||||||
|
Nom => "yaa" ; -- together with STM
|
||||||
|
Abs => "ayo" } ; -- alone, no STM (used in UttIP)
|
||||||
|
contractSTM = True ;
|
||||||
|
} ;
|
||||||
|
|
||||||
-------
|
-------
|
||||||
-- Subj
|
-- Subj
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,14 @@ Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (RelNP (UseP
|
|||||||
|
|
||||||
-- Question clauses
|
-- Question clauses
|
||||||
|
|
||||||
|
-- to whom did mother give the meat
|
||||||
|
LangSom: yaa siisey hooyo hilib BIND ka
|
||||||
|
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestSlash whoSg_IP (SlashVP (MassNP (UseN2 mother_N2)) (Slash3V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N))))))) NoVoc
|
||||||
|
|
||||||
|
-- LangEng: who wants to go
|
||||||
|
LangSom: yaa rabaa in uu tago
|
||||||
|
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP whoSg_IP (ComplVV want_VV (UseV go_V))))) NoVoc
|
||||||
|
|
||||||
-- LangEng: which cat teaches him
|
-- LangEng: which cat teaches him
|
||||||
LangSom: bisad BIND dee baa ku bartaa
|
LangSom: bisad BIND dee baa ku bartaa
|
||||||
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP (IdetCN (IdetQuant which_IQuant NumSg) (UseN cat_N)) (ComplSlash (SlashV2a teach_V2) (UsePron he_Pron))))) NoVoc
|
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP (IdetCN (IdetQuant which_IQuant NumSg) (UseN cat_N)) (ComplSlash (SlashV2a teach_V2) (UsePron he_Pron))))) NoVoc
|
||||||
|
|||||||
Reference in New Issue
Block a user