summaryrefslogtreecommitdiff
path: root/examples/dialogue/README.html
blob: a273e28b90836c6c1d532b87b56f4e71f3d7f7fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
<TITLE>Dialogue system grammars using GF resource.</TITLE>
</HEAD><BODY BGCOLOR="white" TEXT="black">
<P ALIGN="center"><CENTER><H1>Dialogue system grammars using GF resource.</H1>
<FONT SIZE="4">
AR 16/5/2006
</FONT></CENTER>

<H2>Functionality and purpose</H2>
<P>
Dialogue system abstract syntax + concrete syntaxes for
different languages. One of them is Prolog (with some resemblance to
dialogue moves in GoDiS).
</P>
<P>
The purpose is to show how new systems can be built for new domains just
by specifying just two things:
</P>
<UL>
<LI>a domain ontology in abstract syntax
<LI>a domain terminologies in concrete syntaxes
</UL>

<P>
This is based on two library elements
</P>
<UL>
<LI>base dialogue grammars
<LI>resource grammar libraries
</UL>

<P>
In general, the only kind of elements that need to be added are
constants (0-place fun's) of the following categories from Dialogue.gf.
</P>
<PRE>
    Kind ;             -- e.g. Room
    Object Kind ;      -- e.g. Kitchen
    Oper0 ;            -- e.g. Stop
    Oper1 Kind ;       -- e.g. Play
    Oper2 Kind Kind ;  -- e.g. Add
    Move ;             -- e.g. MorningMode
</PRE>
<P></P>
<H2>Files in this directory</H2>
<P>
Files (for X = Eng, Fin, Fre, Prolog, Swe):
</P>
<P>
Files provided as library to build on:
</P>
<PRE>
    Dialogue.gf   -- base dialogue grammar
    DialogueX.gf  -- implementation instance
    DialogueI.gf  -- implementation functor
  
    ResProlog.gf  -- help constructs for Prolog terms
  
    Weekday.gf    -- untility grammar with weekdays
    WeekdayX.gf
  
    AuxDialogue.gf-- interface of auxiliary resource-defined opers
    AuxX.gf       -- instances for different languages
</PRE>
<P>
Files implementing two examples.
</P>
<PRE>
    Agenda.gf     -- application grammar for agenda
    AgendaX.gf
  
    Lights.gf     -- application grammar for lights
    Lights.gf
</PRE>
<P></P>
<H2>Files needed to build a new application</H2>
<P>
To build a new application for domain Dom, you thus need
</P>
<PRE>
    Dom.gf        -- introduce fun's in Kind, Object, Oper0, Oper1, Oper2
    DomX.gf       -- concrete syntax of the new fun's for language X
</PRE>
<P></P>
<H2>Some tests</H2>
<P>
You first need to do, with the latest resource grammar version,
</P>
<UL>
<LI><CODE>make present</CODE> in <CODE>lib/resource-1.0</CODE>
<P></P>
To test an application in GF, do e.g.
<LI><CODE>make lights</CODE> to make a package with all the Lights grammars
<LI><CODE>make engcorpus</CODE> to generate an English corpus
<LI><CODE>make swecorpus</CODE> to generate a Swedish corpus
</UL>

<P>
Here are some other commands:
</P>
<UL>
<LI><CODE>i LightsEng.gf</CODE> in current dir, to load a grammar 
<LI><CODE>gr | l -all</CODE> to random-generate
<LI><CODE>gt -depth=4 | pt -transform=typecheck | l -all</CODE> to generate a corpus
<LI><CODE>p "switch off all lights in the kitchen"</CODE> to parse
<LI><CODE>i LightsProlog.gf</CODE> to load the Prolog version
<LI><CODE>pg -printer=gsl -startcat=Move</CODE> to print a Nuance grammar
<LI><CODE>p -lang=LightsEng "switch off all lights" | pt -transform=solve | l -lang=LightsProlog</CODE> 
to translate from English to Prolog
<LI><CODE>si -tr -lang=LightsEng | p -cat=Move -lang=LightsEng | pt -transform=solve | l -lang=LightsProlog</CODE>
to translate English speech into Prolog
</UL>

<P>
The last one is the coolest - but you may need to enable the <CODE>speech_input</CODE> command by installing ATK
and recompiling GF.
</P>

<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
<!-- cmdline: txt2tags -thtml README.txt -->
</BODY></HTML>