SINGLE USER LexDB

The instructions as given below are suitable if you want to use the ERG with a Lex DB in single user mode.

SETUP INSTRUCTIONS for SINGLE USER LexDB

[a version of these instructions may be found in lkb/lexdb/README.single-user]

$ export MyLexDB=erg
$ createdb $MyLexDB

[The database is initialized using the SQL script file 'su-init.sql' which may be edited first to specify the Lex DB fields you want. See LexDbFieldMappings for further information. ]

$ psql $MyLexDB
=> \i su-init.sql

[now load the field mappings...]

=> \copy dfn from lexdb.dfn
=> \q

[NOW load your grammar, as normal, in the LKB, then open a connection to the currently empty LexDB...]

LKB(): (initialize-lexdb :type :single-user :dbname "erg")

[and export your lexicon to dump files for the database. The files will go into your LKB tmp directory. ]

LKB(): (export-lexicon)

[import the dump file into the database...] [NOTE: encoding of lexicon/dump files must be UTF-8]

$ psql $MyLexDB
=> \copy lex from /home/bmw20/tmp/LinGO.rev

[Now set the parameters in the LKB appropriately, via the menu]

LKB->Options->Set Options->*LEXDB-PARAMS* = ((:dbname "erg") (:type :single-user))

[Edit the LKB script file to specify that the database should be used, if necessary. The ERG script is already set up to do this, but see LexDbInitialize if you are working with a grammar which has not previously been used with the Lex DB. ]

[NOW reload grammar in LKB, and you should see a messages similar to the following: ]

...
(LexDB) connected to LexDB erg2@localhost:5432 as database user bmw20
(LexDB) total 'lex' entries available: 23055
...

[now we initialize the table of orthography keys, which allows the Lex DB to be used for parsing ...]

LKB(): (new-lex-key-table *lexicon*)

[and the database SEMI, for indices for generation (although it will still be necessary to index the lexicon before it is possible to generate) ...]

LKB(): (new-semi *lexicon*)

THAT'S IT

If anything goes wrong, and you need to start over, you can clear the database by:

$ dropdb $MyLexDB

Description:

LkbLexDbSingleUser (last edited 2011-10-08 21:12:11 by localhost)

(The DELPH-IN infrastructure is hosted at the University of Oslo)