added Ann-Charlotte's grammars

This commit is contained in:
aarne
2005-06-27 12:20:33 +00:00
parent 10d6757558
commit ec444e9e7e
122 changed files with 687204 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
--# -path=.:../../Resource/Media/English:../../Resource/Media/Swedish:../../../Resource/Numbers/
abstract DB = SwedishAlbums, SwedishArtists, SwedishRadioStations, SwedishSongs, numbers, orderNum ** {
--abstract DB = EnglishAlbums, EnglishArtists, EnglishRadioStations, EnglishSongs, numbers, orderNum ** {
}

View File

@@ -0,0 +1,7 @@
--# -path=.:../../Resource/Media/English:../../Resource/Media/Swedish:../../Resource/Numbers/
concrete DBEng of DB = EnglishAlbumsEng, EnglishArtistsEng,
--EnglishSongsEng,
EnglishRadioStationsEng, SwedishSongsSwe, numbersEng, orderNumEng ** {
}

View File

@@ -0,0 +1,6 @@
--# -path=.:../../Resource/Media/English:../../Resource/Media/Swedish
--concrete DBPro of DB = EnglishAlbumsPro, EnglishSongsPro, EnglishArtistsPro, EnglishRadioStationsPro, numbersPro, orderNumPro ** {
concrete DBPro of DB = SwedishAlbumsPro, SwedishSongsPro, SwedishArtistsPro, SwedishRadioStationsPro, numbersPro, orderNumPro ** {
}

View File

@@ -0,0 +1,5 @@
--# -path=.:../../Resource/Media/English:../../Resource/Media/Swedish:../../Resource/Numbers/
concrete DBSwe of DB = SwedishAlbumsSwe, SwedishArtistsSwe, SwedishSongsSwe, SwedishRadioStationsSwe, numbersSwe, orderNumSwe ** {
}

View File

@@ -0,0 +1,105 @@
-- SWEDISH version, uncomment as needed.
-- --# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
-- abstract sharedDomain = sharedCore, numbers, orderNum, swedishDB ** {
-- ENGLISH version, uncomment as needed.
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
abstract sharedDomain = sharedCore, DB ** {
fun
-- ANSWERS
-- Request Answers
answerSongPlay : Song -> Proposition playTask;
answerSongAdd : Song -> Proposition addTask;
answerSongRemove : Song -> Proposition removeTask;
answerArtistPlay : Artist -> Proposition playTask;
answerArtistAdd : Artist -> Proposition addTask;
answerArtistRemove : Artist -> Proposition removeTask;
answerStationPlay : Station -> Proposition playTask;
answerStationAdd : Station -> Proposition addTask;
answerStationRemove : Station -> Proposition removeTask;
answerNumberInListPlay : Number -> Proposition playTask;
answerNumberInListRemove: Number -> Proposition removeTask;
answerOrderInListPlay : OrderNumber -> Proposition playTask;
answerOrderInListRemove : OrderNumber -> Proposition removeTask;
-- Ask Answers
questionSong : Song -> Proposition songQuestion;
questionArtist : Artist -> Proposition artistQuestion;
-- LEXICON
playTask : Task;
addTask : Task;
removeTask : Task;
speakerTask : Task;
artistQuestion : Task;
songQuestion : Task;
play_spec : Action playTask;
play_spec_alone : SingleAction;
play : SingleAction;
stop : SingleAction;
pause : SingleAction;
resume : SingleAction;
next : OrderNumber;
previous : OrderNumber;
raise_volume : SingleAction;
lower_volume : SingleAction;
fastforward : SingleAction;
rewind : SingleAction;
shift : Action speakerTask;
right : Proposition speakerTask;
left : Proposition speakerTask;
center : Proposition speakerTask;
show_list : SingleAction;
add : Action addTask;
add_alone : SingleAction;
remove : Action removeTask;
remove_alone : SingleAction;
remove_all : SingleAction;
handle_list : SingleAction;
handle_player : SingleAction;
handle_stations : SingleAction;
askArtist : Ask artistQuestion;
askSong : Ask songQuestion;
askCurrent : SingleAsk;
}

View File

@@ -0,0 +1,154 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
concrete sharedDomainEng of sharedDomain = sharedCoreEng, DBEng **
open SpecResEng in {
flags conversion=finite;
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 song"] ; ["play a specific"] ; ["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"];
fastforward = ["fast forward"];
rewind = "rewind";
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"];
add_alone = variants {["add a specific song"] ; ["add this"] ; ["add this one"]};
remove = ["remove"];
remove_alone = variants {["remove"] ; ["renmove this"] ; ["remove this one"]};
remove_all = ["clear the playlist"];
handle_list = ["manage the playlist"];
handle_player = ["talk to the player"];
handle_stations = ["choose a station"];
}

View File

@@ -0,0 +1,87 @@
-- SWEDISH VERSION, UNCOMMENT AS NEEDED
-- --# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
--concrete sharedDomainPro of sharedDomain = sharedCorePro, numbersEng, orderNumEng, swedishDBPro ** {
-- ENGLISH VERSION, UNCOMMENT AS NEEDED
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
concrete sharedDomainPro of sharedDomain = sharedCorePro, DBPro ** {
flags lexer=code ; unlexer=code ;
flags conversion=finite;
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 = "groupToAdd" ++ "(" ++ 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 = "itemRem" ++ "(" ++ "[" ++ numb.s ++ "]" ++ ")"};
answerOrderInListPlay ordNum = {s = "index" ++ "(" ++ "[" ++ ordNum.s ++ "]" ++ ")"};
answerOrderInListRemove ordNum = {s = "itemRem" ++ "(" ++ "[" ++ 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" ;
fastforward = "fast_forward";
rewind = "rewind";
shift = "set_balance";
right = "1.0";
left = "-1.0";
center = "0.0";
show_list = "show_list";
add = "playlist_add";
add_alone = "playlist_add";
remove = "playlist_del";
remove_alone = "playlist_del";
remove_all = "playlist_clear";
handle_list = "handle_playlist";
handle_player = "handle_player";
handle_stations = "handle_stations";
askArtist = "songs_by_artist";
askSong = "artists_song";
askCurrent = "current_song";
}

View File

@@ -0,0 +1,170 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/
concrete sharedDomainSwe of sharedDomain = sharedCoreSwe, DBSwe ** open SpecResSwe in{
flags conversion=finite;
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);
( "stationen" ++ station.s)
}
};
answerStationAdd station = {s = variants {
( station.s);
( "stationen" ++ station.s)
}
};
answerStationRemove station = {s = variants {
( station.s);
( "stationen" ++ 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 {
("den" ++ ordNum.s ++ (itemForm ! Post));
("den" ++ ordNum.s)
}
};
answerOrderInListRemove ordNum =
{s = variants {
("den" ++ ordNum.s ++ (itemForm ! Post));
("den" ++ ordNum.s)
}
};
-- LEXICON
pattern
play_spec = (variants {["spela"] ; ["starta"] ; ["höra"] ; ["lyssna på"]});
play_spec_alone = variants {["spela"] ; ["spela den här"] ; ["spela den"] ; ["spela en speciell"] ; ["spela en speciell låt"]};
play = (variants {["spela från början"] ; ["spela"] ; ["starta"]});
stop = (variants {["stoppa"] ; ["avbryta"]});
pause = (variants {["pausa"] });
resume = (variants {["återuppta spelningen"] ; ["starta igen"]});
next = "nästa";
previous = "föregående";
raise_volume = "höja" ++ variants { ("volymen") ; ("ljudet")};
lower_volume = "sänka" ++ variants { ("volymen") ; ("ljudet")};
fastforward = ["spola framåt"];
rewind = ["spola bakåt"];
shift = variants{ ["ändra balansen"] ; "skifta"};
right = variants{"" ; "till"} ++ "höger";
left = variants{"" ; "till"} ++ "vänster";
center = variants{"" ; "till"} ++ "mitten";
show_list = ["visa listan"];
add = ["lägga till"];
add_alone = variants {["lägga till"]; ["lägg till den här"] ; ["lägg till den"]};
remove = ["ta bort"];
remove_alone = variants { ["ta bort"] ; ["ta bort den"] ; ["ta bort den här"] };
remove_all = variants {["rensa listan"] ; ["ta bort allt"]};
handle_list = ["ändra i spellistan"];
handle_player = ["prata med spelaren"];
handle_stations = ["välja en radiostation"];
-- FLYTTAT TILL userSpecificSwe.gf och systemSpecificSwe.gf pga
-- olika linearisering for system och användare.
--askArtist = variants { "låtar" ;
-- variants { variants {"vad" ; ["vilka låtar"]} ++ ["har jag"] ;
-- ["har jag någonting"]} ++ variants {"med" ; "av"}};
--askSong = variants { "artister" ; (["vem har"] ++ variants {"skrivit"; "gjort"})};
--askCurrent = ["vad heter"] ++ variants {["den här"] ; ["låten som spelas nu"]};
}

View File

@@ -0,0 +1,75 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resorce/Media/English:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
abstract systemDomain = sharedDomain, systemCore ** {
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;
actionProp : (t: Task) -> Action (t) -> Proposition;
-- Asks
whatSongQuestion : SingleAsk; -- "what song do you mean?"
whatArtistQuestion : SingleAsk; -- "what artist do you mean?"
whatIndexQuestion : SingleAsk; -- "what index do you mean?"
whatToRemoveQuestion : SingleAsk;
whatStationQuestion : SingleAsk; -- "what station do you want?"
whatAlbumQuestion : SingleAsk; -- "what album do you mean?"
whatToPlayQuestion : SingleAsk; -- "which song in the playlist do you want to lay?"
whatToRemove : SingleAsk; -- "What number do you want to remove?"
-- Confirms
addedToPlaylist : Confirm; -- "The playlist is increased"
removedFromPLaylist : Confirm; -- "The playlist is reduced"
clearedPlaylist : Confirm; -- "The playlist is cleared"
turnedUpVolume : Confirm; -- "Turning up the volume"
loweredVolume : Confirm; -- "Lowering the volume"
startingThePlayer : Confirm; -- "Starting the music"
stoppingThePlayer : Confirm; -- "Stopping the music"
pausingThePlayer : Confirm; -- "Pausing the music"
resumingThePlayer : Confirm; -- "Resuming the music"
shuffleTheList : Confirm; -- "The list has been shuffled"
ffing : Confirm;
rewinding : Confirm;
handlingstations : Confirm;
handlingplayer : Confirm;
handlingplaylist : Confirm;
showedList : Confirm;
}

View File

@@ -0,0 +1,106 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resorce/Media/Swedish:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete systemDomainEng of systemDomain = sharedDomainEng, systemCoreEng ** {
flags conversion=finite;
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 };
actionProp _ action = {s = action.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 = "song" ;
askSong = "artist" ;
askCurrent = ["the current song"];
-- Asks
whatSongQuestion = ["what song do you mean"];
whatArtistQuestion = ["what artist do you mean"];
whatIndexQuestion = ["what index number do you want to play"];
whatToRemoveQuestion = ["what song do you want to remove from the playlist"];
whatStationQuestion = ["what radio station do you want to listen to"];
whatAlbumQuestion = ["what album do you mean"];
whatToPlayQuestion = ["what song in the playlist do you want to play"];
whatToRemove = ["what song in the playlist do you want to remove"];
-- Confirms
addedToPlaylist = ["the playlist is increased"];
removedFromPLaylist = ["the playlist is reduced"];
clearedPlaylist = ["the playlist is cleared"];
turnedUpVolume = ["turning up the volume"];
loweredVolume = ["lowering the volume"];
startingThePlayer = ["starting the music"];
stoppingThePlayer = ["the player is stopped"];
pausingThePlayer = ["pausing the player"];
resumingThePlayer = ["resuming the music"];
shuffleTheList = ["the playlist has been shuffled"];
ffing = ["performing fast forward"];
rewinding = ["rewinding"];
handlingstations = ["done with choosing a station"];
handlingplayer = ["your wish is my command"];
handlingplaylist = ["done fiddling with the playlist"];
showedList = ["finished showing the list"];
}

View File

@@ -0,0 +1,98 @@
-- --# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resorce/Media/Swedish:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete systemDomainPro of systemDomain = sharedDomainPro, systemCorePro ** {
flags conversion=finite;
lin
-- PROPOSITIONS
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 ++ ")" };
actionProp _ action = {s = "action" ++ "(" ++ action.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
-- Asks
whatSongQuestion = ["x ^ item ( x )"];
whatArtistQuestion = ["x ^ group ( x )"];
whatIndexQuestion = ["x ^ index ( x )"];
whatToRemoveQuestion = ["x ^ song_to_remove ( x )"];
whatStationQuestion = ["x ^ station ( x )"];
whatAlbumQuestion = ["x ^ album ( x )"];
whatToPlayQuestion = ["x ^ what_to_play ( x )"];
whatToRemove = ["x ^ itemRem ( x )"];
-- Confirms
addedToPlaylist = "playlist_add"; -- "The playlist is increased"
removedFromPLaylist = "playlist_del"; -- "The playlist is reduced"
clearedPlaylist = "playlist_clear"; -- "The playlist is cleared"
turnedUpVolume = "vol_up"; -- "Turning up the volume"
loweredVolume = "vol_down"; -- "Lowering the volume"
startingThePlayer = variants {"start" ; "start_specific"};
stoppingThePlayer = "stop"; -- "Stopping the music"
pausingThePlayer = "pause"; -- "Pausing the music"
resumingThePlayer = "resume"; -- "Resuming the music"
shuffleTheList = "shuffle"; -- "The list has been shuffled"
ffing = "fast_fowrward";
rewinding = "rewind";
handlingstations = "handle_stations";
handlingplayer = "handle_player";
handlingplaylist = "handle_playlist";
showedList = "show_list";
}

View File

@@ -0,0 +1,105 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resorce/Media/English:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/System
concrete systemDomainSwe of systemDomain = sharedDomainSwe, systemCoreSwe ** {
flags conversion=finite;
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"];
-- Asks
whatSongQuestion = ["vilken sång menar du"];
whatArtistQuestion = ["vilken artist menar du"];
whatIndexQuestion = ["vilket index nummer vill du spela"];
whatToRemoveQuestion = ["vilken sång vill du ta bort från spellistan"];
whatStationQuestion = ["vilken radiostation vill du lyssna på"];
whatAlbumQuestion = ["vilket album menar du"];
whatToPlayQuestion = ["vad i spellistan vill du spela"];
whatToRemove = ["vad i spellistan vill du ta bort"];
-- Confirms
addedToPlaylist = ["spellistan är utökad"];
removedFromPLaylist = ["spellistan är reducerad"];
clearedPlaylist = ["spellistan är rensad"];
turnedUpVolume = ["höjer volymen"];
loweredVolume = ["sänker volymen"];
startingThePlayer = ["startar uppspelningen"];
stoppingThePlayer = ["spelaren är stoppad"];
pausingThePlayer = ["pausar uppspelningen"];
resumingThePlayer = ["återupptar uppspelningen"];
shuffleTheList = ["spellistan har blandats"];
ffing = ["spolar frammåt"];
rewinding = ["spolar bakåt"];
handlingstations = ["klar med att välja radiostation"];
handlingplayer = ["jag fixar"];
handlingplaylist = ["klar med spellistan"];
showedList = ["spellistan är visad"];
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
-- SWEDISH VERSION, UNCOMMENT WHEN NEEDED
----# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
-- ENGLISH VERSION, UNCOMMENT WHEN NEEDED
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resorce/Media/Swedish:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
abstract userDomain = userCore, sharedDomain ** {
fun
-- CompoundedAnswers
answerSongArtistPlay : Song -> Artist -> AnswerList playTask;
answerSongArtistAdd : Song -> Artist -> AnswerList addTask;
}

View File

@@ -0,0 +1,29 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resource/Media/English:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
concrete userDomainEng of userDomain = userCoreEng, sharedDomainEng ** {
flags conversion=finite;
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"]};
}

View File

@@ -0,0 +1,15 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/English/:../../../Resource/Media/Swedish:../../../Resorce/Media/Swedish:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
concrete userDomainPro of userDomain = userCorePro, sharedDomainPro ** {
flags conversion=finite;
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 ++ [") )"]};
}

View File

@@ -0,0 +1,29 @@
--# -path=.:../:../../:../Shared/:../../../Resource/Media/:../../../Resource/Media/Swedish/:../../../Resorce/Media/English:../../../Resource/Numbers/:../../../Core:../../../Core/Shared/:../../../Core/User
concrete userDomainSwe of userDomain = userCoreSwe, sharedDomainSwe ** {
flags conversion=finite;
lin
-- CompoundedAnswers
answerSongArtistPlay song artist = {s = variants {(song.s ++ "med" ++ artist.s)
; (artist.s ++ "med" ++ song.s)} };
answerSongArtistAdd song artist = {s = variants {(song.s ++ "med" ++ artist.s)
; (artist.s ++ "med" ++ song.s)} };
pattern
askArtist = variants { ["vad har jag"] ; ["vilka låtar har jag"] ; ["har jag någonting"]}
++ variants {"med" ; "av"};
askSong = ["vem har"] ++ variants {"skrivit"; "gjort"};
askCurrent = ["vad heter"] ++ variants {["den här"] ; ["låten som spelas nu"]};
}