summaryrefslogtreecommitdiff
path: root/old-examples/tram
diff options
context:
space:
mode:
Diffstat (limited to 'old-examples/tram')
-rw-r--r--old-examples/tram/ExTramI.gfe41
-rw-r--r--old-examples/tram/README30
-rw-r--r--old-examples/tram/Tram.gf36
-rw-r--r--old-examples/tram/TramEng.gf5
-rw-r--r--old-examples/tram/TramFin.gf5
-rw-r--r--old-examples/tram/TramFre.gf5
-rw-r--r--old-examples/tram/TramGer.gf5
-rw-r--r--old-examples/tram/TramI.gf46
-rw-r--r--old-examples/tram/TramIta.gf5
-rw-r--r--old-examples/tram/TramNor.gf5
-rw-r--r--old-examples/tram/TramSpa.gf5
-rw-r--r--old-examples/tram/TramSwe.gf5
12 files changed, 193 insertions, 0 deletions
diff --git a/old-examples/tram/ExTramI.gfe b/old-examples/tram/ExTramI.gfe
new file mode 100644
index 000000000..f1a07af09
--- /dev/null
+++ b/old-examples/tram/ExTramI.gfe
@@ -0,0 +1,41 @@
+--# -resource=multimodal/MultimodalEng.gfc
+--# -path=multimodal:present:mathematical:prelude
+
+incomplete concrete TramI of Tram = open Multimodal, DemRes, Symbol in {
+
+flags startcat=Query ; lexer=literals ;
+
+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_MAdv y_MAdv = in MultimodalEng.MS "I want to go X Y" ;
+
+ ComeToFrom x_MAdv y_MAdv = in MultimodalEng.MS "I want to come X Y" ;
+
+ ComeFrom x_MAdv = in MultimodalEng.MS "I want to come X" ;
+
+ GoTo x_MAdv = in MultimodalEng.MS "I want to go X" ;
+
+ DepClick c = mkDem Adv (in MAdv "from here") c ;
+ DestClick c = mkDem Adv (in MAdv "to here") c ;
+ DepHere = DemAdv (in Adv "from here") ;
+ DestHere = DemAdv (in Adv "to here") ;
+ 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)) ;
+
+---- FromThisPlace =
+
+}
diff --git a/old-examples/tram/README b/old-examples/tram/README
new file mode 100644
index 000000000..c4f606380
--- /dev/null
+++ b/old-examples/tram/README
@@ -0,0 +1,30 @@
+Björn Bringert's tram grammars (user side, without place names)
+implemented as an example of lib/resource/abstract/Multimodal.
+
+For documentation of the original system, see
+
+ http://www.cs.chalmers.se/~bringert/gf/tramdemo.html
+
+To try, do in gf
+
+ i TramEng.gf
+ gr | l -tr | p
+
+Clicks appear as coordinates on the right of the semicolon.
+This works in eight languages.
+
+Notice that the compilation of the grammars uses precompiled
+resources, located in
+
+ GF/lib/
+
+To produce them, use 'make' and 'make install' in GF/lib/resource-1.0.
+You moreover have to set your GF_LIB_PATH to point to your GF/lib/.
+
+The grammar in ExTramI.gfe compiles, but does not give the same grammar
+as TramI.gf.
+
+
+AR 7/11/2005 -- 6/3/2006
+
+
diff --git a/old-examples/tram/Tram.gf b/old-examples/tram/Tram.gf
new file mode 100644
index 000000000..5392d1c73
--- /dev/null
+++ b/old-examples/tram/Tram.gf
@@ -0,0 +1,36 @@
+abstract Tram = PredefAbs ** {
+
+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"
+ ComeToFrom: Dest -> Dep -> Input ; -- user input "want to come to a from b"
+ ComeFrom : Dep -> Input ; -- user input "want to come from x (to where I'm now)
+ GoTo : Dest -> Input ; -- user input "want to go to x (from where I'm 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
+
+-- FromThisPlace : Dep ; -- "from this place"
+-- ToThisPlace : Dest ; -- "to this place"
+
+}
diff --git a/old-examples/tram/TramEng.gf b/old-examples/tram/TramEng.gf
new file mode 100644
index 000000000..ce2f4e845
--- /dev/null
+++ b/old-examples/tram/TramEng.gf
@@ -0,0 +1,5 @@
+--# -path=.:present:multimodal:mathematical:prelude
+
+concrete TramEng of Tram = TramI with
+ (Multimodal = MultimodalEng),
+ (Symbol = SymbolEng) ;
diff --git a/old-examples/tram/TramFin.gf b/old-examples/tram/TramFin.gf
new file mode 100644
index 000000000..ae7a7e4ad
--- /dev/null
+++ b/old-examples/tram/TramFin.gf
@@ -0,0 +1,5 @@
+--# -path=.:present:multimodal:mathematical:prelude
+
+concrete TramFin of Tram = TramI with
+ (Multimodal = MultimodalFin),
+ (Symbol = SymbolFin) ;
diff --git a/old-examples/tram/TramFre.gf b/old-examples/tram/TramFre.gf
new file mode 100644
index 000000000..43039e420
--- /dev/null
+++ b/old-examples/tram/TramFre.gf
@@ -0,0 +1,5 @@
+--# -path=.:present:multimodal:mathematical:prelude
+
+concrete TramFre of Tram = TramI with
+ (Multimodal = MultimodalFre),
+ (Symbol = SymbolFre) ;
diff --git a/old-examples/tram/TramGer.gf b/old-examples/tram/TramGer.gf
new file mode 100644
index 000000000..678974a52
--- /dev/null
+++ b/old-examples/tram/TramGer.gf
@@ -0,0 +1,5 @@
+--# -path=.:present:multimodal:mathematical:prelude
+
+concrete TramGer of Tram = TramI with
+ (Multimodal = MultimodalGer),
+ (Symbol = SymbolGer) ;
diff --git a/old-examples/tram/TramI.gf b/old-examples/tram/TramI.gf
new file mode 100644
index 000000000..31dbaab59
--- /dev/null
+++ b/old-examples/tram/TramI.gf
@@ -0,0 +1,46 @@
+incomplete concrete TramI of Tram = open Multimodal, Symbol in {
+
+flags startcat=Query ; lexer=literals ;
+
+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) ;
+
+ ComeToFrom x y =
+ MPredVP (DemNP (UsePron i_Pron))
+ (MAdvVP (MAdvVP (MComplVV want_VV (MUseV come_V)) x) y) ;
+
+ ComeFrom x =
+ MPredVP (DemNP (UsePron i_Pron))
+ (MAdvVP (MComplVV want_VV (MUseV come_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)) ;
+
+---- FromThisPlace =
+
+}
diff --git a/old-examples/tram/TramIta.gf b/old-examples/tram/TramIta.gf
new file mode 100644
index 000000000..581ab6ad1
--- /dev/null
+++ b/old-examples/tram/TramIta.gf
@@ -0,0 +1,5 @@
+--# -path=.:present:multimodal:mathematical:prelude
+
+concrete TramIta of Tram = TramI with
+ (Multimodal = MultimodalIta),
+ (Symbol = SymbolIta) ;
diff --git a/old-examples/tram/TramNor.gf b/old-examples/tram/TramNor.gf
new file mode 100644
index 000000000..70392de35
--- /dev/null
+++ b/old-examples/tram/TramNor.gf
@@ -0,0 +1,5 @@
+--# -path=.:present:multimodal:mathematical:prelude
+
+concrete TramNor of Tram = TramI with
+ (Multimodal = MultimodalNor),
+ (Symbol = SymbolNor) ;
diff --git a/old-examples/tram/TramSpa.gf b/old-examples/tram/TramSpa.gf
new file mode 100644
index 000000000..822adad9d
--- /dev/null
+++ b/old-examples/tram/TramSpa.gf
@@ -0,0 +1,5 @@
+--# -path=.:present:multimodal:mathematical:prelude
+
+concrete TramSpa of Tram = TramI with
+ (Multimodal = MultimodalSpa),
+ (Symbol = SymbolSpa) ;
diff --git a/old-examples/tram/TramSwe.gf b/old-examples/tram/TramSwe.gf
new file mode 100644
index 000000000..98886d5c5
--- /dev/null
+++ b/old-examples/tram/TramSwe.gf
@@ -0,0 +1,5 @@
+--# -path=.:present:multimodal:mathematical:prelude
+
+concrete TramSwe of Tram = TramI with
+ (Multimodal = MultimodalSwe),
+ (Symbol = SymbolSwe) ;