forked from GitHub/gf-rgl
(Som) Fixes in question clauses
This commit is contained in:
@@ -23,10 +23,11 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in {
|
||||
-- Constructed in QuestionSom.
|
||||
|
||||
QCl = ResSom.QClause ;
|
||||
IP = ResSom.NounPhrase ** {contractSTM : Bool} ;
|
||||
IComp = SS ; -- interrogative complement of copula e.g. "where"
|
||||
IDet = ResSom.Determiner ; -- interrogative determiner e.g. "how many"
|
||||
IQuant = ResSom.Quant ; -- interrogative quantifier e.g. "which"
|
||||
IP = ResSom.NounPhrase ** {contractSTM : Bool} ; -- like NP but may contract with STM
|
||||
IAdv = ResSom.IAdv ;
|
||||
|
||||
--2 Subord clauses and pronouns
|
||||
|
||||
@@ -116,8 +117,7 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in {
|
||||
N3 = ResSom.Noun3 ;
|
||||
PN = ResSom.PNoun ;
|
||||
|
||||
Adv,
|
||||
IAdv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb.
|
||||
Adv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb.
|
||||
|
||||
linref
|
||||
-- Cl = linCl ;
|
||||
|
||||
@@ -5,6 +5,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
|
||||
|
||||
UttS s = {s = s.s ! False} ;
|
||||
UttQS qs = qs ;
|
||||
UttIAdv iadv = iadv ;
|
||||
|
||||
UttImpSg pol imp =
|
||||
let ma = case pol.p of { Pos => [] ; Neg => "ma" }
|
||||
@@ -15,8 +16,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
|
||||
UttIP ip = {s = ip.s ! Abs} ;
|
||||
UttNP np = {s = np.s ! Abs} ;
|
||||
UttVP vp = {s = infVP vp} ;
|
||||
UttAdv,
|
||||
UttIAdv = \adv -> {s = linAdv adv} ;
|
||||
UttAdv adv = {s = linAdv adv} ;
|
||||
UttCN n = {s = linCN n} ;
|
||||
UttCard n = {s = n.s ! Mid} ;
|
||||
UttAP ap = { s = ap.s ! AF Sg Abs } ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
concrete QuestionSom of Question = CatSom ** open
|
||||
Prelude, ResSom, ParadigmsSom, (VS=VerbSom), (NS=NounSom), (AS=AdverbSom) in {
|
||||
Prelude, ResSom, ParadigmsSom, (VS=VerbSom), (NS=NounSom), (SS=StructuralSom) in {
|
||||
|
||||
-- A question can be formed from a clause ('yes-no question') or
|
||||
-- with an interrogative.
|
||||
@@ -24,7 +24,7 @@ concrete QuestionSom of Question = CatSom ** open
|
||||
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 ;
|
||||
in cl2qclslash (notB ip.contractSTM) clsIPFocus ;
|
||||
|
||||
|
||||
-- : IAdv -> Cl -> QCl ; -- why does John walk
|
||||
@@ -34,14 +34,20 @@ concrete QuestionSom of Question = CatSom ** open
|
||||
cl : ClSlash = clRaw ** {
|
||||
stm = \\clt,p => case <clt,p> of {
|
||||
-- IAdv is focused with baa, and subject comes after
|
||||
<_,Pos> => "baa" ++ sbj.pron ++ sbj.noun;
|
||||
<_,Pos> => case iadv.contractSTM of {
|
||||
True => [] ; _ => "baa"}
|
||||
++ sbj.pron ++ sbj.noun ;
|
||||
-- TODO how do negative questions work
|
||||
_ => clRaw.stm ! Question ! p ++ sbj.pron ++ sbj.noun } ;
|
||||
_ => case iadv.contractSTM of {
|
||||
True => [] ; _ => clRaw.stm ! Question ! p}
|
||||
++ sbj.pron ++ sbj.noun } ;
|
||||
subj = sbj ** {noun, pron = []} -- to force subject after baa
|
||||
} ;
|
||||
in cl2qcl True cl ; -- TODO: add contractSTM field to IAdv as well
|
||||
in cl2qcl True cl ; -- True because we handle STM placement in cl.stm
|
||||
|
||||
-- : IComp -> NP -> QCl ; -- where is John?
|
||||
-- Saeed p. 212 Ninkii ay raaceen waa ayo? man-the they accompanied DM who
|
||||
-- 'The man they travelled with is who?'
|
||||
-- QuestIComp icomp np = ;
|
||||
|
||||
-- Interrogative pronouns can be formed with interrogative
|
||||
@@ -64,9 +70,7 @@ concrete QuestionSom of Question = CatSom ** open
|
||||
|
||||
-- Interrogative adverbs can be formed prepositionally.
|
||||
-- : Prep -> IP -> IAdv ; -- with whom
|
||||
PrepIP prep ip =
|
||||
let ipAbs : Str = ip.s ! Abs
|
||||
in prepNP (mkPrep prep ipAbs [] []) emptyNP ;
|
||||
PrepIP prep ip = SS.prepIP prep (ip.s ! Abs) False ;
|
||||
|
||||
-- They can be modified with other adverbs.
|
||||
|
||||
|
||||
@@ -697,6 +697,11 @@ oper
|
||||
np : NPLite ; -- NP from PrepNP can be promoted into a core argument.
|
||||
} ;
|
||||
|
||||
IAdv : Type = Adverb ** {
|
||||
contractSTM : Bool ;
|
||||
s : Str -- alone, in one-word question, e.g. Waayo? 'Why?'
|
||||
} ;
|
||||
|
||||
prepNP : Prep -> NounPhrase -> Adverb = \prep,np -> prep ** {
|
||||
np = case prep.isPoss of {
|
||||
True => nplite emptyNP ;
|
||||
@@ -939,6 +944,12 @@ oper
|
||||
isRel : Bool = False ;
|
||||
in mkClause Question isRel hasSubjPron ;
|
||||
|
||||
-- Question clauses: subject pronoun is included
|
||||
cl2qclslash : Bool -> ClSlash -> Clause =
|
||||
let hasSubjPron : Bool = True ;
|
||||
isRel : Bool = False ;
|
||||
in mkClause Question isRel hasSubjPron ;
|
||||
|
||||
-- Sentence: include subject pronoun and STM.
|
||||
-- When subordinate, include "in".
|
||||
cl2sentence : Bool -> ClSlash -> Clause = \isSubord,cls -> {
|
||||
|
||||
@@ -16,14 +16,14 @@ lin as_CAdv = { s = "" ; p = [] } ;
|
||||
lin less_CAdv = { s = "" ; p = [] } ;
|
||||
lin more_CAdv = { s = "" ; p = [] } ;
|
||||
-}
|
||||
lin how_IAdv = prepNP (mkPrep (mkPrep u) "sidee" [] []) emptyNP ;
|
||||
{-
|
||||
lin how8much_IAdv = ss "" ;
|
||||
lin when_IAdv = ss "" ;
|
||||
lin where_IAdv = ss "" ;
|
||||
lin why_IAdv = ss "" ;
|
||||
lin how_IAdv = mkIAdv u "sidee" False ;
|
||||
|
||||
lin always_AdV = ss "" ;
|
||||
-- lin how8much_IAdv = ss "" ;
|
||||
-- lin when_IAdv = ss "" ;
|
||||
-- lin where_IAdv = ss "" ;
|
||||
lin why_IAdv = let mx = mkIAdv u "maxaa" True in mx ** {s = "waayo"} ;
|
||||
|
||||
{-lin always_AdV = ss "" ;
|
||||
|
||||
lin everywhere_Adv = ss "" ;
|
||||
lin here7from_Adv = ss "" ;
|
||||
@@ -148,19 +148,11 @@ lin with_Prep = mkPrep la ;
|
||||
we_Pron = pronTable ! Pl1 Incl ;
|
||||
youPl_Pron = pronTable ! Pl2 ;
|
||||
they_Pron = pronTable ! Pl3 ;
|
||||
{-
|
||||
lin whatPl_IP = ;
|
||||
lin whatSg_IP = ;
|
||||
lin whoPl_IP = ;
|
||||
|
||||
-}
|
||||
|
||||
lin whoSg_IP = emptyNP ** {
|
||||
s = table {
|
||||
Nom => "yaa" ; -- together with STM
|
||||
Abs => "ayo" } ; -- alone, no STM (used in UttIP)
|
||||
contractSTM = True ;
|
||||
} ;
|
||||
--lin whatPl_IP = ;
|
||||
lin whatSg_IP = mkIP "maxay" "maxaa" True ;
|
||||
--lin whoPl_IP = ;
|
||||
lin whoSg_IP = mkIP "ayo" "yaa" True ;
|
||||
|
||||
-------
|
||||
-- Subj
|
||||
@@ -195,4 +187,20 @@ lin want_VV = mkVV (mkV "rabid" "rab" "rab") subjunctive ;
|
||||
{-
|
||||
lin please_Voc = ss "" ;
|
||||
-}
|
||||
oper
|
||||
mkIAdv : Preposition -> Str -> Bool -> ResSom.IAdv = \pr ->
|
||||
let pr' : Prep = ParadigmsSom.mkPrep pr ;
|
||||
in prepIP pr' ;
|
||||
|
||||
mkIP : (maxay, maxaa : Str) -> Bool -> IP = \maxay,maxaa,b -> emptyNP ** {
|
||||
s = table {
|
||||
Nom => maxaa ; -- together with STM
|
||||
Abs => maxay } ; -- alone, no STM (used in UttIP and IComp)
|
||||
contractSTM = b ;
|
||||
} ;
|
||||
|
||||
prepIP : Prep -> Str -> Bool -> ResSom.IAdv = \pr,str,b ->
|
||||
let adv : Adverb = prepNP (mkPrep pr str [] []) emptyNP ;
|
||||
in adv ** {contractSTM = b ; s = linAdv adv} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -83,10 +83,12 @@ Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (RelNP (UseP
|
||||
-- Question clauses
|
||||
|
||||
-- to whom did mother give the meat
|
||||
LangSom: yaa siisey hooyo hilib BIND ka
|
||||
-- subject pronoun 'ay' included, because whom is an object
|
||||
LangSom: yaa ay 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
|
||||
-- subject pronoun not included, because who is a subject
|
||||
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
|
||||
|
||||
@@ -101,10 +103,10 @@ Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestIAdv how_IAd
|
||||
-- Some examples from Nilsson, adjusted to the GF lexicon
|
||||
-- Maxaa ay u samaysay sidaas? Varför gjorde hon så?
|
||||
--LangEng: why did she eat the meat
|
||||
LangSom: TODO
|
||||
LangSom: maxaa ay u cuntay hilib BIND ka
|
||||
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv why_IAdv (PredVP (UsePron she_Pron) (ComplSlash (SlashV2a eat_V2) (DetCN (DetQuant DefArt NumSg) (UseN meat_N))))))) NoVoc
|
||||
|
||||
-- Maxaa ay ahaa dharka cusub ee Faadumo loo iibiyay? Vad/Vilka var de nya kläder som man köpt åt Fadumo?
|
||||
-- Maxaa ay ahaa dharka cusub ee Faadumo loo iibiyay? Vad/Vilka var de nya kläder som man köpt åt Fadumo? TODO why is there subject pronoun here?
|
||||
--LangEng: what was the meat that was eaten
|
||||
LangSom: TODO
|
||||
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestVP whatSg_IP (UseComp (CompNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN meat_N) (UseRCl (TTAnt TPast ASimul) PPos (RelVP IdRP (PassV2 eat_V2)))))))))) NoVoc
|
||||
|
||||
Reference in New Issue
Block a user