Differences between revisions 6 and 15 (spanning 9 versions)
Revision 6 as of 2005-04-12 21:41:32
Size: 4891
Comment:
Revision 15 as of 2005-06-09 08:52:02
Size: 4846
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
(Please note: POWER USERS only.) (Please note: POWER USERS only. BenWaldron is responsible for this module.)

'''NEW: The LKB/LexDB module now tested under both Linux and M$ Windows'''
Line 8: Line 10:
 * Ensure the environment variable `PSQL` is set: e.g. [Linux] set `export PSQL=t` in `.bashrc`.
Line 13: Line 14:
   * your `.lkbrc` file contains `(psql-initialize)`
 
Line 20: Line 20:
The filter specified will be interpreted as an SQL WHERE clause.

Eg.
The filter specified is interpreted as an SQL WHERE clause. Examples:
Line 31: Line 29:
(Note: the default is {{{ TRUE }}}. This represents the empty condition and will select all available entries.) (Note: the default is `TRUE`. This represents the empty condition and will select all available entries.)
Line 33: Line 31:
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 filter determines the entries in the lexicon as seen by a particular user. Only revision entries matching the filter conditions in filter can form part of the lexicon (of these, the most recent revision is the one actually used).
Line 41: Line 39:
(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}}})
(This will dump public schema tables to text files -- eg. `lexdb.rev`, `lexdb.rev_key`, `lexdb.dfn`, `lexdb.fld`, `lexdb.meta`)
[[BR]](Note: the dump mechanism will also produce a `.tdl` file if `*lexdb-dump-tdl*` is set to `t`)
[[BR]](Note: the database dump files are tab-separated with null as `\N`)
Line 45: Line 43:
2. Run the cvs commit command. E.g. [Linux] 2. Run the cvs commit command. E.g.
Line 47: Line 45:
     {{{cvs commit ~/erg/lexdb.*}}}      `cvs commit ~/erg/lexdb.*`
Line 51: Line 49:
1. Run the cvs update command to retrieve the latest dump file. E.g. [Linux] 1. Run the cvs update command to retrieve the latest dump file. E.g.
Line 57: Line 55:
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. 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.rev_new. Any changes made to your copy of the LexDB since the last update will be preserved.
Line 63: Line 61:
Dumps active LexDB entries (see filter) to {{{.tdl}}} file. Dumps active LexDB entries (determined by filter) to `.tdl` file.
Line 67: Line 65:
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): 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.
Line 69: Line 67:
0. Add the following line to your {{{.emacs}}} file: 0. Add the following line to your `.emacs` file:
Line 71: Line 69:
{{{(load "pg-interface")}}} `(load "pg-interface")`
Line 83: Line 81:
''M-TAB'' : get (ring of) (active) entries in LexDB where value of current field matches that in buffer ''M-TAB l'' : get (ring of) entries in table lex where value of current field matches that in buffer

''M-TAB r'' : get
(ring of) entries in union of rev tables where value of current field matches that in buffer
Line 91: Line 91:
''M-vs'' : view entries in user's scratch space ''M-vs'' : view entries in user's privat rev
Line 93: Line 93:
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 remove a lexical entry from the current lexicon ''lex'', create a (head) revision where the `dead` field is set to `t` (true) rather than `f` (false). In this manner we keep a revision history even for entries which are no longer used (and such entries can be reactivated if necessary). No revision entry should ever be deleted from the lexical database itself.
Line 95: Line 95:
== HOW TO load TDL entries into private schema == == HOW TO load TDL entries into private rev ==
Line 97: Line 97:
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. To add a small number of new (revision) entries from a `.tdl` file: ''LexDB -> Import TDL entries''. You will be queried to provide values for other certain non-grammar fields.
Line 99: Line 99:
== HOW TO commit entries to public schema == == HOW TO commit entries to public rev ==
Line 101: Line 101:
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'' 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 private rev''
Line 104: Line 104:
== HOW TO list entries in private schema == == HOW TO list entries in private rev ==
Line 106: Line 106:
From LKB: ''LexDB -> View scratch'' From LKB: ''LexDB -> View private rev''
Line 112: Line 112:
== HOW TO clear entries in private schema == == HOW TO clear entries in private rev ==
Line 114: Line 114:
''LexDB -> Clear scratch'' ''LexDB -> Clear private rev''

LexDB Usage Instructions

(Please note: POWER USERS only. BenWaldron is responsible for this module.)

NEW: The LKB/LexDB module now tested under both Linux and M$ Windows

If running the LKB runtime binary:

  • Download and install (LkbInstallation) the latest LKB, taking care to install/extract the lkb_data.tgz archive into the lkb installation directory (henceforth [Linux] ~/lkb).

If running the LKB from source:

  • Download and compile (LkbCompilation) the LKB, ensuring that

    • your .clinit.cl file contains (pushnew :psql *features*)

Now initialize the database server (LexDbPsqlInitialize) and the lexical database itself (LexDbInitialize).

HOW TO set the filter

LexDB -> Filter

The filter specified is interpreted as an SQL WHERE clause. Examples:

     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 filter determines the entries in the lexicon as seen by a particular user. Only revision entries matching the filter conditions in filter can form part of the lexicon (of these, the most recent revision is the one actually used).

HOW TO store LexDB in CVS

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.rev_key, lexdb.dfn, lexdb.fld, lexdb.meta) BR(Note: the dump mechanism will also produce a .tdl file if *lexdb-dump-tdl* is set to t) BR(Note: the database dump files are tab-separated with null as \N)

2. Run the cvs commit command. E.g.

  • cvs commit ~/erg/lexdb.*

HOW TO retrieve LexDB from CVS

1. Run the cvs update command to retrieve the latest dump file. E.g.

  • 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.rev_new. Any changes made to your copy of the LexDB since the last update will be preserved.

HOW TO dump LexDB as TDL file

LexDB -> Dump (TDL format)

Dumps active LexDB entries (determined by filter) to .tdl file.

HOW TO edit entries in the LexDB

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.

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 l : get (ring of) entries in table lex where value of current field matches that in buffer

M-TAB r : get (ring of) entries in union of rev tables 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 privat rev

To remove a lexical entry from the current lexicon lex, create a (head) revision where the dead field is set to t (true) rather than f (false). In this manner we keep a revision history even for entries which are no longer used (and such entries can be reactivated if necessary). No revision entry should ever be deleted from the lexical database itself.

HOW TO load TDL entries into private rev

To add a small number of new (revision) entries from a .tdl file: LexDB -> Import TDL entries. You will be queried to provide values for other certain non-grammar fields.

HOW TO commit entries to public rev

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 private rev

HOW TO list entries in private rev

From LKB: LexDB -> View private rev

or

from Emacs LexDB major mode: M-vs

HOW TO clear entries in private rev

LexDB -> Clear private rev

Further Topics

LexDbInternals BR["MWEs and Idiomatic Expressions"] BR [http://www.cl.cam.ac.uk/~bmw20/DT/Papers/ Papers]

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

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