next up previous contents
Next: The Malaga startup file Up: The Malaga Programs Previous: The Malaga Programs   Contents

Projects

A couple of files, taken together, form a Malaga grammar:

You can group these files together to a project. To do this, you have to write a project file, with a name ending in ``pro'', in which you list the names of the several files, each one behind a keyword (each file type in a line on its own). Imagine you have written a grammar that consists of the files ``standard.sym'', ``webster.lex'', ``english.all'', ``english.mor'' and ``english.syn''. The project file for this grammar will look like this:

sym: standard.sym
lex: webster.lex
all: english.all
mor: english.mor
syn: english.syn
By using the include statement, you can include further source files in your source files, so a part of your grammar can consist of several files. Assume, you've got a lexicon file ``webster.lex'' that looks like this:
include "suffixes.lex";
include "verbs.lex";
include "adjectives.lex";
include "nouns.lex";
include "particles.lex";
include "abbreviations.lex";
include "names.lex";
include "numbers.lex";
In this case, you must write the names of all these files in the ``lex:'' line of your project file behind the name of the real lexicon file:
lex: webster.lex suffixes.lex verbs.lex adjectives.lex
lex: nouns.lex particles.lex abbreviations.lex names.lex numbers.lex
Since there is a number of files in this example, the ``lex:'' line has been divided into two lines, each line starting with ``lex:''.

If you want to extend an existing project (for example, you might want to add a syntax rule file to a morphology grammar), you can include the project file of the morphology grammar in the project file of your syntax grammar by using a line starting with ``include:'':

include: /projects/grammars/english/english.pro
syn: english_syntax.syn
The file entries in the project file of the morphology are treated as if they would replace the ``include:'' line.

The programs malaga and mallex can set options like hidden or robust from the project file, so you do not need to set these options each time you start malaga. Each line in the project file that starts with ``malaga:'' and ``mallex:'', resp., will be executed when malaga and mallex, resp., has been started, but you may only use the set command, so you can only set options. Here's an example:

  ...
malaga: set hidden +semantics
malaga: set robust on

mallex: set hidden +semantics +syntax
When you start malaga, the commands ``set hidden +semantics'' and ``set robust on'' will be executed; when you start mallex, the command ``set hidden +semantics +syntax'' will be executed.

Options in project files that are read in by ``include:'' lines in other project files will be executed as if they were at the position of the `` include:'' line.

Lines that start with ``morinfo:'' contain information about the morphology; lines that start with ``syninfo:'' contain information about the syntax. In malaga, you get this information if you use the command info. Example:

morinfo: =====================================
morinfo: Deutsche Malaga Morphologie 3.0
morinfo: written by Oliver Lorenz, 11.04.1997
morinfo: dmm@linguistik.uni-erlangen.de
morinfo: =====================================


next up previous contents
Next: The Malaga startup file Up: The Malaga Programs Previous: The Malaga Programs   Contents
Bjoern Beutel