[developers] top-level cfrom/cto values in xml always -1

Stephan Oepen oe at csli.Stanford.EDU
Mon Oct 10 10:35:52 CEST 2005

hi bernd,

> i've been asked to fix the top-level cfrom and cto values of PET's
> XML-MRS output. The problem is that i can not pass the correct values
> to fs-to-mrs for further processing.  Or would there be another
> (recommended) way to fix that?

you could try the modification to `lkb/src/mrs/pet-interface.lisp' that
i attach below.  if this worked, i would be happy making it part of the
LKB code base, though we should maybe also arrange CVS write access for

                                                      all best  -  oe

+++ Universitetet i Oslo (ILN); Boks 1102 Blindern; 0317 Oslo; (+47) 2285 7989
+++     CSLI Stanford; Ventura Hall; Stanford, CA 94305; (+1 650) 723 0515
+++       --- oe at csli.stanford.edu; oe at hf.uio.no; stephan at oepen.net ---

[--- cut here ---]

(defun fs-to-mrs (fs &optional (mode 'simple) &key cfrom cto)
  ;; top-level entry point for PET: given a full FS (typically obtained from a
  ;; parsing result), return a string representing the MRS in the requested
  ;; format.
  (when (fixnump fs)
     ;; _fix_me_
     ;; not sure the shadowing of type and feature tables is necessary: it will
     ;; restrict caching to calls within a structure, but given the overall
     ;; architecture of PET, the mapping of integers to types and features will
     ;; never change over time.  resolve, once efficiency of MRS generation
     ;; becomes an issue.                                      (9-sep-03; oe)
     (let* ((%pet-types% nil)
            (%pet-features% nil)
            (psoa (extract-mrs-from-fs fs)))
       (if (psoa-p psoa)
         (let* ((mode 
                 (typecase mode
                    (intern (string-upcase (symbol-name mode)) *mrs-package*))
                   (string (intern (string-upcase mode) *mrs-package*))))
                 (with-output-to-string (stream)
                   (case mode
                     ((simple indexed prolog html)
                      (output-mrs1 psoa mode stream))
                      (let ((scopes (make-scoped-mrs psoa)))
                            for scope in scopes
                              (setf *canonical-bindings* 
                                (canonical-bindings scope))
                               psoa :stream stream)
                            finally (setf *canonical-bindings* nil))))
                     ((eds dependencies)
                      (ed-output-psoa psoa :stream stream))
                     ((rmrs xml)
                      (let ((rmrs (mrs-to-rmrs psoa)))
                        (when (rmrs-p rmrs)
                          (when cfrom (setf (rmrs-cfrom rmrs) cfrom))
                          (when cto (setf (rmrs-cto rmrs) cto))
                           (if (eq mode 'rmrs) 'compact 'xml) 
           (when (and result (not (string= result ""))) result))
          "fs-to-mrs(): unable to extract MRS from fs # ~a.~%" 

More information about the developers mailing list