[developers] Trigger rules still being requested
Dan Flickinger
danf at stanford.edu
Wed Feb 10 19:47:36 CET 2016
Hi Emily -
I ran into this behavior too when doing the SWB-oriented grammars for the grammar engineering course I taught with Tom last quarter. The culprit turns out to be the function index-lexicon(), which right at its end cheerfully emits those warning/advice messages for all semantically empty entries regardless of whether trigger rules have been defined. Since the same shortcoming is repeated in the separate function reindex-lexicon(), it proved to be easier for me to correct this by changing the function make-trigger-tdl() which they both call, so that the global mt::*transfer-triggers* is checked before emitting the warning for each semantically empty lexical entry. Here is the patched version of this function analogous to what I added to my grammars' user-fns.lsp file:
(defun make-trigger-tdl (empty-semantics-lexical-entries)
(let ((empty-no-trigger-entries
(loop for id in empty-semantics-lexical-entries
unless (or #+:mt
(gethash id mt::*transfer-triggers*)
nil)
collect id)))
(loop for x in empty-no-trigger-entries
do
(format t "~%~%~a_gr := generator_rule &
[ CONTEXT.RELS <! [ PRED \"non_existing_rel\" ] !>,
FLAGS.TRIGGER \"~a\" ]."
(string-downcase x)
(string-downcase x)))))
I expect that Ann or Stephan could see a more elegant way to achieve this effect, but this patch might be a useful temporary expedient.
Dan
________________________________
From: developers-bounces at emmtee.net <developers-bounces at emmtee.net> on behalf of Emily M. Bender <ebender at uw.edu>
Sent: Wednesday, February 10, 2016 7:43 AM
To: developers
Subject: [developers] Trigger rules still being requested
Dear all,
In the Matrix derived grammars, we have the following in lkb/script:
;;;
;;; SSH 2012-03-27 This invokes trigger rules for semantically empty
;;; lexical entries. The trigger rules themselves should be in
;;; trigger.mtr in the grammar directory. The documentation on trigger
;;; rules: http://moin.delph-in.net/LkbGeneration
;;;
;;; SSH 2013-05-23 The semi.vpm file needs to be loaded *before* the
;;; trigger.mtr file in lkb/script for correct interaction.
;;;
(mt:read-transfer-rules
(list
(lkb-pathname (parent-directory) "trigger.mtr"))
"Generation trigger rules"
:filter nil :task :trigger :recurse nil :edges 200 :subsume nil)
;;;
;;; Matrix-derived grammars often have stable enough semantic
;;; representations that the grammar can usefully be tested
;;; by generating from them. The function index-for-generator()
;;; must be called for generation to be enabled. In grammars with
;;; small lexica, this takes a trivial amount of time. If
;;; generation is not being used regularly, and the indexing
;;; is taking too long, comment out the following. index-for-generator()
;;; can also be run from the expanded LKB top menu, under
;;; Generate.
;;;
(index-for-generator)
It is my understanding that (index-for-generator) is what is behind the messages
suggesting trigger rules for semantically empty lexical entries, but even though
we call it after loading the trigger rules, we still get messages such as the following:
[https://catalyst.uw.edu/file_download.cgi?ptkt=ef7def236ef9aa296b3372e09e0d1c8d7bb3fb0a0f764220c45caa89ec7f1332]
Is there something else we're supposed to do so that we only see those messages
when an entry truly lacks a trigger rule?
Thanks,
Emily
--
Emily M. Bender
Professor, Department of Linguistics
Check out CLMS on facebook! http://www.facebook.com/uwclma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.delph-in.net/archives/developers/attachments/20160210/89425a93/attachment.html>
More information about the developers
mailing list