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