mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-06 09:42:50 -06:00
added Ann-Charlotte's grammars
This commit is contained in:
5
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/DB.gf
Normal file
5
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/DB.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../../Resource/Media:../../Resource/Time:
|
||||
|
||||
abstract DB = TVStations, Time, Weekday ** {
|
||||
|
||||
}
|
||||
5
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/DBEng.gf
Normal file
5
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/DBEng.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../../Resource/Media:../../Resource/Time:
|
||||
|
||||
concrete DBEng of DB = TVStationsEng, TimeEng, WeekdayEng ** {
|
||||
|
||||
}
|
||||
5
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/DBPro.gf
Normal file
5
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/DBPro.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../../Resource/Media:../../Resource/Time:
|
||||
|
||||
concrete DBPro of DB = TVStationsPro, TimeProlog, WeekdayProlog ** {
|
||||
|
||||
}
|
||||
5
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/DBSwe.gf
Normal file
5
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/DBSwe.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../../Resource/Media:../../Resource/Time:
|
||||
|
||||
concrete DBSwe of DB = TVStationsSwe, TimeSwe, WeekdaySwe ** {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
--# -path=.:../:../../../Resource/Time:../Shared:../../../Core:../../../Core/Shared:
|
||||
|
||||
abstract sharedDomain = sharedCore, DB, Time, Weekday ** {
|
||||
|
||||
fun
|
||||
|
||||
-- ANSWERS
|
||||
|
||||
--makeAddLocAnswer : Location -> Proposition addTask;
|
||||
--makeRemLocAnswer : Location -> Proposition removeTask;
|
||||
|
||||
makeAddEventAnswer : Event -> Proposition addTask;
|
||||
makeRemEventAnswer : Event -> Proposition removeTask;
|
||||
makeCheckupAnswer : Event -> Proposition checkupTask;
|
||||
makeCheckTimeAnswer : Event -> Proposition checkTimeTask;
|
||||
makeAddInfoAnswer : Event -> Proposition addInfoTask;
|
||||
|
||||
makeAddEventTimeAnswer : Time -> Proposition addTask;
|
||||
makeRemEventTimeAnswer : Time -> Proposition removeTask;
|
||||
makeCheckupTimeAnswer : Time -> Proposition checkupTask;
|
||||
makeCheckTimeTimeAnswer : Time -> Proposition checkTimeTask;
|
||||
makeAddInfoTimeAnswer : Time -> Proposition addInfoTask;
|
||||
|
||||
makeAddEventDayAnswer : Weekday -> Proposition addTask;
|
||||
makeRemEventDayAnswer : Weekday -> Proposition removeTask;
|
||||
makeCheckupDayAnswer : Weekday -> Proposition checkupTask;
|
||||
makeCheckTimeDayAnswer : Weekday -> Proposition checkTimeTask;
|
||||
makeAddInfoDayAnswer : Weekday -> Proposition addInfoTask;
|
||||
|
||||
makeCheckAnswer : Location -> Proposition checkupTask;
|
||||
makeAddInfoLocAnswer : Location -> Proposition addInfoTask;
|
||||
makeCheckTimeLocAnswer : Location -> Proposition checkTimeTask;
|
||||
|
||||
|
||||
|
||||
-- LEXICON
|
||||
|
||||
addTask : Task;
|
||||
removeTask : Task;
|
||||
changeTask : Task;
|
||||
addInfoTask : Task;
|
||||
checkupTask : Task; -- "har jag"
|
||||
checkTimeTask : Task;
|
||||
|
||||
addEntry : Action addTask; -- "lägga till", "anteckna", "göra en anteckning", "boka", "boka in"
|
||||
removeEntry : Action removeTask; -- "ta bort", "radera", "ta bort en anteckning", "ta bort anteckningen"
|
||||
changeEntry : Action changeTask; -- "ändra anteckningen" - "request(change_info)"
|
||||
augmentEntry : Action addInfoTask; -- "lägga till mer information" - "request(more_info)
|
||||
checkupEntry : Action checkTimeTask;
|
||||
|
||||
checkup : Ask checkupTask; -- "vad har jag"
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
--# -path=.:../:../Artist:../Numbers
|
||||
|
||||
|
||||
concrete sharedDomainEng of sharedDomain = sharedCoreEng, numbersEng, orderNumEng, englishDBEng **
|
||||
open SpecResEng in {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
lin
|
||||
-- ANSWERS
|
||||
answerSongPlay song = {s = variants {
|
||||
( song.s );
|
||||
( (itemForm ! Song) ++ song.s )
|
||||
}
|
||||
};
|
||||
answerSongAdd song = {s = variants {
|
||||
( song.s );
|
||||
( (itemForm ! Song) ++ song.s )
|
||||
}
|
||||
};
|
||||
answerSongRemove song = {s = variants {
|
||||
( song.s );
|
||||
( (itemForm ! Song) ++ song.s )
|
||||
}
|
||||
};
|
||||
questionSong song = {s = variants {
|
||||
( song.s );
|
||||
( (itemForm ! Song) ++ song.s )
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
answerArtistPlay artist = {s = variants {
|
||||
( artist.s );
|
||||
( (itemForm ! Artist) ++ artist.s )
|
||||
}
|
||||
};
|
||||
answerArtistAdd artist = {s = variants {
|
||||
( artist.s );
|
||||
( (itemForm ! Artist) ++ artist.s )
|
||||
}
|
||||
};
|
||||
answerArtistRemove artist = {s = variants {
|
||||
( artist.s );
|
||||
( (itemForm ! Artist) ++ artist.s )
|
||||
}
|
||||
};
|
||||
questionArtist artist = { s = variants {
|
||||
( artist.s );
|
||||
( (itemForm ! Artist) ++ artist.s )
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
answerStationPlay station = {s = variants {
|
||||
( station.s);
|
||||
( ["the station"] ++ station.s)
|
||||
}
|
||||
};
|
||||
answerStationAdd station = {s = variants {
|
||||
( station.s);
|
||||
( ["the station"] ++ station.s)
|
||||
}
|
||||
};
|
||||
answerStationRemove station = {s = variants {
|
||||
( station.s);
|
||||
( ["the station"] ++ station.s)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
-- LIST RELATED ANSWERS
|
||||
|
||||
-- nummer fem
|
||||
-- fem
|
||||
answerNumberInListPlay numb = {s = variants {
|
||||
( (listForm ! Numeric) ++ numb.s );
|
||||
( numb.s )
|
||||
}
|
||||
};
|
||||
|
||||
answerNumberInListRemove numb = {s = variants {
|
||||
( (listForm ! Numeric) ++ numb.s );
|
||||
( numb.s )
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
-- den femte låten
|
||||
-- den femte
|
||||
answerOrderInListPlay ordNum =
|
||||
{s = variants {
|
||||
("the" ++ ordNum.s ++ (itemForm ! Post));
|
||||
("the" ++ ordNum.s)
|
||||
}
|
||||
};
|
||||
answerOrderInListRemove ordNum =
|
||||
{s = variants {
|
||||
("the" ++ ordNum.s ++ (itemForm ! Post));
|
||||
("the" ++ ordNum.s)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
-- LEXICON
|
||||
|
||||
pattern
|
||||
|
||||
play_spec = (variants {["play"] ; ["listen to"] ; "hear"});
|
||||
play_spec_alone = variants {["play a specific"] ; ["play a specific song"] ; ["listen to a specific song"] ; ["hear a specific song"]};
|
||||
play = (variants {["start from the beginning"] ; ["play"] ; ["start"]});
|
||||
stop = (variants {["stop"]});
|
||||
pause = ["pause"];
|
||||
resume = (variants {["resume"] ; ["resume playing"]});
|
||||
|
||||
next = "next";
|
||||
previous = "previous";
|
||||
|
||||
raise_volume = ["raise the volume"] ;
|
||||
lower_volume = ["lower the volume"];
|
||||
|
||||
shift = "shift" ++ variants{ ["the balance"] ; ""};
|
||||
right = variants{"" ; ["to the"]} ++ "right";
|
||||
left = variants{"" ; ["to the"]} ++ "left";
|
||||
center = variants{"" ; ["to the"]} ++ "middle";
|
||||
|
||||
show_list = ["show the list"];
|
||||
|
||||
add = ["add"];
|
||||
remove = ["remove"];
|
||||
|
||||
handle_list = ["manage the playlist"];
|
||||
handle_player = ["talk to the player"];
|
||||
handle_stations = ["choose a station"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
|
||||
--# -path=.:../:../DBase/Swedish:../DBase:../Shared:../System:../Numbers
|
||||
concrete sharedDomainPro of sharedDomain = sharedCorePro, numbersEng, orderNumEng, swedishDBPro ** {
|
||||
|
||||
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
|
||||
-- --# -path=.:../:../DBase/English:../DBase:../Shared:../System:../Numbers
|
||||
|
||||
|
||||
-- concrete sharedDomainPro of sharedDomain = sharedCorePro, numbersEng, orderNumEng, englishDBPro ** {
|
||||
|
||||
flags lexer=code ; unlexer=code ;
|
||||
|
||||
lin
|
||||
|
||||
-- ANSWERS
|
||||
|
||||
answerSongPlay song = { s = "item" ++ "(" ++ song.s ++ ")"};
|
||||
answerSongAdd song = { s = "item" ++ "(" ++ song.s ++ ")"};
|
||||
answerSongRemove song = { s = "item" ++ "(" ++ song.s ++ ")"};
|
||||
questionSong song = { s = "item" ++ "(" ++ song.s ++ ")"};
|
||||
|
||||
|
||||
answerArtistPlay artist = { s = "group" ++ "(" ++ artist.s ++ ")"};
|
||||
answerArtistAdd artist = { s = "group" ++ "(" ++ artist.s ++ ")"};
|
||||
answerArtistRemove artist = { s = "group" ++ "(" ++ artist.s ++ ")"};
|
||||
questionArtist artist = {s = "group" ++ "(" ++ artist.s ++ ")"};
|
||||
|
||||
|
||||
answerStationPlay station = { s = "station" ++ "(" ++ station.s ++ ")"};
|
||||
answerStationAdd station = { s = "station" ++ "(" ++ station.s ++ ")"};
|
||||
answerStationRemove station = { s = "station" ++ "(" ++ station.s ++ ")"};
|
||||
|
||||
|
||||
answerNumberInListPlay numb = {s = "index" ++ "(" ++ "[" ++ numb.s ++ "]" ++ ")"};
|
||||
answerNumberInListRemove numb = {s = "index" ++ "(" ++ "[" ++ numb.s ++ "]" ++ ")"};
|
||||
|
||||
answerOrderInListPlay ordNum = {s = "index" ++ "(" ++ "[" ++ ordNum.s ++ "]" ++ ")"};
|
||||
answerOrderInListRemove ordNum = {s = "index" ++ "(" ++ "[" ++ ordNum.s ++ "]" ++ ")"};
|
||||
|
||||
|
||||
|
||||
-- LEXICON
|
||||
pattern
|
||||
|
||||
play_spec = "start_specific";
|
||||
play_spec_alone = "start_specific";
|
||||
play = "start";
|
||||
stop = "stop";
|
||||
pause = "pause";
|
||||
resume = "resume";
|
||||
|
||||
next = "next";
|
||||
previous = "previous";
|
||||
|
||||
raise_volume = "vol_up" ;
|
||||
lower_volume = "vol_down" ;
|
||||
|
||||
shift = "set_balance";
|
||||
right = "1.0";
|
||||
left = "-1.0";
|
||||
center = "0.0";
|
||||
|
||||
show_list = "show_list";
|
||||
|
||||
add = "playlist_add";
|
||||
remove = "playlist_del";
|
||||
|
||||
handle_list = "handle_playlist";
|
||||
handle_player = "handle_player";
|
||||
handle_stations = "handle_stations";
|
||||
|
||||
askArtist = "songs_by_artist";
|
||||
askSong = "artists_song";
|
||||
|
||||
askCurrent = "current_song";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
--# -path=.:../:../../../Resource/Time:../Shared:../../../Core:../../../Core/Shared:
|
||||
|
||||
concrete sharedDomainSwe of sharedDomain = sharedCoreSwe, DBSwe, TimeSwe, WeekdaySwe ** open SpecResSwe in{
|
||||
|
||||
lin
|
||||
-- ANSWERS
|
||||
|
||||
|
||||
makeAddEventAnswer event = {s = event.s};
|
||||
makeRemEventAnswer event = {s = event.s};
|
||||
makeCheckupAnswer event = {s = "om" ++ event.s};
|
||||
makeCheckTimeAnswer event = {s = event.s};
|
||||
makeAddInfoAnswer event = {s = "om" ++ event.s};
|
||||
|
||||
makeAddEventTimeAnswer time = {s = time.s};
|
||||
makeRemEventTimeAnswer time = {s = time.s};
|
||||
makeCheckupTimeAnswer time = {s = time.s};
|
||||
makeCheckTimeTimeAnswer time = {s = time.s};
|
||||
makeAddInfoTimeAnswer time = {s = time.s};
|
||||
|
||||
makeAddEventDayAnswer weekday = {s = "på" ++ weekday.s};
|
||||
makeRemEventDayAnswer weekday = {s = "på" ++ weekday.s};
|
||||
makeCheckupDayAnswer weekday = {s = "på" ++ weekday.s};
|
||||
makeCheckTimeDayAnswer weekday = {s = "på" ++ weekday.s};
|
||||
makeAddInfoDayAnswer weekday = {s = "på" ++ weekday.s};
|
||||
|
||||
makeCheckAnswer location = {s = location.s};
|
||||
makeAddInfoLocAnswer location = {s = "om" ++ location.s};
|
||||
makeCheckTimeLocAnswer location = {s = location.s};
|
||||
|
||||
-- LEXICON
|
||||
|
||||
pattern
|
||||
addEntry = varaints {["lägga till"] ; ["anteckna"] ; ["göra en anteckning om"]};
|
||||
removeEntry = variants{ ["ta bort"] ; ["radera en anteckning"]};
|
||||
changeEntry = ["ändra en anteckning om"];
|
||||
augmentEntry = ["lägga till mer information"];
|
||||
checkupEntry = ["kolla tiden för"];
|
||||
|
||||
checkup = ["vad har jag uppskrivet"];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
|
||||
--# -path=.:../:../DBase/Swedish:../DBase:../Shared:../System:../Numbers
|
||||
|
||||
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
|
||||
-- --# -path=.:../:../DBase/English:../DBase:../Shared:../System:../Numbers
|
||||
|
||||
abstract systemDomain = sharedDomain, systemCore ** {
|
||||
|
||||
|
||||
cat
|
||||
|
||||
Proposition;
|
||||
|
||||
|
||||
fun
|
||||
|
||||
-- PROPOSITIONS.
|
||||
--
|
||||
|
||||
songProp : Song -> Proposition;
|
||||
itemProp : Song -> Proposition;
|
||||
currentSongProp : Song -> Proposition;
|
||||
|
||||
whatToPlayPropNum : Number -> Proposition;
|
||||
whatToPlayPropOrd : Number -> Proposition;
|
||||
|
||||
itemRemPropNum : Number -> Proposition;
|
||||
itemRemPropOrd : Number -> Proposition;
|
||||
|
||||
groupToAddProp : Artist -> Proposition;
|
||||
artistProp : Artist -> Proposition;
|
||||
groupProp : Artist -> Proposition;
|
||||
songArtistProp : Artist -> Proposition;
|
||||
|
||||
albumProp : Album -> Proposition;
|
||||
|
||||
artistsSongProp : Artist -> Proposition;
|
||||
artistsAlbumProp : Artist -> Proposition;
|
||||
|
||||
albumArtistProp : Album -> Proposition;
|
||||
|
||||
songsArtistProp : Song -> Proposition;
|
||||
|
||||
stationProp : Station -> Proposition;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
--# -path=.:../:../DBase/English:../DBase:../Shared:../System:../Numbers
|
||||
|
||||
|
||||
concrete systemDomainEng of systemDomain = sharedDomainEng, systemCoreEng ** {
|
||||
|
||||
|
||||
lin
|
||||
|
||||
-- PROPOSITIONS
|
||||
|
||||
songProp song = { s = song.s };
|
||||
itemProp song = { s = song.s };
|
||||
currentSongProp song = { s = song.s };
|
||||
|
||||
whatToPlayPropNum number = { s = number.s };
|
||||
whatToPlayPropOrd order = { s = order.s };
|
||||
|
||||
itemRemPropNum number = { s = number.s };
|
||||
itemRemPropOrd order = { s = order.s };
|
||||
|
||||
groupToAddProp artist = { s = artist.s };
|
||||
artistProp artist = { s = artist.s};
|
||||
groupProp artist = { s = artist.s };
|
||||
songArtistProp artist = { s = artist.s };
|
||||
|
||||
albumProp album = { s = album.s };
|
||||
|
||||
artistsSongProp artist = { s = artist.s };
|
||||
artistsAlbumProp artist = { s = artist.s };
|
||||
|
||||
albumArtistProp album = { s = album.s };
|
||||
|
||||
songsArtistProp song = { s = song.s };
|
||||
|
||||
stationProp station = { s = station.s };
|
||||
|
||||
-- sort_restr( song(X) ):- sem_sort(X,item).
|
||||
-- sort_restr( item(X) ):- sem_sort(X,item).
|
||||
-- sort_restr( current_song(X) ):- sem_sort(X,song).
|
||||
-- sort_restr( what_to_play(X) ):- sem_sort(X,index).
|
||||
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
|
||||
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
|
||||
-- sort_restr( groupToAdd(X) ):- group( X ).
|
||||
-- sort_restr( artist(X) ):- group( X ).
|
||||
-- sort_restr( group(X) ):- group( X ).
|
||||
-- sort_restr( song_artist(X) ):- group( X ).
|
||||
-- sort_restr( album(X) ):- album( X ).
|
||||
-- sort_restr( artists_song(X) ):- group_atom( X ).
|
||||
-- sort_restr( artists_album(X) ):- group_atom( X ).
|
||||
-- sort_restr( albums_by_artist(X) ):- album_atom( X ).
|
||||
-- sort_restr( songs_by_artist(X) ):- song_atom( X ).
|
||||
-- sort_restr( station(X) ):- radio_station( X ).
|
||||
-- sort_restr( year(X) ):- sem_sort( X, year ).
|
||||
-- sort_restr( path(X) ):- atomic( X ).%,format("hallå: ~w\n",[X]).
|
||||
-- %sort_restr( X^path(X) ):- atomic( X ),format("hallå: ~w\n",[X]).
|
||||
-- sort_restr( not path(X) ):- format("hallå: ~w\n",[X]), atomic( X ).
|
||||
-- sort_restr( fail(Path^path(Path),no_matches) ).
|
||||
|
||||
|
||||
pattern
|
||||
|
||||
|
||||
-- Because of differing linearisations in User and System usage these functions are not linearized in Shared.
|
||||
|
||||
askArtist = "songs" ;
|
||||
|
||||
|
||||
askSong = "artist" ;
|
||||
askCurrent = ["the current song"];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
|
||||
--# -path=.:../:../DBase/Swedish:../DBase:../Shared:../System:../Numbers
|
||||
|
||||
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
|
||||
-- --# -path=.:../:../DBase/English:../DBase:../Shared:../System:../Numbers
|
||||
|
||||
|
||||
concrete systemDomainPro of systemDomain = sharedDomainPro, systemCorePro ** {
|
||||
|
||||
|
||||
lin
|
||||
-- PROPOSITIONS
|
||||
|
||||
-- Ok hur ska jag göra med propositions tro? Och vad menar David med song_to_add(Song).
|
||||
-- Hur blir de till? Skulle man kunna göra som nedan?
|
||||
|
||||
songProp song = { s = "song" ++ "(" ++ song.s ++ ")" };
|
||||
itemProp song = { s = "item" ++ "(" ++ song.s ++ ")" };
|
||||
currentSongProp song = { s = "current_song" ++ "(" ++ song.s ++ ")" };
|
||||
|
||||
whatToPlayPropNum number = { s = "what_to_play" ++ "(" ++ number.s ++ ")" };
|
||||
whatToPlayPropOrd order = { s = "what_to_play" ++ "(" ++ order.s ++ ")" };
|
||||
|
||||
itemRemPropNum number = { s = "itemRem" ++ "(" ++ number.s ++ ")" };
|
||||
itemRemPropOrd order = { s = "itemRem" ++ "(" ++ order.s ++ ")" };
|
||||
|
||||
groupToAddProp artist = { s = "groupToAdd" ++ "(" ++ artist.s ++ ")" };
|
||||
artistProp artist = { s = "artist" ++ "(" ++ artist.s ++ ")"};
|
||||
groupProp artist = { s = "group" ++ "(" ++ artist.s ++ ")" };
|
||||
songArtistProp artist = { s = "song_artist" ++ "(" ++ artist.s ++ ")" };
|
||||
|
||||
albumProp album = { s = "album" ++ "(" ++ album.s ++ ")" };
|
||||
|
||||
artistsSongProp artist = { s = "artist_song" ++ "(" ++ artist.s ++ ")" };
|
||||
artistsAlbumProp artist = { s = "artists_album" ++ "(" ++ artist.s ++ ")" };
|
||||
|
||||
albumArtistProp album = { s = "albums_by_artist" ++ "(" ++ album.s ++ ")" };
|
||||
|
||||
songsArtistProp song = { s = "songs_by_artist" ++ "(" ++ song.s ++ ")" };
|
||||
|
||||
stationProp station = { s = "station" ++ "(" ++ station.s ++ ")" };
|
||||
|
||||
-- sort_restr( song(X) ):- sem_sort(X,item).
|
||||
-- sort_restr( item(X) ):- sem_sort(X,item).
|
||||
-- sort_restr( current_song(X) ):- sem_sort(X,song).
|
||||
-- sort_restr( what_to_play(X) ):- sem_sort(X,index).
|
||||
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
|
||||
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
|
||||
-- sort_restr( groupToAdd(X) ):- group( X ).
|
||||
-- sort_restr( artist(X) ):- group( X ).
|
||||
-- sort_restr( group(X) ):- group( X ).
|
||||
-- sort_restr( song_artist(X) ):- group( X ).
|
||||
-- sort_restr( album(X) ):- album( X ).
|
||||
-- sort_restr( artists_song(X) ):- group_atom( X ).
|
||||
-- sort_restr( artists_album(X) ):- group_atom( X ).
|
||||
-- sort_restr( albums_by_artist(X) ):- album_atom( X ).
|
||||
-- sort_restr( songs_by_artist(X) ):- song_atom( X ).
|
||||
-- sort_restr( station(X) ):- radio_station( X ).
|
||||
-- sort_restr( year(X) ):- sem_sort( X, year ).
|
||||
-- sort_restr( path(X) ):- atomic( X ).%,format("hallå: ~w\n",[X]).
|
||||
-- %sort_restr( X^path(X) ):- atomic( X ),format("hallå: ~w\n",[X]).
|
||||
-- sort_restr( not path(X) ):- format("hallå: ~w\n",[X]), atomic( X ).
|
||||
-- sort_restr( fail(Path^path(Path),no_matches) ).
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
--# -path=.:../:../DBase/Swedish:../DBase:../Shared:../System:../Numbers
|
||||
|
||||
|
||||
concrete systemDomainSwe of systemDomain = sharedDomainSwe, systemCoreSwe ** {
|
||||
|
||||
|
||||
lin
|
||||
|
||||
-- PROPOSITIONS
|
||||
|
||||
songProp song = { s = song.s };
|
||||
itemProp song = { s = song.s };
|
||||
currentSongProp song = { s = song.s };
|
||||
|
||||
whatToPlayPropNum number = { s = number.s };
|
||||
whatToPlayPropOrd order = { s = order.s };
|
||||
|
||||
itemRemPropNum number = { s = number.s };
|
||||
itemRemPropOrd order = { s = order.s };
|
||||
|
||||
groupToAddProp artist = { s = artist.s };
|
||||
artistProp artist = { s = artist.s};
|
||||
groupProp artist = { s = artist.s };
|
||||
songArtistProp artist = { s = artist.s };
|
||||
|
||||
albumProp album = { s = album.s };
|
||||
|
||||
artistsSongProp artist = { s = artist.s };
|
||||
artistsAlbumProp artist = { s = artist.s };
|
||||
|
||||
albumArtistProp album = { s = album.s };
|
||||
|
||||
songsArtistProp song = { s = song.s };
|
||||
|
||||
stationProp station = { s = station.s };
|
||||
|
||||
-- sort_restr( song(X) ):- sem_sort(X,item).
|
||||
-- sort_restr( item(X) ):- sem_sort(X,item).
|
||||
-- sort_restr( current_song(X) ):- sem_sort(X,song).
|
||||
-- sort_restr( what_to_play(X) ):- sem_sort(X,index).
|
||||
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
|
||||
-- sort_restr( itemRem(X) ):- sem_sort(X,index).
|
||||
-- sort_restr( groupToAdd(X) ):- group( X ).
|
||||
-- sort_restr( artist(X) ):- group( X ).
|
||||
-- sort_restr( group(X) ):- group( X ).
|
||||
-- sort_restr( song_artist(X) ):- group( X ).
|
||||
-- sort_restr( album(X) ):- album( X ).
|
||||
-- sort_restr( artists_song(X) ):- group_atom( X ).
|
||||
-- sort_restr( artists_album(X) ):- group_atom( X ).
|
||||
-- sort_restr( albums_by_artist(X) ):- album_atom( X ).
|
||||
-- sort_restr( songs_by_artist(X) ):- song_atom( X ).
|
||||
-- sort_restr( station(X) ):- radio_station( X ).
|
||||
-- sort_restr( year(X) ):- sem_sort( X, year ).
|
||||
-- sort_restr( path(X) ):- atomic( X ).%,format("hallå: ~w\n",[X]).
|
||||
-- %sort_restr( X^path(X) ):- atomic( X ),format("hallå: ~w\n",[X]).
|
||||
-- sort_restr( not path(X) ):- format("hallå: ~w\n",[X]), atomic( X ).
|
||||
-- sort_restr( fail(Path^path(Path),no_matches) ).
|
||||
|
||||
|
||||
pattern
|
||||
|
||||
|
||||
-- Because of differing linearisations in User and System usage these functions are not linearized in Shared.
|
||||
|
||||
askArtist = "låtar" ;
|
||||
|
||||
|
||||
askSong = "artister" ;
|
||||
askCurrent = ["låten som spelas nu"];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
13
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/User/userDomain.gf
Normal file
13
grammars/TALK/GF_GoDiS/Domain/AgendaTalk/User/userDomain.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
--# -path=.:../:../../../Resource/Time:../../../Resource/Media:../Shared:../../../Core:../../../Core/Shared:../../../Core/User
|
||||
|
||||
abstract userDomain = userCore, sharedDomain ** {
|
||||
|
||||
|
||||
fun
|
||||
-- CompoundedAnswers
|
||||
|
||||
answerEventLocAdd : Event -> Location -> AnswerList addTask;
|
||||
answerEventLocRem : Event -> Location -> AnswerList removeTask;
|
||||
|
||||
answerEventLocTimeDay : Event -> Location -> Time -> Weekday -> AnswerList removeTask;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
--# -path=.:../:../DBase/English:../DBase:../Numbers:../Shared
|
||||
|
||||
concrete userDomainEng of userDomain = userCoreEng, sharedDomainEng ** {
|
||||
|
||||
lin
|
||||
|
||||
-- CompoundedAnswers
|
||||
answerSongArtistPlay song artist = {s = variants {(song.s ++ "with" ++ artist.s)
|
||||
; (artist.s ++ "with" ++ song.s)} };
|
||||
|
||||
answerSongArtistAdd song artist = {s = variants {(song.s ++ "with" ++ artist.s)
|
||||
; (artist.s ++ "with" ++ song.s)} };
|
||||
|
||||
|
||||
pattern
|
||||
askArtist = variants { ["what do i have"] ; ["what songs do i have"] ; ["do i have anything"]}
|
||||
++ variants {"with" ; "by"};
|
||||
|
||||
|
||||
askSong = ["who"] ++ variants {"made"; "wrote"};
|
||||
|
||||
askCurrent = ["what"] ++ variants {["song is this"] ; ["is this called"]};
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
|
||||
--# -path=.:../:../DBase/Swedish:../DBase:../Numbers:../Shared
|
||||
|
||||
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
|
||||
-- --# -path=.:../:../DBase/English/:../DBase/:../Numbers:../Shared
|
||||
|
||||
|
||||
concrete userDomainPro of userDomain = userCorePro, sharedDomainPro ** {
|
||||
|
||||
lin
|
||||
answerSongArtistPlay song artist = { s = "answer(item(" ++ song.s ++ ")," ++
|
||||
"answer(group(" ++ artist.s ++ ")"};
|
||||
answerSongArtistAdd song artist = { s = "answer(item(" ++ song.s ++ ")," ++
|
||||
"answer(group(" ++ artist.s ++ ")"};
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
--# -path=.:../:../../:../../../Resource/Time:../../../Resource/Media/:../Shared:../../../Core:../../../Core/Shared:../../../Core/User
|
||||
|
||||
concrete userDomainSwe of userDomain = userCoreSwe, sharedDomainSwe ** {
|
||||
|
||||
lin
|
||||
|
||||
-- CompoundedAnswers
|
||||
answerEventLocAdd event loc = {s = event.s ++ loc.s };
|
||||
|
||||
answerEventLocRem event loc = {s = event.s ++ loc.s };
|
||||
|
||||
answerEventLocTimeDay event loc time day = {s = variants {
|
||||
(event.s ++ loc.s ++ time.s ++ "på" ++ day.s);
|
||||
(event.s ++ loc.s ++ "på" ++ day.s ++ time.s);
|
||||
}
|
||||
};
|
||||
|
||||
-- (event.s ++ "på" ++ day.s ++ time.s);
|
||||
-- (loc.s ++ time.s ++ "på" ++ day.s);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user