;;; Hey, emacs(1), this is -*- Mode: Common-Lisp; Package: LKB; -*- got it?

;;;
;;; first, load a number of LKB-specific settings; typically no need to look
;;; too closely here
;;;
(lkb-load-lisp (parent-directory) "Version.lsp" t)
(lkb-load-lisp (this-directory) "globals.lsp")
(lkb-load-lisp (this-directory) "user-fns.lsp")
(lkb-load-lisp (this-directory) "patches.lsp")

;;;
;;; next load the common transfer type hierarchy (the Transfer MatriX) ...
;;;
(read-tdl-type-files-aux
  (list 
   (lkb-pathname (grandparent-directory) "mrs.tdl")
   (lkb-pathname (grandparent-directory) "mtr.tdl")
   ;;
   ;; ... plus additional MRS and MTR type definitions for this language pair
   ;;
   (lkb-pathname (parent-directory) "mtr.tdl")
   (lkb-pathname (grandparent-directory) "predicates.tdl")
   (lkb-pathname (grandparent-directory) "predicates.erg.tdl")))

;;;
;;; a few more LKB- and MT-specific settings.
;;;
(lkb-load-lisp (this-directory) "mrsglobals.lsp" t)
(lkb-load-lisp (this-directory) "mt.lsp")

;;;
;;; to allow using PET for parsing (via [incr tsdb()] and a cpu definition that
;;; includes REPP pre-processing) interactively, also load the ERG REPP rules.
;;;
(read-repp (logon-file "lingo/erg/rpp" "setup.lsp"))

;;;
;;; read the `in' and `out' variable property mappings (VPMs), adjusting index
;;; properties in input and output MRSs, respectively.
;;;
(mt:read-vpm (lkb-pathname (parent-directory) "in.vpm") :in)
(mt:read-vpm (lkb-pathname (parent-directory) "out.vpm") :out)

;;;
;;; also read the target language SEM-I, so as to filter transfer ouputs that
;;; are doomed to fail downstream.
;;;
(mt:read-semi (logon-file "lingo/erg" "erg.smi"))

(mt:read-transfer-rules 
 (list
  (lkb-pathname (parent-directory) "paraphrase.mtr")
  ;;
  ;; at this point, for further fine-tuning, infuse information from the TL
  ;; SEM-I, at this point marking predicates that are strictly countable or
  ;; strictly non-countable.  then invoke the global `snugging' rules (which
  ;; provide reasonably generic mechanisms for processes like splitting up or
  ;; joining variables), followed by further snugging rules, specific to this
  ;; language pair.
  ;;
  (lkb-pathname (grandparent-directory) "semi.erg.mtr")
  (lkb-pathname (grandparent-directory) "snug.mtr")
  (lkb-pathname (parent-directory) "snug.mtr")
  (lkb-pathname (grandparent-directory) "erg.mtr")
  (lkb-pathname (parent-directory) "erg.mtr")
  (lkb-pathname (grandparent-directory) "finale.mtr"))
 "ERG paraphrase rules"
 :in :in :filter nil :out :out :post :erg)