summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/tram/Tram.gf33
-rw-r--r--examples/tram/TramEng.gf5
-rw-r--r--examples/tram/TramFre.gf5
-rw-r--r--examples/tram/TramI.gf44
-rw-r--r--examples/tram/TramSwe.gf5
5 files changed, 92 insertions, 0 deletions
diff --git a/examples/tram/Tram.gf b/examples/tram/Tram.gf
new file mode 100644
index 000000000..bcd9f7b7c
--- /dev/null
+++ b/examples/tram/Tram.gf
@@ -0,0 +1,33 @@
+abstract Tram = {
+
+cat
+ Dep ; -- from here, from Angered
+ Dest ; -- to here, to Angered
+ Query ; -- message sent to the dialogue manager: sequentialized
+ Input ; -- user input: parallel text and clicks
+ Click ; -- map clicks
+
+fun
+ QInput : Input -> Query ; -- sequentialize user input
+
+fun
+ GoFromTo : Dep -> Dest -> Input ; -- user input "want to go from a to b"
+ GoToFrom : Dest -> Dep -> Input ; -- user input "want to go to a from b"
+ ComeFrom : Dep -> Input ; -- user input "want to come from x (to where I am now)
+ GoTo : Dest -> Input ; -- user input "want to go to x (from where I am now)
+
+ DepClick : Click -> Dep ; -- "from here" with click
+ DestClick : Click -> Dest ; -- "to here" with click
+ DepHere : Dep ; -- "from here" indexical
+ DestHere : Dest ; -- "to here" indexical
+ DepNamed : String -> Dep ; -- from a place name
+ DestNamed : String -> Dest ; -- to a place name
+
+ CCoord : Int -> Int -> Click ;
+
+--- the syntax of here (prep + adverb, not prep + np) prevent these
+-- Place ; -- any way to identify a place: name, click, or indexical "here"
+-- PClick : Click -> Place ; -- click associated with a "here"
+-- PHere : Place ; -- indexical "here", without a click
+
+}
diff --git a/examples/tram/TramEng.gf b/examples/tram/TramEng.gf
new file mode 100644
index 000000000..b4bc7921b
--- /dev/null
+++ b/examples/tram/TramEng.gf
@@ -0,0 +1,5 @@
+--# -path=.:resource-1.0/abstract:resource-1.0/common:resource-1.0/multimodal:resource-1.0/english:prelude
+
+concrete TramEng of Tram = TramI with
+ (Multimodal = MultimodalEng),
+ (Math = MathEng) ;
diff --git a/examples/tram/TramFre.gf b/examples/tram/TramFre.gf
new file mode 100644
index 000000000..4d6909640
--- /dev/null
+++ b/examples/tram/TramFre.gf
@@ -0,0 +1,5 @@
+--# -path=.:resource/abstract:resource/french:resource/romance:prelude
+
+concrete TramFre of Tram = TramI with
+ (Multimodal = MultimodalFre),
+ (Math = MathFre) ;
diff --git a/examples/tram/TramI.gf b/examples/tram/TramI.gf
new file mode 100644
index 000000000..4ac7775ea
--- /dev/null
+++ b/examples/tram/TramI.gf
@@ -0,0 +1,44 @@
+incomplete concrete TramI of Tram = open Multimodal, Math in {
+
+flags startcat=Query ; lexer=textlit ;
+
+lincat
+ Query = Phr ; -- top level, plain string
+ Input = MS ; -- two parallel sequences (text and clicks)
+ Dep, Dest = MAdv ;
+ Click = Point ;
+
+lin
+ QInput = PhrMS PPos ;
+
+ GoFromTo x y =
+ MPredVP (DemNP (UsePron i_Pron))
+ (MAdvVP (MAdvVP (MComplVV want_VV (MUseV go_V)) x) y) ;
+
+ GoToFrom x y =
+ MPredVP (DemNP (UsePron i_Pron))
+ (MAdvVP (MAdvVP (MComplVV want_VV (MUseV go_V)) x) y) ;
+
+ ComeFrom x =
+ MPredVP (DemNP (UsePron i_Pron))
+ (MAdvVP (MComplVV want_VV (MUseV go_V)) x) ;
+
+ GoTo x =
+ MPredVP (DemNP (UsePron i_Pron))
+ (MAdvVP (MComplVV want_VV (MUseV go_V)) x) ;
+
+ DepClick = here7from_MAdv ;
+ DestClick = here7to_MAdv ;
+ DepHere = DemAdv here7from_Adv ;
+ DestHere = DemAdv here7to_Adv ;
+ DepNamed s = MPrepNP from_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ;
+ DestNamed s = MPrepNP to_Prep (DemNP (UsePN (SymbPN (MkSymb s)))) ;
+
+ CCoord x y = {point = "(" ++ x.s ++ "," ++ y.s ++ ")" ; lock_Point = <>} ;
+
+-- Place = DNP ; -- name + click - not possible for "here"
+-- PClick c = this_DNP c ;
+-- PHere = DemNP this_NP ;
+-- PNamed s = DemNP (UsePN (SymbPN s)) ;
+
+}
diff --git a/examples/tram/TramSwe.gf b/examples/tram/TramSwe.gf
new file mode 100644
index 000000000..70cce6d77
--- /dev/null
+++ b/examples/tram/TramSwe.gf
@@ -0,0 +1,5 @@
+--# -path=.:resource-1.0/abstract:resource-1.0/swedish:resource-1.0/common:resource-1.0/multimodal:resource-1.0/scandinavian:prelude
+
+concrete TramSwe of Tram = TramI with
+ (Multimodal = MultimodalSwe),
+ (Math = MathSwe) ;