mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Som) Split polar questions and wh-questions to separate types
This commit is contained in:
@@ -336,6 +336,6 @@ oper
|
||||
|
||||
param
|
||||
|
||||
ClType = Statement | Question | Subord ;
|
||||
ClType = Statement | PolarQuestion | WhQuestion | Subord ;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,30 +6,31 @@ concrete QuestionSom of Question = CatSom ** open
|
||||
|
||||
lin
|
||||
-- : Cl -> QCl ;
|
||||
QuestCl = cl2qcl True;
|
||||
QuestCl = cl2qcl PolarQuestion True;
|
||||
|
||||
-- : IP -> VP -> QCl ;
|
||||
QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP
|
||||
let cls : ClSlash = predVP ip vp ;
|
||||
baan : Str = case ip.contractSTM of {True => "aan" ; _ => "baa aan"} ;
|
||||
cl : ClSlash = cls ** {
|
||||
stm = modSTM "baa" cls.stm
|
||||
stm = modSTM "baa" baan cls.stm
|
||||
} ;
|
||||
in cl2qcl (notB ip.contractSTM) cl ;
|
||||
in cl2qcl PolarQuestion (notB ip.contractSTM) cl ;
|
||||
|
||||
-- : IP -> ClSlash -> QCl ; -- whom does John love
|
||||
QuestSlash ip cls =
|
||||
let clsIPFocus = cls ** {
|
||||
let baan : Str = case ip.contractSTM of {True => "aan" ; _ => "baa aan"} ;
|
||||
clsIPFocus = cls ** {
|
||||
subj = cls.subj ** { -- keep old subject pronoun,
|
||||
noun = ip.s ! Nom -- and place IP first.
|
||||
} ;
|
||||
obj2 = cls.obj2 ** { -- move old subject noun before object.
|
||||
s = cls.subj.noun ++ cls.obj2.s
|
||||
} ;
|
||||
stm = modSTM "baa" cls.stm
|
||||
stm = modSTM "baa" baan cls.stm
|
||||
} ;
|
||||
in cl2qclslash (notB ip.contractSTM) clsIPFocus ;
|
||||
|
||||
|
||||
-- : IAdv -> Cl -> QCl ; -- why does John walk
|
||||
QuestIAdv iadv cls =
|
||||
let clRaw : ClSlash = insertIAdv iadv cls ;
|
||||
@@ -40,17 +41,12 @@ concrete QuestionSom of Question = CatSom ** open
|
||||
<_,Pos> => case iadv.contractSTM of {
|
||||
True => [] ; _ => "baa"}
|
||||
++ sbj.pron ++ sbj.noun ;
|
||||
-- TODO how do negative questions work
|
||||
-- Information questions are not commonly used in negative forms. When they occur they have the same forms as negative declaratives with focus (7.4.1). There is however a strong tendency to use positive forms, for example by subordinating the clause under a verb with an inherently negative meaning:
|
||||
-- Maxaad u tegi weydey?
|
||||
-- what+FOC+you for go:INF failed
|
||||
-- 'Why didn't you go?' (lit. 'Why did you fail to go?')
|
||||
_ => case iadv.contractSTM of {
|
||||
True => [] ; _ => clRaw.stm ! Question ! p}
|
||||
True => [] ; _ => clRaw.stm ! WhQuestion ! p}
|
||||
++ sbj.pron ++ sbj.noun } ;
|
||||
subj = sbj ** {noun, pron = []} -- to force subject after baa
|
||||
} ;
|
||||
in cl2qcl True cl ; -- True because we handle STM placement in cl.stm
|
||||
in cl2qcl WhQuestion True cl ; -- True because we handle STM placement in cl.stm
|
||||
|
||||
-- : IComp -> NP -> QCl ; -- where is John?
|
||||
QuestIComp icomp np =
|
||||
|
||||
@@ -888,7 +888,7 @@ oper
|
||||
_ => predRaw -- Any other verb
|
||||
} ;
|
||||
|
||||
stm = mkStm vp.stm ;
|
||||
stm = mkStm subj.a vp.stm ;
|
||||
comp = vp.comp ! subj.a ;
|
||||
vComp = vp.vComp ** {
|
||||
subcl = vp.vComp.subcl ! subj.a
|
||||
@@ -942,16 +942,16 @@ oper
|
||||
in mkClause Subord isRel hasSubjPron hasSTM ;
|
||||
|
||||
-- Question clauses: subject pronoun not included, STM is
|
||||
cl2qcl : Bool -> ClSlash -> Clause =
|
||||
cl2qcl : ClType -> Bool -> ClSlash -> Clause = \cltyp ->
|
||||
let hasSubjPron : Bool = False ;
|
||||
isRel : Bool = False ;
|
||||
in mkClause Question isRel hasSubjPron ;
|
||||
in mkClause cltyp isRel hasSubjPron ;
|
||||
|
||||
-- Question clauses: subject pronoun is included
|
||||
cl2qclslash : Bool -> ClSlash -> Clause =
|
||||
let hasSubjPron : Bool = True ;
|
||||
isRel : Bool = False ;
|
||||
in mkClause Question isRel hasSubjPron ;
|
||||
in mkClause PolarQuestion isRel hasSubjPron ;
|
||||
|
||||
-- Sentence: include subject pronoun and STM.
|
||||
-- When subordinate, include "in".
|
||||
@@ -990,7 +990,7 @@ oper
|
||||
Subord => obj.p1 ;
|
||||
_ => [] } ;
|
||||
questionNounObj = case cltyp of {
|
||||
Question => obj.p1 ;
|
||||
PolarQuestion|WhQuestion => obj.p1 ;
|
||||
_ => [] } ;
|
||||
|
||||
-- Control whether to include subject pronoun and STM
|
||||
@@ -1028,9 +1028,9 @@ oper
|
||||
-> Str ;
|
||||
|
||||
vf : ClType -> VFun = \clt -> case clt of {
|
||||
Subord => vfSubord ;
|
||||
Question => vfQuestion ;
|
||||
_ => vfStatement } ;
|
||||
Subord => vfSubord ;
|
||||
WhQuestion => vfQuestion ; -- INF + waayaa 'why did you fail to go'
|
||||
_ => vfStatement } ;
|
||||
|
||||
vfStatement : VFun = \t,ant,p,agr,vp ->
|
||||
case <t,ant,p> of {
|
||||
@@ -1075,22 +1075,36 @@ oper
|
||||
|
||||
STMarker : Type = ClType => Polarity => Str ;
|
||||
|
||||
mkStm : STM -> STMarker = \stm ->
|
||||
-- NB. Agreement is used only for negative questions. If we want to change it
|
||||
-- in other sentence types, we need to change predVP and mkClause accordingly;
|
||||
-- certain VVs put stuff between STM and subject pronoun. Some VVs render now
|
||||
-- incorrectly in negative questions.
|
||||
mkStm : Agreement -> STM -> STMarker = \agr,stm ->
|
||||
\\cltyp,pol =>
|
||||
case <cltyp,pol> of {
|
||||
<Statement,Pos> => showSTM stm ;
|
||||
<Statement,Neg> => "ma" ;
|
||||
<Question,_> => "ma" ; -- neg. questions are formed with waayaa 'fail to do X', so they are syntactically positive
|
||||
-- <Question,Neg> => "sow" ; -- for true negative questions
|
||||
<Subord,Pos> => [] ;
|
||||
<Subord,Neg> => "aan"
|
||||
<Subord,Neg> => "aan" ;
|
||||
<WhQuestion,_> => "ma" ; -- neg. wh-questions are formed with waayaa 'fail to do sth', so they are syntactically positive
|
||||
<PolarQuestion,Pos> => "ma" ;
|
||||
<PolarQuestion,Neg> => case agr of { -- Negative question in past tense has only one form, need subject pronoun to know what the subject is.
|
||||
Sg1 => "miyaanan" ; -- Saeed p. 200
|
||||
Sg2 => "miyaanad" ; -- Saeed p. 200
|
||||
Sg3 Masc => "miyaanu" ; -- Saeed p. 200
|
||||
Sg3 Fem => "miyaanay" ; -- ???
|
||||
Pl1 Excl => "miyaanaannu" ; -- ???
|
||||
Pl1 Incl => "miyaanaynu" ; -- ???
|
||||
Pl2 => "miyaanaydin" ; -- ???
|
||||
Pl3 => "miyaanay" ; -- ???
|
||||
Impers => "ma aan" } -- not merged
|
||||
} ;
|
||||
|
||||
modSTM : Str -> STMarker -> STMarker = \str,stm ->
|
||||
modSTM : (pos, neg : Str) -> STMarker -> STMarker = \pos,neg,stm ->
|
||||
\\cltyp,pol =>
|
||||
case <cltyp,pol> of {
|
||||
<_,Pos> => str ;
|
||||
_ => stm ! cltyp ! pol
|
||||
case pol of {
|
||||
Pos => pos ;
|
||||
_ => neg
|
||||
} ;
|
||||
--------------------------------------------------------------------------------
|
||||
-- linrefs
|
||||
|
||||
Reference in New Issue
Block a user