~ubuntu-branches/ubuntu/hoary/malaga/hoary

« back to all changes in this revision

Viewing changes to doc/malaga005.html

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2004-08-20 12:58:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040820125850-rx9s8bn0ep8jgist
Tags: 6.13-4
This should have been urgency=high, because it is an important and
long-delayed accomodation to new upstream with a bajillion bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
2
 
            "http://www.w3.org/TR/REC-html40/loose.dtd">
3
 
<HTML>
4
 
<HEAD>
5
 
 
6
 
<META http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968">
7
 
<META name="GENERATOR" content="hevea 1.07">
8
 
<TITLE>
9
 
The Commands of ``malaga'' and ``mallex''
10
 
</TITLE>
11
 
</HEAD>
12
 
<BODY >
13
 
<A HREF="malaga004.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
14
 
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
15
 
<A HREF="malaga006.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
16
 
<HR>
17
 
 
18
 
<H1><A NAME="htoc11">Chapter&nbsp;4</A>&nbsp;&nbsp;The Commands of ``malaga'' and ``mallex''</H1>
19
 
Since the user interfaces of <B>malaga</B> and <B>mallex</B> are very similar and
20
 
since they have a bunch of commands in common, we will describe them in a
21
 
common chapter. Commands that can be used in <B>malaga</B> or in <B>mallex</B>
22
 
only, are marked by the name of the program in which they can be used.<BR>
23
 
<BR>
24
 
<A NAME="toc8"></A>
25
 
<H2><A NAME="htoc12">4.1</A>&nbsp;&nbsp;The Command ``break''</H2>
26
 
If you want to stop the rules at a specific point, for example to take a look
27
 
at the variables, you can use the command <B>break</B> to set <EM>breakpoints</EM>. A breakpoint is a point in the rule source text where rule
28
 
execution is interrupted, so you can enter commands in debug mode. Breakpoints
29
 
are only active in debug mode, this means you have started rule execution by a
30
 
debug command or you have continued rule execution by one of the commands <B>step</B>, <B>next</B>, <B>walk</B>, or <B>go</B>.<BR>
31
 
<BR>
32
 
Behind the command name, <B>break</B>, you can give one of the following
33
 
arguments:
34
 
<DL COMPACT=compact><DT>
35
 
<B>a line number.</B><DD> A breakpoint is set at this line in the current source
36
 
 file. If there is no statement starting at this line, the breakpoint will be
37
 
 set at the nearest line where a statement starts. You can, for example, set a
38
 
 breakpoint at line 245 in the current source file by entering the command<BR>
39
 
<BR>
40
 
<TT>break 245</TT><BR>
41
 
<BR>
42
 
<DT><B>a file name and a line number.</B><DD> A breakpoint is set at this line in this
43
 
 file. If there is no statement starting at this line, the breakpoint will be
44
 
 set at the nearest line where a statement starts. An example:<BR>
45
 
<BR>
46
 
<TT>break english.syn 59</TT><BR>
47
 
<BR>
48
 
<DT><B>a rule name.</B><DD> A breakpoint is set at the first statement in this rule. An
49
 
 example:<BR>
50
 
<BR>
51
 
<TT>break final_rule</TT></DL>
52
 
If the rule name or the file name is ambiguous, you can insert an abbreviation
53
 
for the rule system you refer to. Put it in front of the rule name or the file
54
 
name. The following abbreviations are used:
55
 
<DL COMPACT=compact><DT>
56
 
<B>all</B><DD> for allomorph rules,
57
 
<DT><B>mor</B><DD> for morphology rules,
58
 
<DT><B>syn</B><DD> for syntax rules,
59
 
</DL>
60
 
If you omit any argument, the breakpoint is set on the current line in the
61
 
current file (this is helpful in debug mode).<BR>
62
 
<BR>
63
 
Every breakpoint gets a unique number once it has been set, so you can delete
64
 
it later, when you do not need it any longer.<BR>
65
 
<BR>
66
 
You can list the breakpoints using the command <B>list</B> and delete them using
67
 
<B>delete</B>.<BR>
68
 
<BR>
69
 
<A NAME="toc9"></A>
70
 
<H2><A NAME="htoc13">4.2</A>&nbsp;&nbsp;The Command ``clear-cache'' (malaga)</H2>
71
 
If you have changed your settings so that the wordform cache is no longer
72
 
valid, you can clear the cache using <B>clear-cache</B>.<BR>
73
 
<BR>
74
 
<A NAME="toc10"></A>
75
 
<H2><A NAME="htoc14">4.3</A>&nbsp;&nbsp;The Command ``debug-entry'' (mallex)</H2>
76
 
Use <B>debug-entry</B> to find errors in your allomorph rules. This command
77
 
works like <B>ga</B>, but the allomorph generation will be stopped before the
78
 
first statement of the first rule is executed:
79
 
<PRE>
80
 
mallex&gt; debug-entry [surface: "john", class: name]
81
 
at rule "irregular_verb"
82
 
debug&gt; 
83
 
</PRE>The prompt ``<TT>debug&gt;</TT>'' that appears instead of ``<TT>mallex&gt;</TT>'' indicates
84
 
that <B>mallex</B> is currently executing the allomorph rules but has been
85
 
interrupted. Since this ability has been developed to support the <EM>debugging</EM> of Malaga rules, this mode is called <EM>debug mode</EM>.<BR>
86
 
<BR>
87
 
When <B>mallex</B> comes to the start of a new rule in debug mode (as in the
88
 
example above), the name of this rule is printed. When in debug mode, you can
89
 
always get the name of the current rule using the command <B>rule</B>.<BR>
90
 
<BR>
91
 
If you're running <B>mallex</B> from Emacs, another Emacs window will display
92
 
the source file. An arrow is used to show to the statement that will be
93
 
executed next.
94
 
<PRE>
95
 
  ...
96
 
allo_rule irregular_verb ($entry):
97
 
 
98
 
=&gt;? $entry.class = verb;
99
 
  ...
100
 
</PRE>
101
 
In debug mode, you can, for example, get the variables that are currently
102
 
defined (using <B>variable</B> or <B>print</B>), and you can execute statements
103
 
(using <B>step</B>, <B>next</B>, <B>walk</B>, <B>go</B>, or <B>run</B>). If you want to quit the
104
 
debug mode, just enter <B>run</B>. The remaining statements for generation will
105
 
then be executed without interruption.<BR>
106
 
<BR>
107
 
<A NAME="toc11"></A>
108
 
<H2><A NAME="htoc15">4.4</A>&nbsp;&nbsp;The Command ``debug-file'' (mallex)</H2>
109
 
Use the command <B>debug-file</B> to make the allomorph rules work on 
110
 
a lexicon file in debug mode. Assume you have written a lexicon file ``<TT>mini.lex</TT>'':
111
 
<PRE>
112
 
[surface: "m{a}n", class: noun];
113
 
[surface: "table", class: noun];
114
 
[surface: "wise", class: adjective];
115
 
</PRE>To let the rules process this lexicon in debug mode, enter:<BR>
116
 
<BR>
117
 
<TT>debug-file mini.lex</TT><BR>
118
 
<BR>
119
 
<A NAME="toc12"></A>
120
 
<H2><A NAME="htoc16">4.5</A>&nbsp;&nbsp;The Command ``debug-line'' (mallex)</H2>
121
 
Use the command <B>debug-line</B> to make the allomorph rules generate
122
 
allomorphs for a single lexicon entry in debug mode. Assume you want to test
123
 
the second line in the lexicon file ``<TT>mini.lex</TT>'':
124
 
<PRE>
125
 
[surface: "m{a}n", class: noun];
126
 
[surface: "table", class: noun];
127
 
[surface: "wise", class: adjective];
128
 
</PRE>Enter the following line:<BR>
129
 
<BR>
130
 
<TT>debug-line mini.lex 2</TT><BR>
131
 
<BR>
132
 
Then <B>mallex</B> stops in debug mode at the entry of the first allomorph rule
133
 
that is being executed for the lexicon entry 
134
 
``<CODE>[surface: "table", class:noun];</CODE>''.<BR>
135
 
<BR>
136
 
If there is no lexicon entry at this line, the subsequent lexicon entry will be
137
 
taken.<BR>
138
 
<BR>
139
 
<A NAME="toc13"></A>
140
 
<H2><A NAME="htoc17">4.6</A>&nbsp;&nbsp;The Command ``debug-mor'' (malaga)</H2>
141
 
Use the command <B>debug-mor</B> to find errors in your morphology combination
142
 
rules. This command analyses the rest of the command line morphologically and
143
 
executes the morphology combination rules in debug mode. Debug mode is
144
 
explained for the command <B>debug</B>.<BR>
145
 
<BR>
146
 
<A NAME="toc14"></A>
147
 
<H2><A NAME="htoc18">4.7</A>&nbsp;&nbsp;The Command ``debug-node'' (malaga)</H2>
148
 
Use the command <B>debug-node</B> to execute the successor rules of a specific
149
 
LAG state in debug mode. Previously, you must have already analysed a word or a
150
 
sentence, respectively. Make malaga display the analysis tree by entering <B>tree</B>, move the mouse pointer to the state node you want to debug, and press
151
 
the left mouse button. A window opens in which this state's category is shown.
152
 
The window's title line contains the number of the state node. Use this number
153
 
as argument for <B>debug-node</B>. The last analysis input will be analysed
154
 
again, and analysis stops when reaching the first successor rule of the
155
 
specified state and malaga switches to debug mode.<BR>
156
 
<BR>
157
 
<A NAME="toc15"></A>
158
 
<H2><A NAME="htoc19">4.8</A>&nbsp;&nbsp;The Command ``debug-syn'' (malaga)</H2>
159
 
Use the command <B>debug-syn</B> to find errors in your syntax combination
160
 
rules. This command analyses the rest of the command line syntactically and
161
 
executes the syntax combination rules in debug mode. Debug mode is explained
162
 
for the command <B>debug</B>.<BR>
163
 
<BR>
164
 
<A NAME="toc16"></A>
165
 
<H2><A NAME="htoc20">4.9</A>&nbsp;&nbsp;The Command ``delete''</H2>
166
 
If you want to delete a breakpoint, use the command <B>delete</B> with the
167
 
number of the breakpoints as argument.<BR>
168
 
<BR>
169
 
Enter ``<TT>delete all</TT>'' to delete all breakpoints.<BR>
170
 
<BR>
171
 
<A NAME="toc17"></A>
172
 
<H2><A NAME="htoc21">4.10</A>&nbsp;&nbsp;The Command ``ga'' (mallex)</H2>
173
 
Use the command <B>ga</B> (short for ``generate allomorphs'') to generate
174
 
allomorphs. This is useful for testing allomorph generation from within <B>mallex</B>. When you enter the command, give a lexicon entry as argument. All
175
 
allomorphs that are generated from this entry by the allomorph rules, are
176
 
printed on screen. For example:
177
 
<PRE>
178
 
mallex&gt; ga [surface: "john", class: name]
179
 
surf: "john", cat: [class: name, base_form: "abraham"]
180
 
</PRE>If the rules create multiple allomorphs from an entry, they are displayed one
181
 
after another.<BR>
182
 
<BR>
183
 
<A NAME="toc18"></A>
184
 
<H2><A NAME="htoc22">4.11</A>&nbsp;&nbsp;The Command ``ga-file'' (mallex)</H2>
185
 
Use the command <B>ga-file</B> to make the allomorph rules generate allomorphs
186
 
for a lexicon file. Assume you have written a lexicon file ``<TT>mini.lex</TT>'':
187
 
<PRE>
188
 
[surface: "m{a}n", class: noun];
189
 
[surface: "table", class: noun];
190
 
[surface: "wise", class: adjective];
191
 
</PRE>To generate the allomorphs for this lexicon, enter:<BR>
192
 
<BR>
193
 
<TT>ga-file mini.lex</TT><BR>
194
 
<BR>
195
 
This will produce a readable allomorph file whose name ends in ``<TT>.cat</TT>''
196
 
(for <EM>categories</EM>); for ``<TT>mini.lex</TT>'' its name will be ``<TT>mini.lex.cat</TT>'':
197
 
<PRE>
198
 
surf: "man", cat: [class: noun, syn: singular]
199
 
surf: "men", cat: [class: noun, syn: plural]
200
 
surf: "table", cat: [class: noun]
201
 
surf: "wise", cat: [class: adjective, restr: complete]
202
 
surf: "wis", cat: [class: adjective, restr: inflect]
203
 
</PRE>
204
 
<A NAME="toc19"></A>
205
 
<H2><A NAME="htoc23">4.12</A>&nbsp;&nbsp;The Command ``ga-line'' (mallex)</H2>
206
 
Use the command <B>ga-line</B> to make the allomorph rules generate
207
 
allomorphs for a single lexicon entry. Assume you want to test
208
 
the second line in the lexicon file ``<TT>mini.lex</TT>'':
209
 
<PRE>
210
 
[surface: "m{a}n", class: noun];
211
 
[surface: "table", class: noun];
212
 
[surface: "wise", class: adjective];
213
 
</PRE>Enter the following line:<BR>
214
 
<BR>
215
 
<TT>ga-line mini.lex 2</TT><BR>
216
 
<BR>
217
 
Then <B>mallex</B> generates allomorphs for the lexicon entry
218
 
``<CODE>[surface: "table", class:noun];</CODE>''.<BR>
219
 
<BR>
220
 
If there is no lexicon entry at this line, the subsequent lexicon entry will be
221
 
taken.<BR>
222
 
<BR>
223
 
<A NAME="toc20"></A>
224
 
<H2><A NAME="htoc24">4.13</A>&nbsp;&nbsp;The Command ``get''</H2>
225
 
This command is used to query settings of <B>malaga</B> or <B>mallex</B>. Enter
226
 
it together with the name of the option whose setting you want to know. The
227
 
possible options are described in the next chapter.
228
 
If you just enter ``<TT>get</TT>'', all settings will be shown.<BR>
229
 
<BR>
230
 
<A NAME="toc21"></A>
231
 
<H2><A NAME="htoc25">4.14</A>&nbsp;&nbsp;The Command ``go''</H2>
232
 
This command can only be executed in debug mode. The rule execution will be
233
 
resumed and continued until a breakpoint is met or the rules have been executed
234
 
completely.<BR>
235
 
<BR>
236
 
<A NAME="toc22"></A>
237
 
<H2><A NAME="htoc26">4.15</A>&nbsp;&nbsp;The Command ``help''</H2>
238
 
Use this command to get a list of the commands you can use. If you give the
239
 
name of a command or an option as argument, a short explanation of this item
240
 
will be printed. If a name represents a command as well as an option, prepend
241
 
``<TT>command</TT>'' or ``<TT>option</TT>'' to it.<BR>
242
 
<BR>
243
 
<A NAME="toc23"></A>
244
 
<H2><A NAME="htoc27">4.16</A>&nbsp;&nbsp;The Command ``info'' (malaga)</H2>
245
 
This command gives you information about the morphology or syntax rules you are
246
 
using.
247
 
<UL><LI>
248
 
``<TT>info mor</TT>'' prints the lines in your project file(s) that begin
249
 
 with ``<TT>morinfo:</TT>'' 
250
 
<LI>``<TT>info syn</TT>'' prints the lines in your project file(s) that begin
251
 
 with ``<TT>syninfo:</TT>''
252
 
</UL>
253
 
<A NAME="toc24"></A>
254
 
<H2><A NAME="htoc28">4.17</A>&nbsp;&nbsp;The Command ``list''</H2>
255
 
If you enter the command <B>list</B>, all breakpoints are listed. For each
256
 
breakpoint, its number, the name of the source file and the source line is
257
 
shown.<BR>
258
 
<BR>
259
 
<A NAME="toc25"></A>
260
 
<H2><A NAME="htoc29">4.18</A>&nbsp;&nbsp;The Command ``ma'' (malaga)</H2>
261
 
The command <B>ma</B> (for <EM>morphological analysis</EM>) starts a word form
262
 
analysis. Give the word form that you want to be analysed as argument:
263
 
<PRE>
264
 
malaga&gt; ma house
265
 
</PRE>Malaga will show the results automatically, and it will also show the analysis
266
 
tree automatically if you specified it using the <B>tree</B> option. You can
267
 
look at the results using <B>result</B> or at the entire analysis tree using
268
 
<B>tree</B>.<BR>
269
 
<BR>
270
 
If you do not enter a word form behind the command <B>ma</B>, <B>malaga</B>
271
 
re-analyses the last input.<BR>
272
 
<BR>
273
 
<A NAME="toc26"></A>
274
 
<H2><A NAME="htoc30">4.19</A>&nbsp;&nbsp;The Command ``ma-file'' (malaga)</H2>
275
 
The command <B>ma-file</B> can be used to analyse files that contain word lists.
276
 
A word list consists of a number of word forms, each word form on a line on its
277
 
own. There may be empty lines in a word list. The following example is a word
278
 
list called ``<TT>word-list</TT>'':
279
 
<PRE>
280
 
table
281
 
men's
282
 
blue
283
 
handicap
284
 
</PRE>
285
 
To analyse this word list, enter:<BR>
286
 
<BR>
287
 
<TT>ma-file word-list result</TT><BR>
288
 
<BR>
289
 
This will produce a file ``<TT>result</TT>'' that contains the analysis results.
290
 
If the second argument is missing, the result will be written to a file whose
291
 
name ends in ``<TT>.cat</TT>'' (for <EM>categories</EM>); for ``<TT>word-list</TT>'',
292
 
its name will be ``<TT>word-list.cat</TT>'':
293
 
<PRE>
294
 
1: "table": [class: noun, ...]
295
 
2: "men's": [class: noun, ...]
296
 
3: "blue": [class: noun, ...]
297
 
3: "blue": [class: adjective, ...]
298
 
3: "blue": [class: name, ...]
299
 
4: "handicap: unknown
300
 
</PRE>
301
 
The number at the line start represents the line number of the analysed
302
 
original word form. The output format can be changed by using the commands
303
 
<B>output-format</B> and <B>unknown-format</B>.<BR>
304
 
<BR>
305
 
If a runtime error occurs during the analysis of a word, the error message will
306
 
be inserted into the result file, and the next word will be processed.<BR>
307
 
<BR>
308
 
After the analysis, some statistics will be printed: The number of analysed and
309
 
recognised word forms, the average number of results per word form, and the
310
 
average number of word forms that have been analysed per second (if the
311
 
analysis took long enough).<BR>
312
 
<BR>
313
 
<A NAME="toc27"></A>
314
 
<H2><A NAME="htoc31">4.20</A>&nbsp;&nbsp;The Command ``mg'' (malaga)</H2>
315
 
Use the command <B>mg</B> to generate all word forms that consist of a specified
316
 
set of allomorphs. For example, the command<BR>
317
 
<BR>
318
 
<TT>mg 3 un able believe</TT><BR>
319
 
<BR>
320
 
generates all word forms that consist of up to three allomorphs, where only the
321
 
specified allomorphs (``un'', ``able'', and ``believe'') are used. The word
322
 
forms are numbered from 1 onward, but different analyses of the same word form
323
 
get the same index. The output will look like this:
324
 
<PRE>
325
 
1: "able"
326
 
2: "believe"
327
 
3: "unable"
328
 
4: "unbelieveable"
329
 
</PRE>Please note that generation does not know of filters, pruning rules and
330
 
default rules.<BR>
331
 
<BR>
332
 
<A NAME="toc28"></A>
333
 
<H2><A NAME="htoc32">4.21</A>&nbsp;&nbsp;The Command ``next''</H2>
334
 
This command can only be executed in debug mode. The rule execution will be
335
 
resumed and continues until a different source line is met or until the rules
336
 
have been executed completely. It is like <B>step</B>, but subrules will be
337
 
executed without interruption. If you specify a number as argument, the command
338
 
will be repeated as often as specified.<BR>
339
 
<BR>
340
 
<A NAME="toc29"></A>
341
 
<H2><A NAME="htoc33">4.22</A>&nbsp;&nbsp;The Command ``output''</H2>
342
 
This command prints the results of the last analysis or allomorph generation as
343
 
ordinary text. The output format can be changed by using the commands <B>allo-format</B> (for <B>mallex</B>), <B>output-format</B>, and <B>unknown-format</B> (for <B>malaga</B>).<BR>
344
 
<BR>
345
 
<A NAME="toc30"></A>
346
 
<H2><A NAME="htoc34">4.23</A>&nbsp;&nbsp;The Command ``print''</H2>
347
 
You can only use the command <B>print</B> in debug mode or if the previous
348
 
analysis has stopped with an error in the combination rules. Using this
349
 
command, you get the values of all Malaga variables currently defined. The
350
 
variables will be printed in the order of their definitions:
351
 
<PRE>
352
 
malaga&gt; sa-debug You are beautiful.
353
 
entering rule "Noun", start: "", next: "You"
354
 
debug&gt; print
355
 
$sentence = [class: main_clause, parts: &lt;&gt;]
356
 
$word = [class: pronoun, result: S2]
357
 
</PRE>
358
 
You can specify any variable names (including the ``<TT>$</TT>'') as arguments to
359
 
this command; you can even specify a path behind each of the
360
 
variable names. In this case, only the values of the specified variables or
361
 
paths are printed:
362
 
<PRE>
363
 
debug&gt; print $word
364
 
$word = [class: pronoun, result: S2]
365
 
debug&gt; print $word.class
366
 
$word.class = pronoun
367
 
</PRE>
368
 
If the variable values are very complex, the output of <B>print</B> can be
369
 
confusing. Please use the command <B>variables</B> in this case.<BR>
370
 
<BR>
371
 
<A NAME="toc31"></A>
372
 
<H2><A NAME="htoc35">4.24</A>&nbsp;&nbsp;The Command ``quit''</H2>
373
 
Use this command to leave <B>malaga</B> or <B>mallex</B>.<BR>
374
 
<BR>
375
 
<A NAME="toc32"></A>
376
 
<H2><A NAME="htoc36">4.25</A>&nbsp;&nbsp;The Command ``result''</H2>
377
 
If you have previously analysed a word form or a sentence using <B>ma</B> or
378
 
<B>sa</B> (in <B>malaga</B>), or you have generated allomorphs using <B>ga</B> or
379
 
<B>ga-line</B> (in <B>mallex</B>), you can display the results with ``<TT>result</TT>''. The analysis results will be displayed in a window on their own
380
 
which is called ``<B>Results</B>'' for <B>malaga</B> and ``<B>Allomorph</B>'' for
381
 
<B>mallex</B>. They are numbered from 1 onward.<BR>
382
 
<BR>
383
 
If you are executing the command <B>result</B> for the first time, or if you
384
 
have closed a <B>Results/Allomorph</B> window that you'd opened before, a window
385
 
will open, displaying the values of all results/allomorphs of the last
386
 
analysis/generation.<BR>
387
 
<BR>
388
 
If there is a <B>Results/Allomorph</B> window currently opened, the new results/allomorphs
389
 
will be displayed in this window.<BR>
390
 
<BR>
391
 
The <B>Results/Allomorph</B> window has a menu with some commands:
392
 
<DL COMPACT=compact><DT>
393
 
<B>Window:</B><DD> Here, two items can be selected:
394
 
 <DL COMPACT=compact><DT>
395
 
 <B>Export Postscript...:</B><DD> Choose this item to convert the display
396
 
 content to Postscript and save it as a file.
397
 
 <DT><B>Close:</B><DD> Choose this item to close the <B>Results/Allomorph</B> window.
398
 
 </DL>
399
 
<DT><B>Font size:</B><DD> Choose one of the menu's subitems to change the font size.
400
 
</DL>
401
 
<A NAME="toc33"></A>
402
 
<H2><A NAME="htoc37">4.26</A>&nbsp;&nbsp;The Command ``rule''</H2>
403
 
This command can only be used in debugger mode or after rule execution has been
404
 
stopped by an error. It prints the name of the rule that has been executed;
405
 
additionally, the Start and Next surface are printed in <B>malaga</B>. For
406
 
example:
407
 
<PRE>
408
 
debug&gt; rule
409
 
at rule "flexion", start: "hous", next: "es"
410
 
</PRE>
411
 
<A NAME="toc34"></A>
412
 
<H2><A NAME="htoc38">4.27</A>&nbsp;&nbsp;The Command ``run''</H2>
413
 
This command can only be used in debug mode. The rule execution will be
414
 
resumed, and the rules will be executed completely without any interruption.<BR>
415
 
<BR>
416
 
If you have invoked the debug mode by the command <B>debug-node</B>, rule
417
 
execution will be stopped again when another Next item will be analysed.<BR>
418
 
<BR>
419
 
<A NAME="toc35"></A>
420
 
<H2><A NAME="htoc39">4.28</A>&nbsp;&nbsp;The Command ``sa'' (malaga)</H2>
421
 
If you have started <B>malaga</B> with a syntax file in your command line or in
422
 
the project file, you can start syntactic analyses using the command <B>sa</B>
423
 
(short for <EM>syntactic analysis</EM>). Put the sentence you want to be
424
 
analysed as argument behind the command name:
425
 
<PRE>
426
 
malaga&gt; sa The man is in town.
427
 
</PRE>Malaga will show the results automatically, and it will also show the analysis
428
 
tree automatically if you specified it using the <B>tree</B> option. You can
429
 
look at the results using <B>result</B> or at the entire analysis tree using
430
 
<B>tree</B>.<BR>
431
 
<BR>
432
 
If you do not enter a sentence behind the command <B>sa</B>, <B>malaga</B>
433
 
re-analyses the last input.<BR>
434
 
<BR>
435
 
<A NAME="toc36"></A>
436
 
<H2><A NAME="htoc40">4.29</A>&nbsp;&nbsp;The Command ``sa-file'' (malaga)</H2>
437
 
Using the command <B>sa-file</B>, you can analyse files that contain sentence
438
 
lists. In a sentence list, each sentence stands in a line on its own; empty
439
 
lines are permitted. Here is an example, a sentence list named ``<TT>sentence-list</TT>'':
440
 
<PRE>
441
 
He sleeps.
442
 
He slept.
443
 
He has slept.
444
 
He had slept.
445
 
</PRE>
446
 
To analyse this sentence list, enter:<BR>
447
 
<BR>
448
 
<TT>sa-file sentence-list result</TT><BR>
449
 
<BR>
450
 
This will produce a file ``<TT>result</TT>'' that contains the analysis results.
451
 
If the second argument is missing, the result will be written to a file whose
452
 
name ends in ``<TT>.cat</TT>'' (for <EM>categories</EM>); for ``<TT>sentence-list</TT>'', its name will be ``<TT>sentence-list.cat</TT>''.
453
 
<PRE>
454
 
1: "He sleeps.": [functor: [syn: &lt;S3&gt;, sem: &lt;"sleep"&gt;], 
455
 
                  arguments: &lt;[syn: S3, sem: "definite pronoun"]&gt;]
456
 
2: "He slept.": [functor: [syn: &lt;S3&gt;, sem: &lt;"sleep"&gt;], 
457
 
                 arguments: &lt;[syn: S3, sem: "definite pronoun"]&gt;]
458
 
3: "He has slept.": [functor: [syn: &lt;S3&gt;, sem: &lt;"have", "sleep"&gt;], 
459
 
                     arguments: &lt;[syn: S3, sem: "definite pronoun"]&gt;]
460
 
4: "He had slept.": [functor: [syn: &lt;S3&gt;, sem: &lt;"have", "sleep"&gt;], 
461
 
                     arguments: &lt;[syn: S3, sem: "definite pronoun"]&gt;]
462
 
</PRE>
463
 
The number at the line start represents the line number of the analysed
464
 
original sentence. The output format can be changed by using the commands
465
 
<B>output-format</B> and <B>unknown-format</B>.<BR>
466
 
<BR>
467
 
If a runtime error occurs during the analysis of a sentence, the error message
468
 
will be inserted into the result file, and the next sentence will be processed.<BR>
469
 
<BR>
470
 
After the analysis, some statistics will be printed: The number of analysed and
471
 
recognised sentences, the average number of results per sentence, and the
472
 
average number of sentences that have been analysed per second (if the analysis
473
 
took long enough).<BR>
474
 
<BR>
475
 
<A NAME="toc37"></A>
476
 
<H2><A NAME="htoc41">4.30</A>&nbsp;&nbsp;The Command ``set''</H2>
477
 
This command is used to change the settings of <B>malaga</B> or <B>mallex</B>. The command line
478
 
``<TT>set</TT> <I>option argument</I>'' changes <I>option</I> to 
479
 
<I>argument</I>.<BR>
480
 
<BR>
481
 
If you want to get the current state of an option, use the command <B>get</B>.
482
 
Options can also be set in the project file. The possible options are
483
 
described in the next chapter.<BR>
484
 
<BR>
485
 
<A NAME="toc38"></A>
486
 
<H2><A NAME="htoc42">4.31</A>&nbsp;&nbsp;The Command ``sg'' (malaga)</H2>
487
 
Use <B>sg</B> to generate sentences that are composed of a specified set of word
488
 
forms. For example, if you enter<BR>
489
 
<BR>
490
 
<TT>sg 3 . ? he she sleeps</TT><BR>
491
 
<BR>
492
 
all sentences that consist of up to three word forms, where only the specified
493
 
word forms (``.'', ``?'', ``he'', ``she'', and ``sleeps'') are used. The
494
 
sentences are numbered from 1 onward, but different analyses of the same
495
 
sentence get the same index. The output looks like this:
496
 
<PRE>
497
 
malaga&gt; sg 3 . ? he she sleeps
498
 
1: "he sleeps ."
499
 
2: "he sleeps ?"
500
 
3: "she sleeps ."
501
 
4: "she sleeps ?"
502
 
</PRE>Please note that generation does not know of filters, pruning rules and
503
 
default rules.<BR>
504
 
<BR>
505
 
<A NAME="toc39"></A>
506
 
<H2><A NAME="htoc43">4.32</A>&nbsp;&nbsp;The Command ``step''</H2>
507
 
This command can only be executed in debug mode. The rule execution will be
508
 
resumed and continues until a different source line is met or until the rules
509
 
have been executed completely. If you specify a number as argument, the command
510
 
will be repeated as often as specified.<BR>
511
 
<BR>
512
 
<A NAME="toc40"></A>
513
 
<H2><A NAME="htoc44">4.33</A>&nbsp;&nbsp;The Command ``trace''</H2>
514
 
If you are executing your rules in debug mode or the rules were interrupted
515
 
by an error, this command shows were rule execution currently stopped. If it
516
 
stopped in a subrule, all calling rules are also shown.
517
 
<PRE>
518
 
debug&gt; trace
519
 
line 23 in file "dmm-deutsch.syn", rule "fill_valencies"
520
 
line 391 in file "dmm-deutsch.syn", rule "main_clause_end"
521
 
</PRE>This means, rule execution stopped in line 23 of ``<TT>dmm-deutsch.syn</TT>'', in
522
 
rule ``<TT>fill_valencies</TT>''. This subrule was called from line 391 in
523
 
``<TT>dmm-deutsch.syn</TT>'', in rule ``<TT>main_clause_end</TT>''.<BR>
524
 
<BR>
525
 
<A NAME="toc41"></A>
526
 
<H2><A NAME="htoc45">4.34</A>&nbsp;&nbsp;The Command ``transmit'' (malaga)</H2>
527
 
<A NAME="toc42"></A>
528
 
<H2><A NAME="htoc46">4.35</A>&nbsp;&nbsp;The Command ``tree'' (malaga)</H2>
529
 
If you've started a grammatical analysis using one of the commands <B>ma</B> or
530
 
<B>sa</B> (or their debug variants), you can make <B>malaga</B> display the
531
 
result by entering<BR>
532
 
<BR>
533
 
<TT>tree</TT><BR>
534
 
<BR>
535
 
If the analysis has not yet finished (in debug mode or in case of an error), an
536
 
intermediate result will be shown.<BR>
537
 
<BR>
538
 
If you're executing the command <B>tree</B> for the first time, or if you've
539
 
closed the <B>Tree</B> window before, a new tree window will open in which the
540
 
current analysis tree will be displayed.<BR>
541
 
<BR>
542
 
If there is already a <B>Tree</B> window open, the new analysis tree will be
543
 
displayed in this window.<BR>
544
 
<BR>
545
 
In the upper left corner of the <B>Tree</B> window, you will see the sentence or
546
 
the word form that has been analysed. Below, the analysis tree is displayed. An
547
 
analysis path always follows the edges from the left to the right.<BR>
548
 
<BR>
549
 
A circle node stands for a LAG state, a two-circle node stands for an end
550
 
state.<BR>
551
 
<BR>
552
 
Above each edge, the Next surface that has been read in by the corresponding
553
 
rule application is displayed. On the bottom of an edge, you'll see the name of
554
 
the applied rule.<BR>
555
 
<BR>
556
 
You can click on a node using the left mouse button. Then another window will
557
 
open, namely the <B>Path</B> window. The <B>Path</B> window displays the surface,
558
 
the category and the successor rules of the state you've clicked on. The node
559
 
will be highlighted by a fatter border. If you've already clicked on a node,
560
 
you can click on one of its successor nodes using the right mouse button. Then
561
 
all rule applications, from the state clicked on previously up to the state
562
 
clicked on this time, will be displayed in the <B>Path</B> windows. The
563
 
corresponding path will be highlighted in the <B>Tree</B> window.<BR>
564
 
<BR>
565
 
If you're clicking on a Next surface using the left mouse button, the surface
566
 
and its category will be displayed in the <B>Path</B> window.<BR>
567
 
<BR>
568
 
You can also click on rule names using the left mouse button. Then the
569
 
corresponding rule application will be displayed in the <B>Path</B> window,
570
 
i.e. the Start, Next and Result surface, the Start, Next and Result category,
571
 
and the successor rules.<BR>
572
 
<BR>
573
 
There are some commands that can be started from the <B>Tree</B> menu bar:
574
 
<DL COMPACT=compact><DT>
575
 
<B>Window:</B><DD> Here you can select from two menu items:
576
 
 <DL COMPACT=compact><DT>
577
 
 <B>Export Postscript...:</B><DD> Convert the displayed analysis tree to a
578
 
 Postscript file.
579
 
 <DT><B>Close:</B><DD> Close the <B>Tree</B> window.
580
 
 </DL>
581
 
<DT><B>Font size:</B><DD> Select an item in this menu to adjust the font size.
582
 
<DT><B>View:</B><DD> Specify which nodes of the analysis tree are actually displayed.
583
 
 <DL COMPACT=compact><DT>
584
 
 <B>Result paths only:</B><DD> Only the nodes that are part of a complete analysis
585
 
 are displayed.
586
 
 <DT><B>All but dead ends:</B><DD> All analysis states are displayed.
587
 
 <DT><B>All nodes:</B><DD> All analysis states are displayed, and also rectangular
588
 
 nodes for rule applications that did not succeed (dead ends).
589
 
 </DL>
590
 
<DT><B>Result:</B><DD> Select an end state to display in the <B>Path</B> window.
591
 
 <DL COMPACT=compact><DT>
592
 
 <B>First result:</B><DD> Display the first end state.
593
 
 <DT><B>Previous result:</B><DD> If there is an end state displayed in the <B>Path</B>
594
 
 window, jump to the previous one.
595
 
 <DT><B>Next result:</B><DD> If there is an end state displayed in the <B>Path</B>
596
 
 window, jump to the next one.
597
 
 <DT><B>Last result:</B><DD> Display the last end state.
598
 
 </DL>
599
 
</DL>
600
 
The <B>Path</B> windows has got an own menu bar which contains the menus <B>Window</B>, <B>Font size</B> and <B>Result</B> with the same menu items as the
601
 
corresponding menus in the <B>Tree</B> window.<BR>
602
 
<BR>
603
 
<A NAME="toc43"></A>
604
 
<H2><A NAME="htoc47">4.36</A>&nbsp;&nbsp;The Command ``variables''</H2>
605
 
Use this command if you want to examine the values of the currently defined
606
 
variables. They will be displayed in window on their own. You do not need to
607
 
give any arguments, but you can only execute this command if <B>malaga</B> is in
608
 
debug mode or if the previous analysis has been stopped by an error in the
609
 
rules.<BR>
610
 
<BR>
611
 
If you are executing the command <B>variables</B> for the first time, or if you
612
 
have closed a <B>Variables</B> window that you'd opened before, a window will
613
 
open, displaying the values of all variables currently defined.<BR>
614
 
<BR>
615
 
If there is a <B>Variables</B> window currently opened, the new variable
616
 
contents will be displayed in this window.<BR>
617
 
<BR>
618
 
The <B>Variables</B> window has a menu with some commands:
619
 
<DL COMPACT=compact><DT>
620
 
<B>Window:</B><DD> Here, two items can be selected:
621
 
 <DL COMPACT=compact><DT>
622
 
 <B>Export Postscript...:</B><DD> Choose this item to convert the variable
623
 
 display to Postscript and save it as a file.
624
 
 <DT><B>Close:</B><DD> Choose this item to close the <B>Variables</B> window.
625
 
 </DL>
626
 
<DT><B>Font size:</B><DD> Choose one of the menu's subitems to change the font size.
627
 
<DT><B>Variables:</B><DD>
628
 
 <DL COMPACT=compact><DT>
629
 
 <B>Show selected variables:</B><DD> Choose one of the menu's subitems (variable
630
 
 names) to hide (or show) the corresponding variable.
631
 
 <DT><B>Show all variables:</B><DD> Choose this item to display all variables that are
632
 
 currently defined.
633
 
 <DT><B>Show no variables:</B><DD> Choose this item to suppress the display of all
634
 
 defined variables.
635
 
 </DL>
636
 
</DL>
637
 
<A NAME="toc44"></A>
638
 
<H2><A NAME="htoc48">4.37</A>&nbsp;&nbsp;The Command ``walk''</H2>
639
 
This command works in debug mode only. The rule execution will be continued and
640
 
stopped again as soon as a new rule is executed, a breakpoint is met or there
641
 
are no more rules to execute.<BR>
642
 
<BR>
643
 
<HR>
644
 
<A HREF="malaga004.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
645
 
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
646
 
<A HREF="malaga006.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
647
 
</BODY>
648
 
</HTML>