some godis additions to dialogue

This commit is contained in:
aarne
2006-05-17 21:04:54 +00:00
parent cc07890344
commit 747eccf2df
5 changed files with 44 additions and 17 deletions

View File

@@ -5,6 +5,8 @@ abstract Dialogue = {
cat
Move ;
Action ;
Proposition ;
Question ;
Kind ;
Object Kind ;
Oper0 ;
@@ -13,9 +15,17 @@ abstract Dialogue = {
fun
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 ;
AOper1 : (k : Kind) -> Oper1 k -> Object k -> Action ;

View File

@@ -3,6 +3,8 @@ incomplete concrete DialogueI of Dialogue = open Lang, Prelude in {
lincat
Move = Phr ;
Action = {s : ActType => Str} ;
Proposition = Phr ; ----
Question = Phr ;
Kind = CN ;
Object = NP ;
Oper0 = V ;
@@ -11,9 +13,17 @@ incomplete concrete DialogueI of Dialogue = open Lang, Prelude in {
lin
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
(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) ;
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 ;
ODef k = DetCN (DetSg (SgQuant DefArt) NoOrd) k ;
ODef k = DetCN (DetSg (SgQuant DefArt) NoOrd) k ;
param
ActType = ARequest | AAnswer ; -- and some others
ActType = ARequest | AConfirm ; -- and some others
oper
@@ -37,29 +47,27 @@ incomplete concrete DialogueI of Dialogue = open Lang, Prelude in {
s = table {
ARequest => variants {
aImp vp ;
aImpPlease vp ;
aWant vp ;
aCanYou vp
} ;
AAnswer => variants {
AConfirm => variants {
aInf vp
}
}
} ;
aImp : VP -> Str = \vp ->
(PhrUtt NoPConj (UttImpSg PPos (ImpVP vp)) NoVoc).s ;
optPlease : Voc = variants {NoVoc ; please_Voc} ;
aImpPlease : VP -> Str = \vp ->
(PhrUtt NoPConj (UttImpSg PPos (ImpVP vp)) please_Voc).s ;
aImp : VP -> Str = \vp ->
(PhrUtt NoPConj (UttImpSg PPos (ImpVP vp)) optPlease).s ;
aWant : VP -> Str = \vp ->
(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 ->
(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 ->
(PhrUtt NoPConj (UttVP vp) NoVoc).s ;

View File

@@ -7,6 +7,8 @@ concrete DialogueProlog of Dialogue = open ResProlog, Prelude in {
lincat
Move = SS ;
Action = SS ;
Proposition = SS ;
Question = SS ;
Kind = SS ;
Object = SS ;
Oper0 = SS ;
@@ -15,9 +17,15 @@ concrete DialogueProlog of Dialogue = open ResProlog, Prelude in {
lin
MRequest a = a ;
MConfirm 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)) ;
AOper1 _ op x = ss (req_ans op.s op.x x.s) ;

View File

@@ -14,7 +14,7 @@ concrete LightsProlog of Lights =
LivingRoom = ss "living_room" ;
Kitchen = ss "kitchen" ;
MorningMode = ss "morning_mode" ;
MorningMode = ss (bracket (app1 "answer" "morning_mode")) ;
}

View File

@@ -4,6 +4,7 @@ resource ResProlog = open Prelude in {
bracket : Str -> Str = \s -> "[" ++ s ++ "]" ;
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) ;