mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
some godis additions to dialogue
This commit is contained in:
@@ -5,6 +5,8 @@ abstract Dialogue = {
|
|||||||
cat
|
cat
|
||||||
Move ;
|
Move ;
|
||||||
Action ;
|
Action ;
|
||||||
|
Proposition ;
|
||||||
|
Question ;
|
||||||
Kind ;
|
Kind ;
|
||||||
Object Kind ;
|
Object Kind ;
|
||||||
Oper0 ;
|
Oper0 ;
|
||||||
@@ -13,9 +15,17 @@ abstract Dialogue = {
|
|||||||
|
|
||||||
fun
|
fun
|
||||||
MRequest : Action -> Move ;
|
MRequest : Action -> Move ;
|
||||||
MAnswer : Action -> Move ;
|
MConfirm : Action -> Move ;
|
||||||
|
MAnswer : Proposition -> Move ;
|
||||||
|
MIssue : Question -> Move ;
|
||||||
|
|
||||||
MQuery : Kind -> Move ;
|
MYes : Move ;
|
||||||
|
MNo : Move ;
|
||||||
|
MObject : (k : Kind) -> Object k -> Move ;
|
||||||
|
|
||||||
|
PAction : Action -> Proposition ;
|
||||||
|
|
||||||
|
QKind : Kind -> Question ;
|
||||||
|
|
||||||
AOper0 : Oper0 -> Action ;
|
AOper0 : Oper0 -> Action ;
|
||||||
AOper1 : (k : Kind) -> Oper1 k -> Object k -> Action ;
|
AOper1 : (k : Kind) -> Oper1 k -> Object k -> Action ;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ incomplete concrete DialogueI of Dialogue = open Lang, Prelude in {
|
|||||||
lincat
|
lincat
|
||||||
Move = Phr ;
|
Move = Phr ;
|
||||||
Action = {s : ActType => Str} ;
|
Action = {s : ActType => Str} ;
|
||||||
|
Proposition = Phr ; ----
|
||||||
|
Question = Phr ;
|
||||||
Kind = CN ;
|
Kind = CN ;
|
||||||
Object = NP ;
|
Object = NP ;
|
||||||
Oper0 = V ;
|
Oper0 = V ;
|
||||||
@@ -11,9 +13,17 @@ incomplete concrete DialogueI of Dialogue = open Lang, Prelude in {
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
MRequest a = ss (a.s ! ARequest) ;
|
MRequest a = ss (a.s ! ARequest) ;
|
||||||
MAnswer a = ss (a.s ! AAnswer) ;
|
MConfirm a = ss (a.s ! AConfirm) ;
|
||||||
|
MAnswer a = a ;
|
||||||
|
MIssue a = a ;
|
||||||
|
|
||||||
MQuery k =
|
MYes = yes_Phr ;
|
||||||
|
MNo = no_Phr ;
|
||||||
|
MObject _ ob = PhrUtt NoPConj (UttNP ob) optPlease ;
|
||||||
|
|
||||||
|
PAction a = ss (a.s ! AConfirm) ;
|
||||||
|
|
||||||
|
QKind k =
|
||||||
PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos
|
PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos
|
||||||
(ExistIP (IDetCN whichPl_IDet NoNum NoOrd k)))) NoVoc ;
|
(ExistIP (IDetCN whichPl_IDet NoNum NoOrd k)))) NoVoc ;
|
||||||
|
|
||||||
@@ -21,12 +31,12 @@ incomplete concrete DialogueI of Dialogue = open Lang, Prelude in {
|
|||||||
AOper1 _ op x = mkAction (ComplV2 op x) ;
|
AOper1 _ op x = mkAction (ComplV2 op x) ;
|
||||||
AOper2 _ _ op x y = mkAction (ComplV3 op x y) ;
|
AOper2 _ _ op x y = mkAction (ComplV3 op x y) ;
|
||||||
|
|
||||||
OAll k = PredetNP all_Predet (DetCN (DetPl (PlQuant IndefArt) NoNum NoOrd) k) ;
|
OAll k = PredetNP all_Predet (DetCN (DetPl (PlQuant IndefArt) NoNum NoOrd) k) ;
|
||||||
OIndef k = DetCN (DetSg (SgQuant IndefArt) NoOrd) k ;
|
OIndef k = DetCN (DetSg (SgQuant IndefArt) NoOrd) k ;
|
||||||
ODef k = DetCN (DetSg (SgQuant DefArt) NoOrd) k ;
|
ODef k = DetCN (DetSg (SgQuant DefArt) NoOrd) k ;
|
||||||
|
|
||||||
param
|
param
|
||||||
ActType = ARequest | AAnswer ; -- and some others
|
ActType = ARequest | AConfirm ; -- and some others
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
@@ -37,29 +47,27 @@ incomplete concrete DialogueI of Dialogue = open Lang, Prelude in {
|
|||||||
s = table {
|
s = table {
|
||||||
ARequest => variants {
|
ARequest => variants {
|
||||||
aImp vp ;
|
aImp vp ;
|
||||||
aImpPlease vp ;
|
|
||||||
aWant vp ;
|
aWant vp ;
|
||||||
aCanYou vp
|
aCanYou vp
|
||||||
} ;
|
} ;
|
||||||
AAnswer => variants {
|
AConfirm => variants {
|
||||||
aInf vp
|
aInf vp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
aImp : VP -> Str = \vp ->
|
optPlease : Voc = variants {NoVoc ; please_Voc} ;
|
||||||
(PhrUtt NoPConj (UttImpSg PPos (ImpVP vp)) NoVoc).s ;
|
|
||||||
|
|
||||||
aImpPlease : VP -> Str = \vp ->
|
aImp : VP -> Str = \vp ->
|
||||||
(PhrUtt NoPConj (UttImpSg PPos (ImpVP vp)) please_Voc).s ;
|
(PhrUtt NoPConj (UttImpSg PPos (ImpVP vp)) optPlease).s ;
|
||||||
|
|
||||||
aWant : VP -> Str = \vp ->
|
aWant : VP -> Str = \vp ->
|
||||||
(PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (UsePron i_Pron)
|
(PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (UsePron i_Pron)
|
||||||
(ComplVV want_VV vp)))) NoVoc).s ;
|
(ComplVV want_VV vp)))) optPlease).s ;
|
||||||
|
|
||||||
aCanYou : VP -> Str = \vp ->
|
aCanYou : VP -> Str = \vp ->
|
||||||
(PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos (QuestCl (PredVP
|
(PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos (QuestCl (PredVP
|
||||||
(UsePron youSg_Pron) (ComplVV can_VV vp))))) NoVoc).s ;
|
(UsePron youSg_Pron) (ComplVV can_VV vp))))) optPlease).s ;
|
||||||
|
|
||||||
aInf : VP -> Str = \vp ->
|
aInf : VP -> Str = \vp ->
|
||||||
(PhrUtt NoPConj (UttVP vp) NoVoc).s ;
|
(PhrUtt NoPConj (UttVP vp) NoVoc).s ;
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ concrete DialogueProlog of Dialogue = open ResProlog, Prelude in {
|
|||||||
lincat
|
lincat
|
||||||
Move = SS ;
|
Move = SS ;
|
||||||
Action = SS ;
|
Action = SS ;
|
||||||
|
Proposition = SS ;
|
||||||
|
Question = SS ;
|
||||||
Kind = SS ;
|
Kind = SS ;
|
||||||
Object = SS ;
|
Object = SS ;
|
||||||
Oper0 = SS ;
|
Oper0 = SS ;
|
||||||
@@ -15,9 +17,15 @@ concrete DialogueProlog of Dialogue = open ResProlog, Prelude in {
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
MRequest a = a ;
|
MRequest a = a ;
|
||||||
|
MConfirm a = a ; --- ??
|
||||||
MAnswer a = a ; --- ??
|
MAnswer a = a ; --- ??
|
||||||
|
MIssue a = ss (bracket (app1 "ask" a.s)) ; --- ??
|
||||||
|
|
||||||
MQuery k = ss (bracket (app1 "query" k.s)) ; ---
|
MYes = ss (bracket (app1 "answer" "yes")) ;
|
||||||
|
MNo = ss (bracket (app1 "answer" "no")) ;
|
||||||
|
MObject _ ob = ss (bracket (apps "answer" ob).s) ;
|
||||||
|
|
||||||
|
QKind k = ss (app2 "q" "X" (app1 k.s "X")) ;
|
||||||
|
|
||||||
AOper0 op = ss (bracket (request op.s)) ;
|
AOper0 op = ss (bracket (request op.s)) ;
|
||||||
AOper1 _ op x = ss (req_ans op.s op.x x.s) ;
|
AOper1 _ op x = ss (req_ans op.s op.x x.s) ;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ concrete LightsProlog of Lights =
|
|||||||
LivingRoom = ss "living_room" ;
|
LivingRoom = ss "living_room" ;
|
||||||
Kitchen = ss "kitchen" ;
|
Kitchen = ss "kitchen" ;
|
||||||
|
|
||||||
MorningMode = ss "morning_mode" ;
|
MorningMode = ss (bracket (app1 "answer" "morning_mode")) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ resource ResProlog = open Prelude in {
|
|||||||
bracket : Str -> Str = \s -> "[" ++ s ++ "]" ;
|
bracket : Str -> Str = \s -> "[" ++ s ++ "]" ;
|
||||||
|
|
||||||
app1 : Str -> Str -> Str = \f,x -> f ++ paren x ;
|
app1 : Str -> Str -> Str = \f,x -> f ++ paren x ;
|
||||||
|
app2 : Str -> Str -> Str -> Str = \f,x,y -> f ++ paren (x ++ "," ++ y) ;
|
||||||
|
|
||||||
apps : Str -> SS -> SS = \f,x -> ss (app1 f x.s) ;
|
apps : Str -> SS -> SS = \f,x -> ss (app1 f x.s) ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user