[developers] Creating the new-style SEM-I for non-ERG grammars

Michael Wayne Goodman goodmami at uw.edu
Sun Apr 23 01:06:48 CEST 2017


Happy Earth Day, all,

I'm attempting to generate a new SEM-I for Jacy by following the example
set by the ERG 1214 release. My Lisp skills and LKB knowledge are lacking,
so I'm having trouble recovering from errors.

First I created an etc/ directory and moved jacy.smi and matrix.smi there
(these files can currently be found at Jacy's top-level directory:
https://github.com/delph-in/jacy). Then I create an etc/patches.lisp file
to hold potential modifications for the SEM-I, although it currently holds
placeholder comments like this:

    (
    ; (:block x )
    ; (:alias x y )
    ; (:link x y )
    ; (:parent x y )
    )

I then follow the lisp code at the bottom of the ERG's patches.lisp,
adapting to Jacy's setup. First I try this from the emacs lisp buffer (with
the LKB and Jacy loaded):

 (progn
  (setf semi
    (mt::construct-semi
     :ids t :rules t :descendp t :embedp t
     :semi (mt::read-semi
            "etc/matrix.smi"
            :includep nil :finalizep nil :recordp nil)
     :patches "etc/patches.lisp"
     :finalizep t))
  (mt::print-semi
   semi :stream "etc/hierarchy.smi"
   :format :hierarchy)
  (mt::print-semi
   semi :stream "etc/abstract.smi"
   :format :compact :filter "^[^_]")
  (mt::print-semi
   semi :stream "etc/surface.smi"
   :format :compact :filter "^_"))

But I get an error like this:

Error: First arg to format not t, nil, a stream, or a string with fill
pointer:
       "etc/hierarchy.smi"
  [condition type: SIMPLE-ERROR]

So after a few failed attempts to figure out why mt::print-semi won't work
with a string filename argument, I try to open the file outside the
function call:

(progn
  (setf semi
    (mt::construct-semi
     :ids t :rules t :descendp t :embedp t
     :semi (mt::read-semi
            "etc/matrix.smi"
            :includep nil :finalizep nil :recordp nil)
     :patches "etc/patches.lisp"
     :finalizep t))
  (with-open-file
      (stream "etc/hierarchy.smi" :direction :output :if-exists :supersede)
    (mt::print-semi semi :stream stream :format :hierarchy))
  (with-open-file
      (stream "etc/abstract.smi" :direction :output :if-exists :supersede)
    (mt::print-semi semi :stream stream :format :compact :filter "^[^_]"))
  (with-open-file
      (stream "etc/surface.smi" :direction :output :if-exists :supersede)
    (mt::print-semi semi :stream stream :format :compact :filter "^_"))
)

And I get this error:

Error: attempt to take the length of a non-sequence: LKB::COMPOUND_REL
  [condition type: TYPE-ERROR]

And now I'm out of ideas. The only file that has any content is
hierarchy.smi, which only has the "predicates:" header and nothing under it.

Has anybody successfully created a new-style SEM-I? Can anyone tell me what
I'm doing wrong?

-- 
Michael Wayne Goodman
Ph.D. Candidate, UW Linguistics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.delph-in.net/archives/developers/attachments/20170422/867cb73e/attachment.html>


More information about the developers mailing list