Get the itsdb package from http://lingo.stanford.edu/ftp/ and install it. How to do this is described in the documentation which can be found also at this site.
Set the SICStus path. For instance, if you use tcsh, put the following in your .tcshrc:
setenv SP_PATH /usr/local/lib/sicstus-3.9.1/[incr TSDB()] is called via foreign functions. The file is linked to libitsdb.so which has to be in the LD_LIBRARY_PATH.
Put something like the following in your ~/.tcshrc
(or the
respective file for the shell you are using):
setenv LD_LIBRARY_PATH /home/stefan/Lisp/lkb/lib/linux/
Create a file ~/.tsdbrc
to include something like the following:
(setf *pvm-cpus* (list (make-cpu :host "laptop1" :spawn "/home/stefan/bin/trale" :options '("-s" "-c" "/home/stefan/Prolog/Trale/Bale/theory" "-e" "load_tsdb,itsdb:connect_tsdb") :class :bale :threshold 2) ) )
In the options line you give a path to the grammar that should be loaded.
The item following :class
is an identifier. You may have
several calls to make-cpu, for instance if you want to use different
machines or if you want to load different grammars.
If you want to use two cpus in parallel, you specify two cpus with the same class name:
(setf *pvm-cpus* (list (make-cpu :host "server1" :spawn "/home/stefan/bin/trale" :options '("-s" "-c" "/home/stefan/Prolog/Trale/Bale/theory" "-e" "load_tsdb,itsdb:connect_tsdb") :class :bale1 :threshold 2) (make-cpu :host "server2" :spawn "/home/stefan/bin/trale" :options '("-s" "-c" "/home/stefan/Prolog/Trale/Bale/theory" "-e" "load_tsdb,itsdb:connect_tsdb") :class :bale1 :threshold 2) ) )
Furthermore you have to set up the parallel virtual machine (pvm):
Create the file ~/.pvm_hosts
containing something like the
following:
# # list machines accessible to PVM; option fields are (see pvmd(8)) # # - dx: path to `pvmd3' executable (on remote host); # - ep: colon-separated PATH used by pvmd(8) to locate executables; # - wd: working directory for remote pvmd(8); # - ip: alternate (or normalized) name to use in host lookup; # # sp=VALUE Specifies the relative computational speed of this host # compared to other hosts in the configuration. VALUE is an inte # ger in the range [1 - 1000000] laptop1 dx=/home/stefan/Lisp/lkb/bin/linux/ \ ep=/home/stefan/Lisp/lkb/lib/linux/ wd=/tmp sp=1004 server1 dx=/home/stefan/Lisp/lkb/bin/linux/ \ ep=/home/stefan/Lisp/lkb/lib/linux/ wd=/tmp sp=1004 server2 dx=/home/stefan/Lisp/lkb/bin/linux/ \ ep=/home/stefan/Lisp/lkb/lib/linux/ wd=/tmp sp=1004
The binaries and the man pages of pvm are part of the [incr TSDB()] distribution.
If you work on one host only, you will probably not have problems with PVM. If you want to work with several machines in parallel, chances are high that PVM does not work without debugging.
You can start the pvmd3
that comes with [incr TSDB()] by hand and then call
pvm
to check if the pvm demon initialized the other machines properly.
pvm
provides a console. If you have one host and type conf
, you get:
pvmd already running. pvm> conf 1 host, 1 data format HOST DTID ARCH SPEED DSIG laptop1 40000 LINUX 1000 0x00408841 pvm>If you configured several hosts in .pvm_hosts, you should see them here. If you do not, something went wrong in the initialization. If your PVM uses
rsh
(default)
then you have to make sure that rexec
is enabled on all hosts.
You can test this by typing:
rsh server2 whoIf this does not work, you have to consult your system administrator.
Having loaded [incr TSDB()] you can initialize a CPU by typing:
(tsdb::tsdb :cpus :bale)Where
:bale
is the identifier you have choosen for your CPU.
This should load the grammar and come back saying something like:
wait-for-clients(): `laptop1' registered as tid <262179>.After successful registration of a client (i.e. after loading your grammar) and after the creation of a test suite with the [incr TSDB()] podium you can process items for instance by using Process
|
All
Items in the [incr TSDB()] podium.
Processing can be interrupted by typing CTRL-G
at the podium.
Initializing CPUs with (tsdb::tsdb :cpus :bale)
redirects
the output to the /tmp/ directory. This is resonable if you work with
several cpus. If you want to see the output you may use:
(tsdb::tsdb :cpus :bale :file t)Looking at the load messages is also useful if you see something like:
wait-for-clients(): client exit for `laptop1' <262150>
Please refer to the [incr TSDB()] manual (http://www.coli.uni-sb.de/itsdb/publications/index.html#manual) for a description of example sessions and further documentation.
You can put together your own test suite by using the [incr TSDB()]
import function (File|
Import|
Test Items). This function
imports data from an ASCII text file. For example:
;;; intransitive Karl schläft. ;; this is a very simple example Der Mann schläft. ;;; transitive Liebt Karl Maria? Karl liebt Maria. ;;; np der Mann der klug Mann der Mann, der ihn kennt ;;; pronoun Er schläft Er kennt ihn. ;; subjless Mich dürstet. ;; particle_verbs Karl denkt nach. Karl denkt über Maria nach. *Karl nachdenkt über Maria. ;; unaccusatives Er fällt mir auf. ;;; perfect Er hat geschlafen. Du wirst schlafen. Du wirst geschlafen haben. ;;; free_rc Wer schläft, stirbt. Wen ich kenne, begrüße ich. Was er kennt, ißt er. Wo ich arbeite, schlafe ich. Über was ich nachdenke, hast du nachgedacht. Ich liebe, über was du nachdenkst. Über was du nachdenkst, gefällt mir. ;;; case *Liebt ihn ihn?
Ungrammatical sentences are marked with a star. Everything that follows two `;' is treated as a comment. The phenomenon is given on a separate line starting with three `;'. If you want [incr TSDB()] to display statistics on a phenomenon-based basis, you have to make [incr TSDB()] know these phenomena. This can be done by specifiying them in the .tsdbrc file:
(setf *phenomena* (append (list "intransitive" "transitive" "np" "pronoun" "perfect" "free_rc" "case") *phenomena*))
The data base you created is in your data base root directory. If you want to use it as a general skeleton, you have to move it to the skeleton directory and update the Index.lisp file apropriately. You can find out about the location of these directories under Options in the [incr TSDB()] podium.
The following should be specified in your grammar file (theory.pl):
grammar_version('Trale GerGram 0.3'). root_symbol(@root). % symbol for input that does not end with punctuation imp_symbol(@imp). % symbol for input that ends with '!' decl_symbol(@decl). % symbol for input that ends with '.' que_symbol(@que). % symbol for input that ends with '?'The grammar version will be shown in the run relation. The root symbol is used for parsing. The macros that are given as arguments to root_symbol, imp_symbol, decl_symbol, and que_symbol have to be specified in your grammar.
If you use CVS for version control you may consider the following entry for your grammar version.
grammar_version('Trale GerGram $Revision: 1.1 $').When you check in a new version the revision number is automatically updated by CVS.
The following specification can optionally be given in your theory.pl:
% before doing a parse all lexical descriptions % given in retract_before_parsing/1 are removed % this is used here to decrease the chart size % zero inflected elements do not interfere. retract_before_parsing(stem).