mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 13:59:31 -06:00
Video dialogue grammars by Karin Cavallin.
Reconstructed in GF 2 with multiple inheritance. AR 16/9/2004
Example usage (test Swedish generation and parsing, and Prolog
generation)
> i allSwe.gf
> i allProlog.gf
> gr -cat=DMove | l -tr -lang=allSwe | p -cat=DMove -lang=allSwe | l -lang=allProlog
vill du använda svenska eller engelska
ask ([language (X)])
The intended use of that grammar is in dialogue systems to program a
video recorder. Queries in Swedish are translated to Prolog.
The original grammar is written in GF 1.2 and includes. There is a
very nice modular structure, which could not be reproduced with the
single inheritance straightjacket of GF 2.0. But now we can finally
do this again!
Map of abstract syntax inheritances.
all
/ \
/ \
specUser specSystem
/ \ / \
genUser specific genSystem
| / | | \ |
| / | | \ |
| / channel time weekday |
| | |
| | |
-----general ------------------
The map was obtained by:
grep abstract *.gf */*.gf
all.gf:abstract all = specUser,specSystem ** {
Channel/channel.gf:abstract channel = {
Shared/general.gf:abstract general = {
Shared/specific.gf:abstract specific = general, weekday, time, channel ** {
System/genSystem.gf:abstract genSystem = general ** {
System/specSystem.gf:abstract specSystem = specific, genSystem ** {
Time/time.gf:abstract time = {
User/genUser.gf:abstract genUser = general ** {
User/specUser.gf:abstract specUser = specific, genUser ** {
Weekday/weekday.gf:abstract weekday = {