Next: FDs, Unification and Linearization
Up: Getting Started
Previous: Getting Started
Once the system is loaded, you are ready to run the program.
If you are in a hurry to try the system, the user functions are:
by default the grammar used is *u-grammar*
non-interactive is nil
limit is 10000
Complete work : unification + linearization. Outputs a sentence.
If non-interactive is nil, a line of statistics is
also printed.
In any case, stops after limit backtracking points.
(UNI-FD INPUT &key GRAMMAR NON-INTERACTIVE (LIMIT 10000))
by default the grammar used is *u-grammar*
non-interactive is nil.
limit is 10000
Does only the unification. Outputs the enriched fd. This is the
function to use when trying the grammars manipulating lists of gr5.l
If non-interactive is nil, a line of statistics is also printed.
In any case, stops after limit backtracking points.
CL> (uni ir01)
The boy loves a girl.
CL> (uni-fd ir02)
(# # ...)
(UNIF FD &key (GRAMMAR *u-grammar*))
by default the grammar used is *u-grammar*
As uni-fd but works even if FD does not contain a CAT feature.
|
If you want to change the grammar, or the input you can edit the files
defining it, or the function with the same name.
There are two other useful functions for grammar developers: fd-p
checks whether a Lisp expression is a syntactically correct Functional
Description (FD) to be used as an input. If it is not, helpful error
messages are given. grammar-p checks whether a grammar is well-formed.
NOTE: use fd-p on inputs only and grammar-p on grammars only.
(FD-P FD &key (PRINT-MESSAGES t) (PRINT-WARNINGS t))
-> T if FD is a well-formed FD.
-> nil (and error messages) otherwise.
The error messages and warnings are only printed if PRINT-MESSAGES and
PRINT-WARNINGS are true.
DO NOT USE FD-P ON GRAMMARS
(GRAMMAR-P &optional (GRAMMAR *u-grammar*)
&key (PRINT-MESSAGES t) (PRINT-WARNINGS t))
-> T if GRAMMAR (by default *u-grammar*) is a well-formed grammar.
-> nil (and error messages) otherwise.
- FD is *u-grammar* by default
- PRINT-MESSAGES is t by default.
If it is non-nil, some statistics on the grammar are printed.
It should be nil when the function is called non-interactively.
- PRINT-WARNINGS is nil by default.
If it is non-nil, warnings are generated for all paths in the
grammar. (It is sometimes a good idea to manually check that all
paths are valid.)
|
Examples:
CL> (fd-p '((a 1) (a 2)))
--> error, attribute a has 2 incompatible values: 1 and 2.
nil
CL> (grammar-p)
--> t
CL> (grammar-p '((a 1) (b 2)))
--> error, a grammar must be a valid FD of the form:
((alt (((cat c1)...) ... ((cat cn) ...)))). nil.
|
Next: FDs, Unification and Linearization
Up: Getting Started
Previous: Getting Started
Michael Elhadad - elhadad@cs.bgu.ac.il