mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 00:52:51 -06:00
changed names of resource-1.3; added a note on homepage on release
This commit is contained in:
41
old-examples/tram/ExTramI.gfe
Normal file
41
old-examples/tram/ExTramI.gfe
Normal file
@@ -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 =
|
||||
|
||||
}
|
||||
30
old-examples/tram/README
Normal file
30
old-examples/tram/README
Normal file
@@ -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
|
||||
|
||||
|
||||
36
old-examples/tram/Tram.gf
Normal file
36
old-examples/tram/Tram.gf
Normal file
@@ -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"
|
||||
|
||||
}
|
||||
5
old-examples/tram/TramEng.gf
Normal file
5
old-examples/tram/TramEng.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:multimodal:mathematical:prelude
|
||||
|
||||
concrete TramEng of Tram = TramI with
|
||||
(Multimodal = MultimodalEng),
|
||||
(Symbol = SymbolEng) ;
|
||||
5
old-examples/tram/TramFin.gf
Normal file
5
old-examples/tram/TramFin.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:multimodal:mathematical:prelude
|
||||
|
||||
concrete TramFin of Tram = TramI with
|
||||
(Multimodal = MultimodalFin),
|
||||
(Symbol = SymbolFin) ;
|
||||
5
old-examples/tram/TramFre.gf
Normal file
5
old-examples/tram/TramFre.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:multimodal:mathematical:prelude
|
||||
|
||||
concrete TramFre of Tram = TramI with
|
||||
(Multimodal = MultimodalFre),
|
||||
(Symbol = SymbolFre) ;
|
||||
5
old-examples/tram/TramGer.gf
Normal file
5
old-examples/tram/TramGer.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:multimodal:mathematical:prelude
|
||||
|
||||
concrete TramGer of Tram = TramI with
|
||||
(Multimodal = MultimodalGer),
|
||||
(Symbol = SymbolGer) ;
|
||||
46
old-examples/tram/TramI.gf
Normal file
46
old-examples/tram/TramI.gf
Normal file
@@ -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 =
|
||||
|
||||
}
|
||||
5
old-examples/tram/TramIta.gf
Normal file
5
old-examples/tram/TramIta.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:multimodal:mathematical:prelude
|
||||
|
||||
concrete TramIta of Tram = TramI with
|
||||
(Multimodal = MultimodalIta),
|
||||
(Symbol = SymbolIta) ;
|
||||
5
old-examples/tram/TramNor.gf
Normal file
5
old-examples/tram/TramNor.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:multimodal:mathematical:prelude
|
||||
|
||||
concrete TramNor of Tram = TramI with
|
||||
(Multimodal = MultimodalNor),
|
||||
(Symbol = SymbolNor) ;
|
||||
5
old-examples/tram/TramSpa.gf
Normal file
5
old-examples/tram/TramSpa.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:multimodal:mathematical:prelude
|
||||
|
||||
concrete TramSpa of Tram = TramI with
|
||||
(Multimodal = MultimodalSpa),
|
||||
(Symbol = SymbolSpa) ;
|
||||
5
old-examples/tram/TramSwe.gf
Normal file
5
old-examples/tram/TramSwe.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:present:multimodal:mathematical:prelude
|
||||
|
||||
concrete TramSwe of Tram = TramI with
|
||||
(Multimodal = MultimodalSwe),
|
||||
(Symbol = SymbolSwe) ;
|
||||
Reference in New Issue
Block a user