forked from GitHub/gf-core
godis tram grammars, augmented with Fin
This commit is contained in:
22
examples/godis-tram/Tram/Lines.gf
Normal file
22
examples/godis-tram/Tram/Lines.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
abstract Lines = {
|
||||
cat Line;
|
||||
fun
|
||||
Tram1 : Line ;
|
||||
Tram2 : Line ;
|
||||
Tram3 : Line ;
|
||||
Tram4 : Line ;
|
||||
Tram5 : Line ;
|
||||
Tram6 : Line ;
|
||||
Tram7 : Line ;
|
||||
Tram8 : Line ;
|
||||
Tram9 : Line ;
|
||||
|
||||
Bus34 : Line ;
|
||||
Bus40 : Line ;
|
||||
Bus51 : Line ;
|
||||
Bus60 : Line ;
|
||||
Bus62 : Line ;
|
||||
|
||||
Alvsnabben : Line ;
|
||||
|
||||
}
|
||||
26
examples/godis-tram/Tram/LinesEng.gf
Normal file
26
examples/godis-tram/Tram/LinesEng.gf
Normal file
@@ -0,0 +1,26 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/english
|
||||
|
||||
concrete LinesEng of Lines = open Prelude, CatEng, GodisLangEng in {
|
||||
|
||||
lincat Line = NP;
|
||||
|
||||
lin
|
||||
Tram1 = sing_NP ["tram number 1"];
|
||||
Tram2 = sing_NP ["tram number 2"];
|
||||
Tram3 = sing_NP ["tram number 3"];
|
||||
Tram4 = sing_NP ["tram number 4"];
|
||||
Tram5 = sing_NP ["tram number 5"];
|
||||
Tram6 = sing_NP ["tram number 6"];
|
||||
Tram7 = sing_NP ["tram number 7"];
|
||||
Tram8 = sing_NP ["tram number 8"];
|
||||
Tram9 = sing_NP ["tram number 9"];
|
||||
|
||||
Bus34 = sing_NP ["bus number 34"];
|
||||
Bus40 = sing_NP ["bus number 40"];
|
||||
Bus51 = sing_NP ["bus number 51"];
|
||||
Bus60 = sing_NP ["bus number 60"];
|
||||
Bus62 = sing_NP ["bus number 62"];
|
||||
|
||||
Alvsnabben = sing_NP ["the alvsnabben ferry"];
|
||||
|
||||
}
|
||||
42
examples/godis-tram/Tram/LinesFin.gf
Normal file
42
examples/godis-tram/Tram/LinesFin.gf
Normal file
@@ -0,0 +1,42 @@
|
||||
--# -path=.:../Common:alltenses:mathematical
|
||||
|
||||
concrete LinesFin of Lines = open Prelude, CatFin, GodisLangFin, ParadigmsFin, SymbolFin in {
|
||||
|
||||
lincat Line = NP;
|
||||
|
||||
lin
|
||||
Tram1 = ratikka "1" ;
|
||||
Tram2 = ratikka "2";
|
||||
Tram3 = ratikka "3";
|
||||
Tram4 = ratikka "4";
|
||||
Tram5 = ratikka "5";
|
||||
Tram6 = ratikka "6";
|
||||
Tram7 = ratikka "7";
|
||||
Tram8 = ratikka "8";
|
||||
Tram9 = ratikka "9";
|
||||
|
||||
Bus34 = bussi "34";
|
||||
Bus40 = bussi "40";
|
||||
Bus51 = bussi "51";
|
||||
Bus60 = bussi "60";
|
||||
Bus62 = bussi "62";
|
||||
|
||||
Alvsnabben = mkNP (regN "älvsnabben-lautta") singular ;
|
||||
|
||||
oper
|
||||
|
||||
ratikka : Str -> NP = \s -> CNIntNP (regN "ratikka") (int s) ;
|
||||
bussi : Str -> NP = \s -> CNIntNP (regN "bussi") (int s) ;
|
||||
|
||||
---- this shouldn't be needed
|
||||
int : Str -> {
|
||||
s : Str ;
|
||||
last : % Predef.Ints 9 ;
|
||||
size : % Predef.Ints 1
|
||||
} = \s -> {
|
||||
s = s ;
|
||||
last = 0 ;
|
||||
size = 1
|
||||
} ;
|
||||
|
||||
}
|
||||
25
examples/godis-tram/Tram/LinesSem.gf
Normal file
25
examples/godis-tram/Tram/LinesSem.gf
Normal file
@@ -0,0 +1,25 @@
|
||||
--# -path=.:../Common
|
||||
|
||||
concrete LinesSem of Lines = open Prolog in {
|
||||
|
||||
lincat Line = PStr;
|
||||
|
||||
lin
|
||||
Tram1 = pp0 ["tram_1"];
|
||||
Tram2 = pp0 ["tram_2"];
|
||||
Tram3 = pp0 ["tram_3"];
|
||||
Tram4 = pp0 ["tram_4"];
|
||||
Tram5 = pp0 ["tram_5"];
|
||||
Tram6 = pp0 ["tram_6"];
|
||||
Tram7 = pp0 ["tram_7"];
|
||||
Tram8 = pp0 ["tram_8"];
|
||||
Tram9 = pp0 ["tram_9"];
|
||||
|
||||
Bus34 = pp0 ["bus_34"];
|
||||
Bus40 = pp0 ["bus_40"];
|
||||
Bus51 = pp0 ["bus_51"];
|
||||
Bus60 = pp0 ["bus_60"];
|
||||
Bus62 = pp0 ["bus_62"];
|
||||
|
||||
Alvsnabben = pp0 ["alvsnabben"];
|
||||
}
|
||||
26
examples/godis-tram/Tram/LinesSwe.gf
Normal file
26
examples/godis-tram/Tram/LinesSwe.gf
Normal file
@@ -0,0 +1,26 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/scandinavian:resource-1.0/swedish
|
||||
|
||||
concrete LinesSwe of Lines = open Prelude, CatSwe, GodisLangSwe in {
|
||||
|
||||
lincat Line = NP;
|
||||
|
||||
lin
|
||||
Tram1 = sing_NP ["spårvagn nummer 1"];
|
||||
Tram2 = sing_NP ["spårvagn nummer 2"];
|
||||
Tram3 = sing_NP ["spårvagn nummer 3"];
|
||||
Tram4 = sing_NP ["spårvagn nummer 4"];
|
||||
Tram5 = sing_NP ["spårvagn nummer 5"];
|
||||
Tram6 = sing_NP ["spårvagn nummer 6"];
|
||||
Tram7 = sing_NP ["spårvagn nummer 7"];
|
||||
Tram8 = sing_NP ["spårvagn nummer 8"];
|
||||
Tram9 = sing_NP ["spårvagn nummer 9"];
|
||||
|
||||
Bus34 = sing_NP ["buss nummer 34"];
|
||||
Bus40 = sing_NP ["buss nummer 40"];
|
||||
Bus51 = sing_NP ["buss nummer 51"];
|
||||
Bus60 = sing_NP ["buss nummer 60"];
|
||||
Bus62 = sing_NP ["buss nummer 62"];
|
||||
|
||||
Alvsnabben = sing_NP ["Älvsnabben"];
|
||||
}
|
||||
|
||||
66
examples/godis-tram/Tram/Stops.gf
Normal file
66
examples/godis-tram/Tram/Stops.gf
Normal file
@@ -0,0 +1,66 @@
|
||||
abstract Stops = {
|
||||
|
||||
cat Stop;
|
||||
|
||||
fun
|
||||
Angered : Stop ;
|
||||
AxelDahlstromsTorg : Stop ;
|
||||
Bergsjon : Stop ;
|
||||
Biskopsgarden : Stop ;
|
||||
Botaniska : Stop ;
|
||||
Broplatsen : Stop ;
|
||||
Brunnsbotorget : Stop ;
|
||||
Brunnsparken : Stop ;
|
||||
Centralstationen : Stop ;
|
||||
Chalmers : Stop ;
|
||||
Eriksberg : Stop ;
|
||||
Frihamnen : Stop ;
|
||||
FrolundaTorg : Stop ;
|
||||
Gamlestadstorget : Stop ;
|
||||
Gronsakstorget : Stop ;
|
||||
Guldheden : Stop ;
|
||||
Hagakyrkan : Stop ;
|
||||
Harlanda : Stop ;
|
||||
Hinnebacksgatan : Stop ;
|
||||
HjBrantingsplatsen : Stop ;
|
||||
Jarntorget : Stop ;
|
||||
Kalleback : Stop ;
|
||||
Karralundsgatan : Stop ;
|
||||
Klareberg : Stop ;
|
||||
Klippan : Stop ;
|
||||
Korkarlensgata : Stop ;
|
||||
Korsvagen : Stop ;
|
||||
Kortedala : Stop ;
|
||||
Kungssten : Stop ;
|
||||
Lansmansgarden : Stop ;
|
||||
LillaBommen : Stop ;
|
||||
Lindholmen : Stop ;
|
||||
Linneplatsen : Stop ;
|
||||
LundbyStrand : Stop ;
|
||||
Mariaplan : Stop ;
|
||||
Marklandsgatan : Stop ;
|
||||
Nordstan : Stop ;
|
||||
Olivedalsgatan : Stop ;
|
||||
Olskrokstorget : Stop ;
|
||||
OstraSjukhuset : Stop ;
|
||||
Pilbagsgatan : Stop ;
|
||||
Redbergsplatsen : Stop ;
|
||||
Rosenlund : Stop ;
|
||||
Sahlgrenska : Stop ;
|
||||
Saltholmen : Stop ;
|
||||
SanktSigfridsplan : Stop ;
|
||||
Sannaplan : Stop ;
|
||||
Skogome : Stop ;
|
||||
Sorgardsskolan : Stop ;
|
||||
Stigbergstorget : Stop ;
|
||||
Tagene : Stop ;
|
||||
Torp : Stop ;
|
||||
Tynnered : Stop ;
|
||||
Ullevi : Stop ;
|
||||
Valand : Stop ;
|
||||
VasaViktoriagatan : Stop ;
|
||||
Vasaplatsen : Stop ;
|
||||
WavrinskysPlats : Stop ;
|
||||
|
||||
|
||||
}
|
||||
66
examples/godis-tram/Tram/StopsEng.gf
Normal file
66
examples/godis-tram/Tram/StopsEng.gf
Normal file
@@ -0,0 +1,66 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/english
|
||||
|
||||
concrete StopsEng of Stops = open Prelude, CatEng, GodisLangEng in {
|
||||
|
||||
lincat Stop = NP;
|
||||
|
||||
lin
|
||||
Angered = sing_NP ["angered"];
|
||||
AxelDahlstromsTorg = sing_NP ["axel dahlstroms torg"];
|
||||
Bergsjon = sing_NP ["bergsjon"];
|
||||
Biskopsgarden = sing_NP ["biskopsgarden"];
|
||||
Botaniska = sing_NP ["botaniska"];
|
||||
Broplatsen = sing_NP ["broplatsen"];
|
||||
Brunnsbotorget = sing_NP ["brunnsbotorget"];
|
||||
Brunnsparken = sing_NP ["brunnsparken"];
|
||||
Centralstationen = sing_NP ["centralstationen"];
|
||||
Chalmers = sing_NP ["chalmers"];
|
||||
Eriksberg = sing_NP ["eriksberg"];
|
||||
Frihamnen = sing_NP ["frihamnen"];
|
||||
FrolundaTorg = sing_NP ["frolunda torg"];
|
||||
Gamlestadstorget = sing_NP ["gamlestadstorget"];
|
||||
Gronsakstorget = sing_NP ["gronsakstorget"];
|
||||
Guldheden = sing_NP ["guldheden"];
|
||||
Hagakyrkan = sing_NP ["hagakyrkan"];
|
||||
Harlanda = sing_NP ["harlanda"];
|
||||
Hinnebacksgatan = sing_NP ["hinnebacksgatan"];
|
||||
HjBrantingsplatsen = sing_NP ["hjalmar brantingsplatsen"];
|
||||
Jarntorget = sing_NP ["jarntorget"];
|
||||
Kalleback = sing_NP ["kalleback"];
|
||||
Karralundsgatan = sing_NP ["karralundsgatan"];
|
||||
Klareberg = sing_NP ["klareberg"];
|
||||
Klippan = sing_NP ["klippan"];
|
||||
Korkarlensgata = sing_NP ["korkarlens gata"];
|
||||
Korsvagen = sing_NP ["korsvagen"];
|
||||
Kortedala = sing_NP ["kortedala"];
|
||||
Kungssten = sing_NP ["kungssten"];
|
||||
Lansmansgarden = sing_NP ["lansmansgarden"];
|
||||
LillaBommen = sing_NP ["lilla bommen"];
|
||||
Lindholmen = sing_NP ["lindholmen"];
|
||||
Linneplatsen = sing_NP ["linneplatsen"];
|
||||
LundbyStrand = sing_NP ["lundby strand"];
|
||||
Mariaplan = sing_NP ["mariaplan"];
|
||||
Marklandsgatan = sing_NP ["marklandsgatan"];
|
||||
Nordstan = sing_NP ["nordstan"];
|
||||
Olivedalsgatan = sing_NP ["olivedalsgatan"];
|
||||
Olskrokstorget = sing_NP ["olskrokstorget"];
|
||||
OstraSjukhuset = sing_NP ["ostra sjukhuset"];
|
||||
Pilbagsgatan = sing_NP ["pilbagsgatan"];
|
||||
Redbergsplatsen = sing_NP ["redbergsplatsen"];
|
||||
Rosenlund = sing_NP ["rosenlund"];
|
||||
Sahlgrenska = sing_NP ["sahlgrenska"];
|
||||
Saltholmen = sing_NP ["saltholmen"];
|
||||
SanktSigfridsplan = sing_NP ["sankt sigfrids plan"];
|
||||
Sannaplan = sing_NP ["sannaplan"];
|
||||
Skogome = sing_NP ["skogome"];
|
||||
Sorgardsskolan = sing_NP ["sorgardsskolan"];
|
||||
Stigbergstorget = sing_NP ["stigbergstorget"];
|
||||
Tagene = sing_NP ["tagene"];
|
||||
Torp = sing_NP ["torp"];
|
||||
Tynnered = sing_NP ["tynnered"];
|
||||
Ullevi = sing_NP ["ullevi"];
|
||||
Valand = sing_NP ["valand"];
|
||||
VasaViktoriagatan = sing_NP ["vasa viktoriagatan"];
|
||||
Vasaplatsen = sing_NP ["vasaplatsen"];
|
||||
WavrinskysPlats = sing_NP ["wavrinskys plats"];
|
||||
}
|
||||
71
examples/godis-tram/Tram/StopsFin.gf
Normal file
71
examples/godis-tram/Tram/StopsFin.gf
Normal file
@@ -0,0 +1,71 @@
|
||||
--# -path=.:../Common:alltenses
|
||||
|
||||
concrete StopsFin of Stops = open Prelude, CatFin, GodisLangFin, ParadigmsFin in {
|
||||
|
||||
lincat Stop = NP;
|
||||
|
||||
lin
|
||||
Angered = sing_NP ["angeredia"];
|
||||
AxelDahlstromsTorg = sing_NP ["axel_dahlstroms_torgia"];
|
||||
Bergsjon = sing_NP ["bergsjönia"];
|
||||
Biskopsgarden = sing_NP ["biskopsgardenia"];
|
||||
Botaniska = singNP (nTalo ["botaniska"]);
|
||||
Broplatsen = sing_NP ["broplatsenia"];
|
||||
Brunnsbotorget = sing_NP ["brunnsbotorgetia"];
|
||||
Brunnsparken = sing_NP ["brunnsparkenia"];
|
||||
Centralstationen = sing_NP ["centralstationenia"];
|
||||
Chalmers = sing_NP ["chalmersia"];
|
||||
Eriksberg = sing_NP ["eriksbergia"];
|
||||
Frihamnen = sing_NP ["frihamnenia"];
|
||||
FrolundaTorg = sing_NP ["frölunda_torgia"];
|
||||
Gamlestadstorget = sing_NP ["gamlestadstorgetia"];
|
||||
Gronsakstorget = sing_NP ["grönsakstorgetia"];
|
||||
Guldheden = sing_NP ["guldhedenia"];
|
||||
Hagakyrkan = sing_NP ["hagakyrkania"];
|
||||
Harlanda = singNP (nTalo ["härlanda"]);
|
||||
Hinnebacksgatan = sing_NP ["hinnebäcksgatania"];
|
||||
HjBrantingsplatsen = sing_NP ["hjalmar_brantingsplatsenia"];
|
||||
Jarntorget = sing_NP ["järntorgetia"];
|
||||
Kalleback = sing_NP ["kallebäckia"];
|
||||
Karralundsgatan = sing_NP ["kärralundsgatania"];
|
||||
Klareberg = sing_NP ["klarebergia"]; --- ä
|
||||
Klippan = sing_NP ["klippania"];
|
||||
Korkarlensgata = singNP (nTalo ["körkarlens_gata"]);
|
||||
Korsvagen = sing_NP ["korsvägenia"];
|
||||
Kortedala = sing_NP ["kortedalaia"];
|
||||
Kungssten = sing_NP ["kungsstenia"];
|
||||
Lansmansgarden = sing_NP ["länsmansgardenia"];
|
||||
LillaBommen = sing_NP ["lilla_bommenia"];
|
||||
Lindholmen = sing_NP ["lindholmenia"];
|
||||
Linneplatsen = sing_NP ["linnéplatsenia"];
|
||||
LundbyStrand = sing_NP ["lundby_strandia"];
|
||||
Mariaplan = sing_NP ["mariaplania"];
|
||||
Marklandsgatan = sing_NP ["marklandsgatania"];
|
||||
Nordstan = sing_NP ["nordstania"];
|
||||
Olivedalsgatan = sing_NP ["olivedalsgatania"];
|
||||
Olskrokstorget = sing_NP ["olskrokstorgetia"];
|
||||
OstraSjukhuset = sing_NP ["östra_sjukhusetia"];
|
||||
Pilbagsgatan = sing_NP ["pilbågsgatania"];
|
||||
Redbergsplatsen = sing_NP ["redbergsplatsenia"];
|
||||
Rosenlund = sing_NP ["rosenlundia"];
|
||||
Sahlgrenska = singNP (nTalo ["sahlgrenska"]);
|
||||
Saltholmen = sing_NP ["saltholmenia"];
|
||||
SanktSigfridsplan = sing_NP ["sankt_sigfrids_plania"];
|
||||
Sannaplan = sing_NP ["sannaplania"];
|
||||
Skogome = singNP (nTalo ["skogome"]);
|
||||
Sorgardsskolan = sing_NP ["sorgardsskolania"];
|
||||
Stigbergstorget = sing_NP ["stigbergstorgetia"];
|
||||
Tagene = singNP (nTalo ["tagene"]);
|
||||
Torp = sing_NP ["torpia"];
|
||||
Tynnered = sing_NP ["tynneredia"];
|
||||
Ullevi = singNP (nTalo ["ullevi"]);
|
||||
Valand = sing_NP ["valandia"];
|
||||
VasaViktoriagatan = sing_NP ["vasa_viktoriagatania"];
|
||||
Vasaplatsen = sing_NP ["vasaplatsenia"];
|
||||
WavrinskysPlats = sing_NP ["wavrinskys_platsia"];
|
||||
|
||||
oper
|
||||
|
||||
singNP : N -> NP = \n -> mkNP n singular ;
|
||||
|
||||
}
|
||||
66
examples/godis-tram/Tram/StopsSem.gf
Normal file
66
examples/godis-tram/Tram/StopsSem.gf
Normal file
@@ -0,0 +1,66 @@
|
||||
--# -path=.:../Common
|
||||
|
||||
concrete StopsSem of Stops = open Prolog in {
|
||||
|
||||
lincat Stop = PStr;
|
||||
|
||||
lin
|
||||
Angered = pp0 ["Angered"];
|
||||
AxelDahlstromsTorg = pp0 ["AxelDahlstromsTorg"];
|
||||
Bergsjon = pp0 ["Bergsjon"];
|
||||
Biskopsgarden = pp0 ["Biskopsgarden"];
|
||||
Botaniska = pp0 ["Botaniska"];
|
||||
Broplatsen = pp0 ["Broplatsen"];
|
||||
Brunnsbotorget = pp0 ["Brunnsbotorget"];
|
||||
Brunnsparken = pp0 ["Brunnsparken"];
|
||||
Centralstationen = pp0 ["Centralstationen"];
|
||||
Chalmers = pp0 ["Chalmers"];
|
||||
Eriksberg = pp0 ["Criksberg"];
|
||||
Frihamnen = pp0 ["Frihamnen"];
|
||||
FrolundaTorg = pp0 ["FrolundaTorg"];
|
||||
Gamlestadstorget = pp0 ["Gamlestadstorget"];
|
||||
Gronsakstorget = pp0 ["Gronsakstorget"];
|
||||
Guldheden = pp0 ["Guldheden"];
|
||||
Hagakyrkan = pp0 ["Hagakyrkan"];
|
||||
Harlanda = pp0 ["Harlanda"];
|
||||
Hinnebacksgatan = pp0 ["Hinnebacksgatan"];
|
||||
HjBrantingsplatsen = pp0 ["HjBrantingsplatsen"];
|
||||
Jarntorget = pp0 ["Jarntorget"];
|
||||
Kalleback = pp0 ["Kalleback"];
|
||||
Karralundsgatan = pp0 ["Karralundsgatan"];
|
||||
Klareberg = pp0 ["Klareberg"];
|
||||
Klippan = pp0 ["Klippan"];
|
||||
Korkarlensgata = pp0 ["Korkarlensgata"];
|
||||
Korsvagen = pp0 ["Korsvagen"];
|
||||
Kortedala = pp0 ["Kortedala"];
|
||||
Kungssten = pp0 ["Kungssten"];
|
||||
Lansmansgarden = pp0 ["Lansmansgarden"];
|
||||
LillaBommen = pp0 ["LillaBommen"];
|
||||
Lindholmen = pp0 ["Lindholmen"];
|
||||
Linneplatsen = pp0 ["Linneplatsen"];
|
||||
LundbyStrand = pp0 ["LundbyStrand"];
|
||||
Mariaplan = pp0 ["Mariaplan"];
|
||||
Marklandsgatan = pp0 ["Marklandsgatan"];
|
||||
Nordstan = pp0 ["Nordstan"];
|
||||
Olivedalsgatan = pp0 ["Olivedalsgatan"];
|
||||
Olskrokstorget = pp0 ["Olskrokstorget"];
|
||||
OstraSjukhuset = pp0 ["OstraSjukhuset"];
|
||||
Pilbagsgatan = pp0 ["Pilbagsgatan"];
|
||||
Redbergsplatsen = pp0 ["Redbergsplatsen"];
|
||||
Rosenlund = pp0 ["Rosenlund"];
|
||||
Sahlgrenska = pp0 ["Sahlgrenska"];
|
||||
Saltholmen = pp0 ["Saltholmen"];
|
||||
SanktSigfridsplan = pp0 ["SanktSigfridsPlan"];
|
||||
Sannaplan = pp0 ["Sannaplan"];
|
||||
Skogome = pp0 ["Skogome"];
|
||||
Sorgardsskolan = pp0 ["Sorgardsskolan"];
|
||||
Stigbergstorget = pp0 ["Stigbergstorget"];
|
||||
Tagene = pp0 ["Tagene"];
|
||||
Torp = pp0 ["Torp"];
|
||||
Tynnered = pp0 ["Tynnered"];
|
||||
Ullevi = pp0 ["Ullevi"];
|
||||
Valand = pp0 ["Valand"];
|
||||
VasaViktoriagatan = pp0 ["VasaViktoriagatan"];
|
||||
Vasaplatsen = pp0 ["Vasaplatsen"];
|
||||
WavrinskysPlats = pp0 ["WavrinskysPlats"];
|
||||
}
|
||||
68
examples/godis-tram/Tram/StopsSwe.gf
Normal file
68
examples/godis-tram/Tram/StopsSwe.gf
Normal file
@@ -0,0 +1,68 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/scandinavian:resource-1.0/swedish
|
||||
|
||||
concrete StopsSwe of Stops = open Prelude, CatSwe, GodisLangSwe in {
|
||||
|
||||
lincat Stop = NP;
|
||||
|
||||
lin
|
||||
|
||||
Angered = sing_NP ["angered"];
|
||||
AxelDahlstromsTorg = sing_NP ["axel dahlströms torg"];
|
||||
Bergsjon = sing_NP ["bergsjön"];
|
||||
Biskopsgarden = sing_NP ["biskopsgården"];
|
||||
Botaniska = sing_NP ["botaniska"];
|
||||
Broplatsen = sing_NP ["broplatsen"];
|
||||
Brunnsbotorget = sing_NP ["brunnsbotorget"];
|
||||
Brunnsparken = sing_NP ["brunnsparken"];
|
||||
Centralstationen = sing_NP ["centralstationen"];
|
||||
Chalmers = sing_NP ["chalmers"];
|
||||
Eriksberg = sing_NP ["eriksberg"];
|
||||
Frihamnen = sing_NP ["frihamnen"];
|
||||
FrolundaTorg = sing_NP ["frölunda torg"];
|
||||
Gamlestadstorget = sing_NP ["gamlestadstorget"];
|
||||
Gronsakstorget = sing_NP ["grönsakstorget"];
|
||||
Guldheden = sing_NP ["guldheden"];
|
||||
Hagakyrkan = sing_NP ["hagakyrkan"];
|
||||
Harlanda = sing_NP ["härlanda"];
|
||||
Hinnebacksgatan = sing_NP ["hinnebäcksgatan"];
|
||||
HjBrantingsplatsen = sing_NP ["hjalmar brantingsplatsen"];
|
||||
Jarntorget = sing_NP ["järntorget"];
|
||||
Kalleback = sing_NP ["kallebäck"];
|
||||
Karralundsgatan = sing_NP ["kärralundsgatan"];
|
||||
Klareberg = sing_NP ["klareberg"];
|
||||
Klippan = sing_NP ["klippan"];
|
||||
Korkarlensgata = sing_NP ["körkarlens gata"];
|
||||
Korsvagen = sing_NP ["korsvägen"];
|
||||
Kortedala = sing_NP ["kortedala"];
|
||||
Kungssten = sing_NP ["kungssten"];
|
||||
Lansmansgarden = sing_NP ["länsmansgården"];
|
||||
LillaBommen = sing_NP ["lilla bommen"];
|
||||
Lindholmen = sing_NP ["lindholmen"];
|
||||
Linneplatsen = sing_NP ["linneplatsen"];
|
||||
LundbyStrand = sing_NP ["lundby strand"];
|
||||
Mariaplan = sing_NP ["mariaplan"];
|
||||
Marklandsgatan = sing_NP ["marklandsgatan"];
|
||||
Nordstan = sing_NP ["nordstan"];
|
||||
Olivedalsgatan = sing_NP ["olivedalsgatan"];
|
||||
Olskrokstorget = sing_NP ["olskrokstorget"];
|
||||
OstraSjukhuset = sing_NP ["östra sjukhuset"];
|
||||
Pilbagsgatan = sing_NP ["pilbågsgatan"];
|
||||
Redbergsplatsen = sing_NP ["redbergsplatsen"];
|
||||
Rosenlund = sing_NP ["rosenlund"];
|
||||
Sahlgrenska = sing_NP ["sahlgrenska"];
|
||||
Saltholmen = sing_NP ["saltholmen"];
|
||||
SanktSigfridsplan = sing_NP ["sankt sigfrids plan"];
|
||||
Sannaplan = sing_NP ["sannaplan"];
|
||||
Skogome = sing_NP ["skogome"];
|
||||
Sorgardsskolan = sing_NP ["sorgårdsskolan"];
|
||||
Stigbergstorget = sing_NP ["stigbergstorget"];
|
||||
Tagene = sing_NP ["tagene"];
|
||||
Torp = sing_NP ["torp"];
|
||||
Tynnered = sing_NP ["tynnered"];
|
||||
Ullevi = sing_NP ["ullevi"];
|
||||
Valand = sing_NP ["valand"];
|
||||
VasaViktoriagatan = sing_NP ["vasa viktoriagatan"];
|
||||
Vasaplatsen = sing_NP ["vasaplatsen"];
|
||||
WavrinskysPlats = sing_NP ["wavrinskys plats"];
|
||||
}
|
||||
|
||||
41
examples/godis-tram/Tram/TramLexicon.gf
Normal file
41
examples/godis-tram/Tram/TramLexicon.gf
Normal file
@@ -0,0 +1,41 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common
|
||||
|
||||
abstract TramLexicon = Cat ** {
|
||||
|
||||
fun
|
||||
|
||||
-- The functions should be in alphabetical order
|
||||
-- within each category
|
||||
|
||||
-- Adjectives
|
||||
short_A : A;
|
||||
|
||||
-- Conjunctions
|
||||
and_then_Conj : Conj;
|
||||
|
||||
-- Nouns
|
||||
route_N,
|
||||
stop_N,
|
||||
way_N : N;
|
||||
|
||||
-- Prepositiona
|
||||
from_Prep,
|
||||
to_Prep : Prep;
|
||||
|
||||
-- Verbs-1
|
||||
help_V,
|
||||
restart_V : V;
|
||||
|
||||
-- Verbs-2
|
||||
go_from_V2,
|
||||
go_to_V2,
|
||||
find_V2,
|
||||
findout_V2,
|
||||
take_V2 : V2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
34
examples/godis-tram/Tram/TramLexiconEng.gf
Normal file
34
examples/godis-tram/Tram/TramLexiconEng.gf
Normal file
@@ -0,0 +1,34 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/english
|
||||
|
||||
concrete TramLexiconEng of TramLexicon = CatEng **
|
||||
open Prelude, ParadigmsEng, ParamX, (Lex=LexiconEng), (Irr=IrregEng), GodisLangEng in {
|
||||
|
||||
lin
|
||||
|
||||
-- Adjectives
|
||||
short_A = Lex.short_A;
|
||||
|
||||
-- Conjunctions
|
||||
and_then_Conj = {s = ["and then"]; n = Pl; lock_Conj = <>};
|
||||
|
||||
-- Nouns
|
||||
route_N = regN "route";
|
||||
stop_N = regN "stop";
|
||||
way_N = regN "way";
|
||||
|
||||
-- Prepositions
|
||||
from_Prep = ss "from";
|
||||
to_Prep = ss "to";
|
||||
|
||||
-- Verb-1
|
||||
help_V = regV "help";
|
||||
restart_V = regV "restart";
|
||||
|
||||
-- Verb-2
|
||||
go_from_V2 = dirV2 (partV (regV "go") "from"); --- ??
|
||||
go_to_V2 = dirV2 (partV (regV "go") "to"); --- ??
|
||||
find_V2 = Lex.find_V2;
|
||||
findout_V2 = dirV2 (regV "findout"); --- ??
|
||||
take_V2 = dirV2 Irr.take_V;
|
||||
|
||||
}
|
||||
34
examples/godis-tram/Tram/TramLexiconFin.gf
Normal file
34
examples/godis-tram/Tram/TramLexiconFin.gf
Normal file
@@ -0,0 +1,34 @@
|
||||
--# -path=.:../Common:alltenses
|
||||
|
||||
concrete TramLexiconFin of TramLexicon = CatFin **
|
||||
open Prelude, ParadigmsFin, ParamX, (Lex=LexiconFin), GodisLangFin in {
|
||||
|
||||
lin
|
||||
|
||||
-- Adjectives
|
||||
short_A = Lex.short_A;
|
||||
|
||||
-- Conjunctions
|
||||
and_then_Conj = {s = ["ja sitten"]; n = Pl; lock_Conj = <>};
|
||||
|
||||
-- Nouns
|
||||
route_N = regN "reitti";
|
||||
stop_N = regN "pysäkki";
|
||||
way_N = regN "tie";
|
||||
|
||||
-- Prepositions
|
||||
from_Prep = casePrep from_Case ; ----
|
||||
to_Prep = casePrep to_Case ; ----
|
||||
|
||||
-- Verb-1
|
||||
help_V = regV "auttaa";
|
||||
restart_V = regV "uudelleenaloittaa"; ---- alusta
|
||||
|
||||
-- Verb-2
|
||||
go_from_V2 = caseV2 Lex.go_V from_Case ;
|
||||
go_to_V2 = caseV2 Lex.go_V to_Case ;
|
||||
find_V2 = Lex.find_V2;
|
||||
findout_V2 = dirV2 (regV "selvittää");
|
||||
take_V2 = dirV2 (regV "ottaa") ;
|
||||
|
||||
}
|
||||
40
examples/godis-tram/Tram/TramLexiconSwe.gf
Normal file
40
examples/godis-tram/Tram/TramLexiconSwe.gf
Normal file
@@ -0,0 +1,40 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/scandinavian:resource-1.0/swedish
|
||||
|
||||
concrete TramLexiconSwe of TramLexicon = CatSwe **
|
||||
open Prelude, ParadigmsSwe, ParamX, (Lex=LexiconSwe), (Irr=IrregSwe), GodisLangSwe in {
|
||||
|
||||
lin
|
||||
|
||||
-- Adjectives
|
||||
short_A = Lex.short_A;
|
||||
|
||||
-- Conjunctions
|
||||
and_then_Conj = {s = ["och sedan"]; n = Pl; lock_Conj = <>};
|
||||
|
||||
-- Nouns
|
||||
route_N = regGenN "rutt" utrum;
|
||||
stop_N = regGenN "hållplats" utrum;
|
||||
way_N = regGenN "väg" utrum;
|
||||
|
||||
-- Prepositions
|
||||
from_Prep = ss "från";
|
||||
to_Prep = ss "till";
|
||||
|
||||
-- Verb-1
|
||||
help_V = regV "hjälpa";
|
||||
restart_V = partV (regV "starta") "om";
|
||||
|
||||
-- Verb-2
|
||||
go_from_V2 = dirV2 (partV åka_V "från");
|
||||
go_to_V2 = dirV2 (partV åka_V "till");
|
||||
find_V2 = dirV2 (regV "hittar");
|
||||
findout_V2 = dirV2 (Irr.finna_V);
|
||||
take_V2 = dirV2 (ta_V);
|
||||
|
||||
|
||||
oper
|
||||
åka_V : V = irregV "åka" "åkte" "åkt";
|
||||
ta_V : V = mkV "ta" "tar" "ta" "tog" "tagit" "tagen";
|
||||
|
||||
|
||||
}
|
||||
64
examples/godis-tram/Tram/TramSystem.gf
Normal file
64
examples/godis-tram/Tram/TramSystem.gf
Normal file
@@ -0,0 +1,64 @@
|
||||
--# -path=.:../Common:prelude
|
||||
|
||||
abstract TramSystem = GodisSystem, Stops, Lines ** {
|
||||
|
||||
cat
|
||||
Route; -- route descripiption.
|
||||
Leg;
|
||||
[Leg]{2}; -- route segments on a line
|
||||
-- the following are derived from declaring [Leg]{2}:
|
||||
-- BaseLeg : Leg -> Leg -> [Leg];
|
||||
-- ConsLeg : Leg -> [Leg] -> [Leg];
|
||||
|
||||
|
||||
fun
|
||||
|
||||
-----------------------------------------------------------------
|
||||
-- Functions for creating routes
|
||||
|
||||
lineLeg : Line -> Stop -> Stop -> Leg;
|
||||
|
||||
oneLeg : Leg -> Route;
|
||||
mkRoute : [Leg] -> Route;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- Predicates
|
||||
-- Questions and Propositions as they are intended to be used
|
||||
-- by either System or User
|
||||
|
||||
-- U: what is the shortest route?
|
||||
shortest_route_Q : Question;
|
||||
|
||||
-- S: Take Tram Z from X to Y. Take...
|
||||
shortest_route_P : Route -> Proposition;
|
||||
|
||||
-- S: Where do you want to go to?
|
||||
dest_stop_Q : Question;
|
||||
|
||||
-- U: I want to go to Stop
|
||||
dest_stop_P : Stop -> Proposition;
|
||||
|
||||
-- S: Where do you want to go from?
|
||||
dept_stop_Q : Question;
|
||||
|
||||
-- U: I want to go from Stop
|
||||
dept_stop_P : Stop -> Proposition;
|
||||
|
||||
|
||||
-----------------------------------------------------------------
|
||||
-- Short answers
|
||||
|
||||
-- U: "klippan"
|
||||
stop : Stop -> ShortAns;
|
||||
|
||||
|
||||
------------------------------------------------------------------
|
||||
-- Actions
|
||||
|
||||
-- S: GoTGoDiS is a tram information system
|
||||
help: Action;
|
||||
|
||||
-- S: restarting
|
||||
top: Action;
|
||||
|
||||
}
|
||||
5
examples/godis-tram/Tram/TramSystemEng.gf
Normal file
5
examples/godis-tram/Tram/TramSystemEng.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/english
|
||||
|
||||
concrete TramSystemEng of TramSystem = GodisSystemEng, StopsEng, LinesEng ** TramSystemI with
|
||||
(Grammar=GrammarEng), (GodisLang=GodisLangEng), (TramLexicon=TramLexiconEng);
|
||||
|
||||
5
examples/godis-tram/Tram/TramSystemFin.gf
Normal file
5
examples/godis-tram/Tram/TramSystemFin.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../Common:prelude:alltenses:mathematical
|
||||
|
||||
concrete TramSystemFin of TramSystem = GodisSystemFin, StopsFin, LinesFin ** TramSystemI with
|
||||
(Grammar=GrammarFin), (GodisLang=GodisLangFin), (TramLexicon=TramLexiconFin);
|
||||
|
||||
49
examples/godis-tram/Tram/TramSystemI.gf
Normal file
49
examples/godis-tram/Tram/TramSystemI.gf
Normal file
@@ -0,0 +1,49 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common
|
||||
|
||||
incomplete concrete TramSystemI of TramSystem =
|
||||
GodisSystemI ** open Grammar, GodisLang, TramLexicon in {
|
||||
|
||||
lincat
|
||||
Route = NP;
|
||||
Leg = NP;
|
||||
[Leg] = [NP];
|
||||
|
||||
|
||||
lin
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Route
|
||||
|
||||
lineLeg line from to = AdvNP (AdvNP line (PrepNP from_Prep from)) (PrepNP to_Prep to);
|
||||
|
||||
oneLeg leg = leg;
|
||||
mkRoute legs = ConjNP and_then_Conj legs;
|
||||
BaseLeg = BaseNP;
|
||||
ConsLeg = ConsNP;
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Predicates and Questions
|
||||
|
||||
shortest_route_Q = isDoing ** what_is_NP (the_A_super_N_sg short_A route_N);
|
||||
shortest_route_P x = isDoing ** GenericCl (ComplV2 take_V2 x);
|
||||
|
||||
dest_stop_Q = isDoing ** which_N_do_you_want_to_V2 stop_N go_to_V2;
|
||||
dest_stop_P x = isDoing ** you_want_to_VP (ComplV2 go_to_V2 x);
|
||||
|
||||
dept_stop_Q = isDoing ** which_N_do_you_want_to_V2 stop_N go_from_V2;
|
||||
dept_stop_P x = isDoing ** you_want_to_VP (ComplV2 go_from_V2 x);
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
-- Short Answers
|
||||
|
||||
stop x = x;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- Actions
|
||||
|
||||
top = isDoing ** UseV restart_V;
|
||||
|
||||
help = isDoing ** UseV help_V;
|
||||
|
||||
}
|
||||
45
examples/godis-tram/Tram/TramSystemSem.gf
Normal file
45
examples/godis-tram/Tram/TramSystemSem.gf
Normal file
@@ -0,0 +1,45 @@
|
||||
--# -path=.:../Common:prelude
|
||||
|
||||
concrete TramSystemSem of TramSystem = GodisSystemSem, StopsSem, LinesSem ** open Prolog in {
|
||||
|
||||
lincat
|
||||
Route,
|
||||
Leg,
|
||||
[Leg] = PStr;
|
||||
|
||||
lin
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Route
|
||||
|
||||
lineLeg line s1 s2 = pp3 "leg" line s1 s2;
|
||||
|
||||
oneLeg leg = pList1 leg;
|
||||
mkRoute legs = pBrackets legs;
|
||||
BaseLeg leg leg' = pSeq leg leg';
|
||||
ConsLeg leg legs = pSeq leg legs;
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Predicates and questions
|
||||
|
||||
shortest_route_Q = pWhQ "shortest_path";
|
||||
shortest_route_P route = pp1 "shortest_path" route;
|
||||
|
||||
dest_stop_Q = pWhQ "dest_stop";
|
||||
dest_stop_P = pp1 "dest_stop";
|
||||
|
||||
dept_stop_Q = pWhQ "dept_stop";
|
||||
dept_stop_P = pp1 "dept_stop";
|
||||
|
||||
------------------------------------------------------------
|
||||
-- Short answers
|
||||
|
||||
stop = pp1 "stop";
|
||||
|
||||
-------------------------------------------------------------
|
||||
-- Actions
|
||||
|
||||
top = pp0 "top";
|
||||
help = pp0 "help";
|
||||
|
||||
}
|
||||
4
examples/godis-tram/Tram/TramSystemSwe.gf
Normal file
4
examples/godis-tram/Tram/TramSystemSwe.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/scandinavian:resource-1.0/swedish
|
||||
|
||||
concrete TramSystemSwe of TramSystem = GodisSystemSwe, StopsSwe, LinesSwe ** TramSystemI with
|
||||
(Grammar=GrammarSwe), (GodisLang=GodisLangSwe), (TramLexicon=TramLexiconSwe);
|
||||
62
examples/godis-tram/Tram/TramUser.gf
Normal file
62
examples/godis-tram/Tram/TramUser.gf
Normal file
@@ -0,0 +1,62 @@
|
||||
--# -path=.:../Common:prelude
|
||||
|
||||
abstract TramUser = GodisUser, Stops ** {
|
||||
|
||||
fun
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Predicates
|
||||
-- Questions used by the User
|
||||
|
||||
-- "find a route"
|
||||
shortest_route : Question;
|
||||
|
||||
-- "I want to go from chalmers"
|
||||
shortest_route__dept : Stop -> Question;
|
||||
|
||||
-- "I want to go to chalmers"
|
||||
shortest_route__dest : Stop -> Question;
|
||||
|
||||
-- "I want to go from chalmers to valand"
|
||||
shortest_route__dept_dest : Stop -> Stop -> Question;
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Answers
|
||||
|
||||
-- "from chalmers"
|
||||
dept_stop : Stop -> Answer;
|
||||
|
||||
-- "to chalmers"
|
||||
dest_stop : Stop -> Answer;
|
||||
|
||||
-- "from valand to chalmers"
|
||||
dept_dest_stop : Stop -> Stop -> Answer;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- Short answers
|
||||
|
||||
-- "chalmers"
|
||||
stop : Stop -> ShortAns;
|
||||
|
||||
-- "valand to chalmers"
|
||||
stop_dest_stop: Stop -> Stop -> ShortAns;
|
||||
|
||||
-- "valand from chalmers"
|
||||
stop_dept_stop: Stop -> Stop -> ShortAns;
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
-- Actions
|
||||
|
||||
-- U: restart
|
||||
top : Action;
|
||||
|
||||
-- U: help
|
||||
help : Action;
|
||||
|
||||
-- print_info,
|
||||
-- download_info,
|
||||
-- read_info : Action;
|
||||
|
||||
|
||||
}
|
||||
59
examples/godis-tram/Tram/TramUserEng.gf
Normal file
59
examples/godis-tram/Tram/TramUserEng.gf
Normal file
@@ -0,0 +1,59 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/english
|
||||
|
||||
concrete TramUserEng of TramUser = GodisUserEng, StopsEng ** TramUserI
|
||||
with (Grammar=GrammarEng), (GodisLang=GodisLangEng),
|
||||
(TramSystemI=TramSystemEng), (TramLexicon=TramLexiconEng);
|
||||
|
||||
-- concrete TramUserEng of TramUser = GodisUserEng, StopsEng **
|
||||
-- open Prelude, GodisLangEng, TramSystemEng, ResEng, TramLexiconEng in {
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- -- Predicates and questions
|
||||
|
||||
-- lin
|
||||
|
||||
-- shortest_route
|
||||
-- = variants{ askQS shortest_route_Q;
|
||||
-- ss (variants{["find"]; ["find out"]; ["get"]; ["ask for"]} ++
|
||||
-- variants{["a route"]; ["shortest route"];["a way"];["a itinerary"]})};
|
||||
|
||||
-- shortest_route__dept x
|
||||
-- = ss ( ["i want to go from"] ++ x.s!Nom);
|
||||
|
||||
|
||||
-- shortest_route__dest x
|
||||
-- = ss ( ["i want to go to"] ++ x.s!Nom);
|
||||
|
||||
|
||||
-- shortest_route__dept_dest x y
|
||||
-- = ss ( variants{["i want to go from"] ++ x.s!Nom ++ "to" ++ y.s!Nom;
|
||||
-- ["i want to go to"] ++ y.s!Nom ++ "from" ++ x.s!Nom} );
|
||||
|
||||
|
||||
-- dest_stop x = ss( "to" ++ x.s!Nom);
|
||||
-- dept_stop x = ss( "from" ++ x.s!Nom);
|
||||
|
||||
-- dept_dest_stop x y = ss(variants{"to" ++ y.s!Nom ++ "from" ++ x.s!Nom;
|
||||
-- "from" ++ x.s!Nom ++ "to" ++ y.s!Nom} );
|
||||
|
||||
-- stop_dest_stop x y = ss(x.s!Nom ++ "to" ++ y.s!Nom);
|
||||
-- stop_dept_stop x y = ss(x.s!Nom ++ "from" ++ y.s!Nom);
|
||||
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- -- short answers
|
||||
-- lin
|
||||
|
||||
-- stop x = ansNP x;
|
||||
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- -- Actions
|
||||
-- lin
|
||||
|
||||
-- top = reqVP top;
|
||||
|
||||
-- help = reqVP help;
|
||||
|
||||
-- }
|
||||
|
||||
14
examples/godis-tram/Tram/TramUserFin.gf
Normal file
14
examples/godis-tram/Tram/TramUserFin.gf
Normal file
@@ -0,0 +1,14 @@
|
||||
--# -path=.:../Common:prelude:alltenses:mathematical
|
||||
|
||||
concrete TramUserFin of TramUser = TramUserFin0-[stop_dest_stop, stop_dept_stop] **
|
||||
open GrammarFin, GodisLangFin, TramLexiconFin in {
|
||||
|
||||
lin
|
||||
stop_dest_stop x y =
|
||||
UttAdv (mkAdv (
|
||||
fromStr Adv (PrepNP (casePrep from_Case) x) ++
|
||||
fromStr Adv (PrepNP (casePrep to_Case) y)
|
||||
)
|
||||
) ;
|
||||
}
|
||||
|
||||
6
examples/godis-tram/Tram/TramUserFin0.gf
Normal file
6
examples/godis-tram/Tram/TramUserFin0.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../Common:prelude:alltenses:mathematical
|
||||
|
||||
concrete TramUserFin0 of TramUser = GodisUserFin, StopsFin ** TramUserI
|
||||
with (Grammar=GrammarFin), (GodisLang=GodisLangFin),
|
||||
(TramSystemI=TramSystemFin), (TramLexicon=TramLexiconFin);
|
||||
|
||||
56
examples/godis-tram/Tram/TramUserI.gf
Normal file
56
examples/godis-tram/Tram/TramUserI.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common
|
||||
|
||||
incomplete concrete TramUserI of TramUser = GodisUserI **
|
||||
open Prelude, Grammar, GodisLang, TramSystemI, TramLexicon in {
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- Predicates and questions
|
||||
|
||||
lin
|
||||
|
||||
shortest_route
|
||||
= variants{ askQS shortest_route_Q;
|
||||
reqVP (ComplV2 (variants{find_V2;findout_V2})
|
||||
(variants {indef_N_sg (variants{way_N;route_N});
|
||||
(the_A_super_N_sg short_A (variants{way_N;route_N}))})) };
|
||||
|
||||
shortest_route__dept x
|
||||
= reqVP (ComplV2 go_from_V2 x);
|
||||
|
||||
shortest_route__dest x
|
||||
= reqVP (ComplV2 go_to_V2 x);
|
||||
|
||||
shortest_route__dept_dest x y
|
||||
= variants{ reqVP (AdvVP (ComplV2 go_from_V2 x) (Prep_NP to_Prep y));
|
||||
reqVP (AdvVP (ComplV2 go_to_V2 y) (Prep_NP from_Prep y)) };
|
||||
|
||||
|
||||
dest_stop x = UttAdv (Prep_NP to_Prep x);
|
||||
dept_stop x = UttAdv (Prep_NP from_Prep x);
|
||||
|
||||
dept_dest_stop x y
|
||||
= variants{ UttAdv (Prep_NP to_Prep (NP_Prep_NP from_Prep x y));
|
||||
UttAdv (Prep_NP from_Prep (NP_Prep_NP to_Prep x y)) };
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- short answers
|
||||
lin
|
||||
|
||||
stop x = ansNP x;
|
||||
|
||||
stop_dest_stop x y = ansNP (NP_Prep_NP to_Prep x y);
|
||||
stop_dept_stop x y = ansNP (NP_Prep_NP from_Prep x y);
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- Actions
|
||||
lin
|
||||
|
||||
top = reqVP top;
|
||||
|
||||
help = reqVP help;
|
||||
|
||||
}
|
||||
|
||||
39
examples/godis-tram/Tram/TramUserSem.gf
Normal file
39
examples/godis-tram/Tram/TramUserSem.gf
Normal file
@@ -0,0 +1,39 @@
|
||||
--# -path=.:../Common:prelude
|
||||
|
||||
concrete TramUserSem of TramUser = GodisUserSem, StopsSem **
|
||||
open Prolog, TramSystemSem in {
|
||||
|
||||
lin
|
||||
|
||||
-------------------------------------------------------------
|
||||
-- Predicates and questions
|
||||
|
||||
shortest_route = pm1 (ask shortest_route_Q);
|
||||
|
||||
shortest_route__dept x = pm2 (ask shortest_route_Q) (answer (dept_stop_P x));
|
||||
shortest_route__dest x = pm2 (ask shortest_route_Q) (answer (dest_stop_P x));
|
||||
|
||||
shortest_route__dept_dest x y = pm3 (ask shortest_route_Q) (answer (dept_stop_P x)) (answer (dest_stop_P y));
|
||||
|
||||
dest_stop x = pm1 (answer (dest_stop_P x));
|
||||
dept_stop x = pm1 (answer (dept_stop_P x));
|
||||
|
||||
dept_dest_stop x y = pm2 (answer (dept_stop_P x)) (answer (dest_stop_P y));
|
||||
|
||||
|
||||
--------------------------------------------------
|
||||
-- Short answers
|
||||
|
||||
stop x = pm1 (shortAns (stop x));
|
||||
|
||||
stop_dest_stop x y = pm2 (shortAns(stop x)) (answer(dest_stop_P y));
|
||||
stop_dept_stop x y = pm2 (shortAns(stop x)) (answer(dept_stop_P y));
|
||||
|
||||
|
||||
------------------------------------------------------
|
||||
-- Actions
|
||||
top = pm1 (request top);
|
||||
help = pm1 (request help);
|
||||
|
||||
}
|
||||
|
||||
57
examples/godis-tram/Tram/TramUserSwe.gf
Normal file
57
examples/godis-tram/Tram/TramUserSwe.gf
Normal file
@@ -0,0 +1,57 @@
|
||||
--# -path=.:../Common:prelude:resource-1.0/abstract:resource-1.0/common:resource-1.0/scandinavian:resource-1.0/swedish
|
||||
|
||||
concrete TramUserSwe of TramUser = GodisUserSwe, StopsSwe ** TramUserI
|
||||
with (Grammar=GrammarSwe), (GodisLang=GodisLangSwe),
|
||||
(TramSystemI=TramSystemSwe), (TramLexicon=TramLexiconSwe);
|
||||
|
||||
-- concrete TramUserSwe of TramUser = GodisUserSwe, StopsSwe **
|
||||
-- open Prelude, GrammarSwe, GodisLangSwe, TramLexiconSwe, TramSystemSwe, CommonScand in {
|
||||
|
||||
-- ------------------------------------------------------------------------
|
||||
-- -- Predicates
|
||||
|
||||
-- lin
|
||||
|
||||
-- shortest_route
|
||||
-- = variants{ askQS shortest_route_Q;
|
||||
-- ss (variants{["hitta"]; ["ge mig"]; ["fråga efter"]} ++
|
||||
-- variants{["en rutt"]; ["kortaste vägen"]; ["en resväg"]})};
|
||||
|
||||
-- shortest_route__dept x
|
||||
-- = ss ( ["jag vill åka från"] ++ x.s!NPNom);
|
||||
|
||||
-- shortest_route__dest x
|
||||
-- = ss ( ["jag vill åka till"] ++ x.s!NPNom);
|
||||
|
||||
-- shortest_route__dept_dest x y
|
||||
-- = ss ( variants{["jag vill åka från"] ++ x.s!NPNom ++ "till" ++ y.s!NPNom ;
|
||||
-- ["jag vill åka till"] ++ y.s!NPNom ++ "från" ++ x.s!NPNom} );
|
||||
|
||||
-- dest_stop x = ss( "till" ++ x.s!NPNom);
|
||||
-- dept_stop x = ss( "från" ++ x.s!NPNom);
|
||||
|
||||
-- dept_dest_stop x y = ss(variants{"till" ++ y.s!NPNom ++ "från" ++ x.s!NPNom;
|
||||
-- "från" ++ x.s!NPNom ++ "till" ++ y.s!NPNom} );
|
||||
|
||||
-- stop_dest_stop x y = ss(x.s!NPNom ++ "till" ++ y.s!NPNom);
|
||||
-- stop_dept_stop x y = ss(x.s!NPNom ++ "från" ++ y.s!NPNom);
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- -- Short answers
|
||||
-- lin
|
||||
-- stop x = ansNP x;
|
||||
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- -- Actions
|
||||
|
||||
-- lin
|
||||
-- top = reqVP top;
|
||||
|
||||
-- help = variants{ reqVP help;
|
||||
-- ss ["hur gör jag nu"] };
|
||||
|
||||
|
||||
|
||||
-- }
|
||||
|
||||
Reference in New Issue
Block a user