-
Notifications
You must be signed in to change notification settings - Fork 4
LkbEmacs
The LKB is a stand-alone grammar development environment and can be used in connection with any text editor. The basic engineering cycle is similar to software development: a set of source files (aka a grammar) is maintained using a text editor and then compiled for run-time use in the LKB system. At the same time, integrating the LKB with the emacs editor brings certain advantages, among them ease of start-up, editing support for LKB grammar files, and some additional debugging facilities.
Extending the terse discussion from the LkbInstallation page (which hopefully just worked for you), the following paragraphs provide some more background on using the LKB with emacs, including help on running a Lisp environment as a sub-process to emacs (so as to compile the LKB source code).
This is the documentation of how to use LKB and Emacs with Greek (grammar files in UTF-8). You need an Emacs upwards of 21.3 (I do not know about the requirements for XEmacs).
Start the LKB in Emacs.
In your Emacs startup file, add the following settings:
;; Sets character set to greek-iso8859-7, and coding system to greek-iso-8bit
;; Also sets a default input method (Greek)
(set-language-environment 'Greek)
(set-default-coding-systems 'mule-utf-8)
(unless (boundp 'fi:common-lisp-image-arguments)
(setq fi:common-lisp-image-arguments nil))
(setq fi:common-lisp-image-arguments
(nconc (list "-locale" "el_GR.utf8") fi:common-lisp-image-arguments))
The first line sets most required values. The second one changes the default coding systems (the default in the Greek language environment is ISO-8859-7, not UTF-8) so that the grammar and test suite files are read with the correct encoding. The remaining lines tells Allegro Common Lisp to use Greek.
At the end of lkb/globals.lsp, add the following:
;; Write CDB temporary files as binary
(defparameter cdb::*cdb-ascii-p* nil)
Exit LKB and Emacs, delete the temporary lexicon files.
Your LKB setup is now capable of working with Greek. You can run batch parses from Greek files, pass on Greek sentences to do-parse-tty in the *common-lisp* buffer, and the results can be viewed (with Greek characters) in the chart window, parse tree windows, etc.
For other languages, the settings are probably analogous: choose an appropriate language environment in Emacs, and choose the appropriate file coding system (if it is different from the default in the language environment - see M-x describe-language-environment).
Remain to do:
- Greek input in the "Parse..." window
- Greek characters in the title bars (an UTF-8-capable window manager is probably enough to solve this problem)
- Greek characters in the menus of the parse tree window (e.g. specifying what rules or lexicon entries were used)
Note: this setup was working with Emacs 21.3 and Allegro Common Lisp 6.2. After the change to ACL 7.0, it does not work as completely anymore. We are investigating.
Home | Forum | Discussions | Events