Re: [lkb] Getting Parse results from LKB

[email protected] (Stephan Oepen) Tue, 17 Oct 2006 09:41:35 +0200
Newsgroups gmane.comp.ai.lkb
Organization Center for the Study of Language and Information, Stanford (USA)
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--++----------20061017011704-074758809----------++
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

hi again, bernhard,

> Unsetting DISPLAY does not work for me =E2=80=94 LKB generates an error
> message saying that the display cannot be accessed; with DISPLAY set,
> a graphic tree is shown, even for "do-parse-tty".

apologies, i now see that the LKB with DISPLAY unset does not work the
way i thought it would.  we should try fixing that at some point, i.e.
essentially drop back into tty mode when there is no DISPLAY (on Un*x).

i believe getting SBCL to work with GG seems like your best option for
now.  however, your query (and the one by shuly) prompted me to dig up
some old notes on the undocumented LSP (linguistic server protocol) in
the LKB.  essentially, there is a way of talking an ASCII protocol to
the LKB over a socket connection. =20

the protocol is old-fashioned: sequences of strings (with C escapes),
numbers, and symbols (say in C identifier syntax) for now.  a command
is terminated by a form feed character.  optionally, commands can be
prefixed with `wait' to request synchronous execution.  this mode is
required for all commands that expect (a) return value(s).  for each
command (synchronous or not), the client will see a numerical success
code (preceded by whatever else the command returned) plus a trailing
form feed (to allow both ends to synchronize cleanly).  a preliminary
list of (non-)success codes is at the top of `lkb/src/glue/lsp.lsp'.

if you wanted to experiment, please see `lsp.lsp'.  i just confirmed
that basic functionality (parsing inputs and retrieving parse tree(s),
AVM(s), or MRS(s)) is there.  assuming a functional LKB installation,
try the following:

  - launch the `server' script attached below; this should initialize
    an LKB sans-GUI, load the ERG, and go into LSP server mode.

  - create a socket connection to port 4712 and send commands from the
    file `client' attached below.  if you have nc(1) installed, simply

      cat /tmp/client - | /usr/bin/nc localhost 4712

however, LSP currently only works with Allegro CL, i.e. you would have
to rely on our pre-compiled binaries for the above.  also, please note
that LSP remains officially unsupported for the time being :-).

                                                          best  -  oe

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
++++++
+++ Universitetet i Oslo (IFI); Boks 1080 Blindern; 0316 Oslo; (+47) 2284=
 0125
+++     CSLI Stanford; Ventura Hall; Stanford, CA 94305; (+1 650) 723 051=
5
+++       --- [email protected]; [email protected]; [email protected] ---
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
++++++


--++----------20061017011704-074758809----------++
Content-Type: application/octet-stream; name="server"
Content-Transfer-Encoding: base64

aWYgWyAteiAiJERFTFBISU5IT01FIiBdOyB0aGVuCiAgZWNobyAidW5hYmxlIHRvIGRldGVybWlu
ZSBcYFwkREVMUEhJTkhPTUUnIHZhbHVlOyBleGl0LiI7CiAgZXhpdCAxOwpmaQoKdW5zZXQgRElT
UExBWQoKewogIGVjaG8gIihzeXN0ZW06cmVzaXplLWFyZWFzIDpvbGQgKCogMjU2IDEwMjQgMTAy
NCkgOm5ldyAoKiAzODQgMTAyNCAxMDI0KSkiOwogIGVjaG8gIihyZWFkLXNjcmlwdC1maWxlLWF1
eCBcIiRERUxQSElOSE9NRS9lcmcvbGtiL3NjcmlwdFwiKSI7CiAgZWNobyAiKGxzcC1zZXJ2ZXIp
IjsKICBjYXQgLTsKfSB8ICRERUxQSElOSE9NRS9iaW4vbGtiCgoK
--++----------20061017011704-074758809----------++
Content-Type: application/octet-stream; name="client"
Content-Transfer-Encoding: base64

d2FpdCBwYXJzZSAiaGF2ZSBoZXIgcmVwb3J0IG9uIG15IGRlc2siIDphbGwgOnRyZWUMCndhaXQg
cGFyc2UgImhhdmUgaGVyIHJlcG9ydCBvbiBteSBkZXNrIiA6YmVzdCA6YXZtDAp3YWl0IHBhcnNl
ICJoYXZlIGhlciByZXBvcnQgb24gbXkgZGVzayIgOmJlc3QgOm1ycwwK
--++----------20061017011704-074758809----------++--