forked from GitHub/gf-core
completed multimodal API
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
abstract Demonstrative = Cat, Tense ** {
|
||||
|
||||
-- Naming convention: $M$ prepended to 'unimodal' names.
|
||||
-- Exceptions: lexical units, those without unimodal counterparts.
|
||||
|
||||
cat
|
||||
|
||||
MS ; -- multimodal sentence or question
|
||||
MQS ; -- multimodal wh question
|
||||
MImp ; -- multimodal imperative
|
||||
MVP ; -- multimodal verb phrase
|
||||
MComp ; -- multimodal complement to copula (MAP, DNP, DAdv)
|
||||
MComp ; -- multimodal complement to copula (MAP, MNP, MAdv)
|
||||
MAP ; -- multimodal adjectival phrase
|
||||
|
||||
DNP ; -- demonstrative noun phrase
|
||||
DAdv ; -- demonstrative adverbial
|
||||
MNP ; -- demonstrative noun phrase
|
||||
MAdv ; -- demonstrative adverbial
|
||||
|
||||
Point ; -- pointing gesture
|
||||
|
||||
fun
|
||||
@@ -21,53 +25,58 @@ abstract Demonstrative = Cat, Tense ** {
|
||||
|
||||
-- Construction of sentences, questions, and imperatives.
|
||||
|
||||
PredMVP : DNP -> MVP -> MS ; -- he flies here
|
||||
QuestMVP : DNP -> MVP -> MQS ; -- does he fly here
|
||||
MPredVP : MNP -> MVP -> MS ; -- he flies here
|
||||
MQPredVP : MNP -> MVP -> MQS ; -- does he fly here
|
||||
|
||||
QQuestMVP : IP -> MVP -> MQS ; -- who flies here
|
||||
MQuestVP : IP -> MVP -> MQS ; -- who flies here
|
||||
|
||||
ImpMVP : MVP -> MImp ; -- fly here!
|
||||
MImpVP : MVP -> MImp ; -- fly here!
|
||||
|
||||
-- Construction of verb phrases from verb + complements.
|
||||
|
||||
DemV : V -> MVP ; -- flies (here)
|
||||
DemV2 : V2 -> DNP -> MVP ; -- takes this (here)
|
||||
DemVV : VV -> MVP -> MVP ; -- wants to fly (here)
|
||||
MUseV : V -> MVP ; -- flies (here)
|
||||
MComplV2 : V2 -> MNP -> MVP ; -- takes this (here)
|
||||
MComplVV : VV -> MVP -> MVP ; -- wants to fly (here)
|
||||
|
||||
DemComp : MComp -> MVP ; -- is here ; is bigger than this
|
||||
MUseComp : MComp -> MVP ; -- is here ; is bigger than this
|
||||
|
||||
DCompAP : MAP -> MComp ; -- bigger than this
|
||||
DCompNP : DNP -> MComp ; -- the price of this
|
||||
DCompAdv : DAdv -> MComp ; -- here
|
||||
MCompAP : MAP -> MComp ; -- bigger than this
|
||||
MCompNP : MNP -> MComp ; -- the price of this
|
||||
MCompAdv : MAdv -> MComp ; -- here
|
||||
|
||||
MPositA : A -> MAP ; -- big
|
||||
MComparA : A -> MNP -> MAP ; -- bigger than this
|
||||
|
||||
-- Adverbial modification of a verb phrase.
|
||||
|
||||
AdvMVP : MVP -> DAdv -> MVP ;
|
||||
MAdvVP : MVP -> MAdv -> MVP ; -- fly here
|
||||
|
||||
-- Demonstrative pronouns as NPs and determiners.
|
||||
|
||||
this_DNP : Point -> DNP ; -- this
|
||||
that_DNP : Point -> DNP ; -- that
|
||||
thisDet_DNP : CN -> Point -> DNP ; -- this car
|
||||
thatDet_DNP : CN -> Point -> DNP ; -- that car
|
||||
this_MNP : Point -> MNP ; -- this
|
||||
that_MNP : Point -> MNP ; -- that
|
||||
thisDet_MNP : CN -> Point -> MNP ; -- this car
|
||||
thatDet_MNP : CN -> Point -> MNP ; -- that car
|
||||
|
||||
-- Demonstrative adverbs.
|
||||
|
||||
here_DAdv : Point -> DAdv ; -- here
|
||||
here7from_DAdv : Point -> DAdv ; -- from here
|
||||
here7to_DAdv : Point -> DAdv ; -- to here
|
||||
here_MAdv : Point -> MAdv ; -- here
|
||||
here7from_MAdv : Point -> MAdv ; -- from here
|
||||
here7to_MAdv : Point -> MAdv ; -- to here
|
||||
|
||||
-- Building an adverb as prepositional phrase.
|
||||
|
||||
PrepDNP : Prep -> DNP -> DAdv ;
|
||||
MPrepNP : Prep -> MNP -> MAdv ; -- in this car
|
||||
|
||||
-- Using ordinary categories.
|
||||
|
||||
-- Interface to $Demonstrative$.
|
||||
-- Mounting nondemonstrative expressions.
|
||||
|
||||
DemNP : NP -> MNP ;
|
||||
DemAdv : Adv -> MAdv ;
|
||||
|
||||
-- Top-level phrases.
|
||||
|
||||
DemNP : NP -> DNP ;
|
||||
DemAdv : Adv -> DAdv ;
|
||||
PhrMS : Pol -> MS -> Phr ;
|
||||
PhrMS : Pol -> MS -> Phr ;
|
||||
PhrMQS : Pol -> MQS -> Phr ;
|
||||
|
||||
@@ -9,53 +9,90 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
||||
MVP = Dem VP ;
|
||||
MComp = Dem Comp ;
|
||||
MAP = Dem AP ;
|
||||
DNP = Dem NP ;
|
||||
DAdv = Dem Adv ;
|
||||
Point = DemRes.Point ;
|
||||
MNP = Dem NP ;
|
||||
MAdv = Dem Adv ;
|
||||
|
||||
Point = DemRes.Point ;
|
||||
|
||||
lin
|
||||
|
||||
MkPoint s = mkPoint s.s ;
|
||||
|
||||
PredMVP np vp =
|
||||
MPredVP np vp =
|
||||
let cl = PredVP np vp
|
||||
in
|
||||
mkDem
|
||||
{s : Polarity => Str}
|
||||
(polCases (PosCl cl).s (NegCl cl).s) (concatPoint np vp) ;
|
||||
|
||||
DemV verb = mkDem VP (UseV verb) noPoint ;
|
||||
DemV2 verb obj = mkDem VP (ComplV2 verb obj) obj ;
|
||||
DemVV vv vp = mkDem VP (ComplVV vv vp) vp ;
|
||||
MQPredVP np vp =
|
||||
let cl = QuestCl (PredVP np vp)
|
||||
in
|
||||
mkDem
|
||||
{s : Polarity => Str}
|
||||
(polCases
|
||||
((PosQCl cl).s ! QDir)
|
||||
((NegQCl cl).s ! QDir))
|
||||
(concatPoint np vp) ;
|
||||
|
||||
DemComp comp = mkDem VP (UseComp comp) comp ;
|
||||
--- DemComp = keepDem VP UseComp ;
|
||||
MQuestVP np vp =
|
||||
let cl = QuestVP np vp
|
||||
in
|
||||
mkDem
|
||||
{s : Polarity => Str}
|
||||
(polCases
|
||||
((PosQCl cl).s ! QDir)
|
||||
((NegQCl cl).s ! QDir))
|
||||
vp ;
|
||||
|
||||
DCompAP ap = mkDem Comp (CompAP ap) ap ;
|
||||
DCompAdv adv = mkDem Comp (CompAdv adv) adv ;
|
||||
|
||||
MImpVP vp =
|
||||
let imp = ImpVP vp
|
||||
in
|
||||
mkDem
|
||||
{s : Polarity => Str}
|
||||
(polCases
|
||||
((UttImpSg PPos imp).s)
|
||||
((UttImpSg PNeg imp).s))
|
||||
vp ;
|
||||
|
||||
|
||||
AdvMVP vp adv =
|
||||
MUseV verb = mkDem VP (UseV verb) noPoint ;
|
||||
MComplV2 verb obj = mkDem VP (ComplV2 verb obj) obj ;
|
||||
MComplVV vv vp = mkDem VP (ComplVV vv vp) vp ;
|
||||
|
||||
MUseComp comp = mkDem VP (UseComp comp) comp ;
|
||||
|
||||
MCompAP ap = mkDem Comp (CompAP ap) ap ;
|
||||
MCompAdv adv = mkDem Comp (CompAdv adv) adv ;
|
||||
MCompNP np = mkDem Comp (CompNP np) np ;
|
||||
|
||||
MPositA a = mkDem AP (PositA a) noPoint ;
|
||||
MComparA a np = mkDem AP (ComparA a np) np ;
|
||||
|
||||
|
||||
MAdvVP vp adv =
|
||||
mkDem VP (AdvVP vp adv) (concatPoint vp adv) ;
|
||||
|
||||
this_DNP = mkDem NP this_NP ;
|
||||
that_DNP = mkDem NP that_NP ;
|
||||
this_MNP = mkDem NP this_NP ;
|
||||
that_MNP = mkDem NP that_NP ;
|
||||
|
||||
thisDet_DNP cn =
|
||||
thisDet_MNP cn =
|
||||
mkDem NP (DetCN (MkDet NoPredet this_Quant NoNum NoOrd) cn) ;
|
||||
thatDet_DNP cn =
|
||||
thatDet_MNP cn =
|
||||
mkDem NP (DetCN (MkDet NoPredet that_Quant NoNum NoOrd) cn) ;
|
||||
|
||||
here_DAdv = mkDem Adv here_Adv ;
|
||||
here7from_DAdv = mkDem Adv here7from_Adv ;
|
||||
here7to_DAdv = mkDem Adv here7to_Adv ;
|
||||
here_MAdv = mkDem Adv here_Adv ;
|
||||
here7from_MAdv = mkDem Adv here7from_Adv ;
|
||||
here7to_MAdv = mkDem Adv here7to_Adv ;
|
||||
|
||||
PrepDNP p np = mkDem Adv (PrepNP p np) np ;
|
||||
MPrepNP p np = mkDem Adv (PrepNP p np) np ;
|
||||
|
||||
DemNP np = nonDem NP (np ** {lock_NP = <>}) ;
|
||||
-- DemAdv = nonDem Adv ;
|
||||
PhrMS pol ms = {s = pol.s ++ ms.s ! pol.p ++ ";" ++ ms.point} ;
|
||||
DemAdv adv = nonDem Adv (adv ** {lock_Adv = <>}) ;
|
||||
|
||||
PhrMS pol ms = {s = pol.s ++ ms.s ! pol.p ++ ";" ++ ms.point} ;
|
||||
PhrMQS pol ms = {s = pol.s ++ ms.s ! pol.p ++ ";" ++ ms.point} ;
|
||||
PhrMImp pol ms = {s = pol.s ++ ms.s ! pol.p ++ ";" ++ ms.point} ;
|
||||
|
||||
point1 = mkPoint "p1" ;
|
||||
point2 = mkPoint "p2" ;
|
||||
|
||||
Reference in New Issue
Block a user