-
Notifications
You must be signed in to change notification settings - Fork 4
LkbLexDB
Before you start: suitable for POWER USERS only.
You must be running a LexDB-enabled build of the LKB:
-
download the [http://lingo.stanford.edu/ftp/ LKB binary] and the [http://www.cl.cam.ac.uk/~bmw20/DT/lkb/latest/ LexDB setup files]; or
-
download the [http://lingo.stanford.edu/ftp/ LKB source code].
If running the binary, ensure the environment variable PSQL is set:
export PSQL=t
If building from source, ensure your .clinit.cl file contains the following:
(pushnew :psql *features*)
["Initialize PostgreSQL Server"] BR ["Create Skeletal LexDB"]
LexDB -> Filter
The filter specified will be interpreted as an SQL WHERE clause.
Eg.
userid = 'danf'
userid = 'danf' AND dialect = 'my_dialect'
userid IN ('danf', 'aac')
confidence > 0.5
(Note: the default is TRUE . This represents the empty condition and will select all available entries.)
The lexicon as seen by the login user is determined by that user's database filter. Only revision entries matching the conditions in filter can form part of the lexicon. In general multiple revisions for a given entry will be returned; the most recent will become part of the visible lexicon.
The LexDB may be dumped to text files which can then be uploaded to storage in CVS.
1. LexDB -> Dump
(This will dump public schema tables to text files -- eg. lexdb.rev , lexdb.dfn, and lexdb.fld) BR(Note: a TDL dump will be performed also unless you set *lexdb-dump-tdl* to nil) BR(Note: the database dump files are tab-separated with null as \N)
2. Run the cvs commit command. Eg.
- cvs commit ~/erg/lexdb.*
1. Run the cvs update command to retrieve the latest dump file. Eg.
- cvs update ~/erg/lexdb.*
2. LexDB -> Merge new entries
These steps update the LexDB (public schema) to include all new revisions stored in a CVS dump file. The new entries will be copied to the table public.revision_new. Any changes made to your copy of the LexDB since the last update will be preserved.
LexDB -> Dump (TDL format)
Dumps active LexDB entries (see filter) to .tdl file.
The LexDB-Emacs interface allows editing of lexical entries from within an Emacs environment (with browsing functionality, field completion, etc.). New revision entries are first stored in the users private schema, and hence are visible only to the particular user. To commit the entries to the public table (public.revision):
0. Add the following line to your .emacs file:
(load "pg-interface")
1. In [http://www.gnu.org/software/emacs/emacs.html GNU Emacs]: M-x lexdb to enter LexDB major mode. Then see the PG menu.
Available commands in LexDB major mode are:
C-l : load (active revision of lexical entry) into Emacs
C-c : commit (edited/new revision of) lexical entry into LexDB
TAB : field completion
M-TAB : get (ring of) (active) entries in LexDB where value of current field matches that in buffer
M-n : cycle through ring of entries obtained above
M-s : as M-TAB, but explicitly specify field value
M-va : view entries added in merge operation from dump file
M-vs : view entries in user's scratch space
Note: To remove a lexical entry from the active grammar, create a (head) revision where the flags field is set to 0 (rather than 1). This is necessary as in order to preserve revision history entry. No revision entry should ever be deleted from the lexical database itself.)
To add a small number of new (revision) entries from a .tdl file: LexDB -> Load TDL entries. The grammatical fields of the LexDB will be obtained from the TDL code; you will be queried to provide values for other necessary fields.
The LexDB consists of a single public schema and a set of private schemas, one per user. New (revision) entries are placed initially in your private schema. To commit (all) entries in your private schema to the public table: LexDB -> Commit scratch
From LKB: LexDB -> View scratch
or
from Emacs LexDB major mode: M-vs
LexDB -> Clear scratch
["InternalLexDBStructure"] BR["MWEs and Idiomatic Expressions"] BR [http://www.cl.cam.ac.uk/~bmw20/DT/Papers/ Papers]
Home | Forum | Discussions | Events