;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; created 3/28/2004 by clbecker ;;;; last modified 4/18/2004 by clbecker ;;;; ;;;; ;;;; This file contains functions that rely on the ;;;; information gathered in the *Found-List* to compute ;;;; various generalizations about the unknown verb. ;;;; ;;;; ;;;; Global Variables: ;;;; ;;;; *subcat-list* ;;;; Contains all arguments of the verb (e.g agent, object, from, to) ;;;; ;;;; *transitivity* ;;;; Has the value of either intransitive, transitive, ditransitive, or nil. ;;;; ;;;; ;;;; Global Variables to add: ;;;; ;;;; *reflexive* ;;;; value should be either nil or t ;;;; ;;;; *verb-categories* ;;;; should contain a list of all categories the verb may belong to ;;;; as determined by the function categorize-verb, which ;;;; still needs to be written. ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; functions currently included: ;;;; ;;;; subcategorization-test ;;;; return the classes of arguments that ;;;; the verb subcategorizes for. This replaces ;;;; the functions that test whether a verb is ;;;; intransitive, transitive, or ditransitive. ;;;; ;;;; transitivity-match ;;;; returns the transitivity of the verb based ;;;; on the output of subcategorization-test ;;;; ;;;; ;;;; ;;;; ;;;; functions that need to be written: ;;;; ;;;; ;;;; ;;;; reflexive-test ;;;; test whether the verb is used reflexively ;;;; ;;;; ;;;; categorize-verb ;;;; place the verb into a category based on ;;;; gathered information. ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;;; ;;;; Modification History ;;;; ;;;; ;;;; 4/18/2004 ;;;; Added notes for future functions to add. ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; ;;;; ;;; Function: subcategorization-test ;;; ;;; Arguments: ;;; argsFound ;;; an association list containing the results ;;; of evaluating a find statement on the paths ;;; contained in *ArgsToFind* ;;; Set to the value of *ArgsFound* by default ;;; ;;; argList ;;; a list of all the key values of ;;; the arguments of the verb that are used in ;;; the association list, *ArgsToFind*. ;;; Set to the value of (nthcdr 2 *ArgList*) ;;; by default. This sets it to a list containing ;;; only the arguments of the verb. (the first 2 elements ;;; of *ArgList* are "verb" and "act"). ;;; ;;; ;;; Return values: ;;; This function calls other helper functions that set the values ;;; for the following variables and possible values: ;;; ;;; *transitivity* {transitive, intransitive, ditransitive} ;;; (defun subcategorization-test (&optional (argsFound *ArgsFound*) (argList (nthcdr 2 *ArgList*))) ;; Global variable *subcat-list* ;; contains all arguments the specific instance of the ;; verb subcategorizes for. ;; possible contents: ;; (agent object indobj) ;; (setf *subcat-list* (loop for arg in argList when (not (null (second (assoc arg argsFound)))) collect arg ) ; end loop for arg in ArgsList ) ; end setf ;; return subcat-list *subcat-list* ) ; end of function subcategorization-test (defun transitivity-match (list) "matches the elements of list to determine the transitivity." ;; list match-list ;; an association list with cases of transitivity ;; (defvar match-list (list '((agent object indobj) ditransitive) '((agent object) transitive) '((agent) intransitive) )) ; end defvar ;; determine the central arguments that the instance ;; of the verb has. (if (not (null (assoc ;; get all the elements of *subcat-list* that are ;; either 'agent, 'object, or 'indobj (intersection *subcat-list* '(agent object indobj)) ;; access the element of match-list that matches the ;; result of intersection, above. match-list ;; the test for equality is a function that ;; checks whether the key value in the association list ;; contains all (no less, no more) the elements of the ;; intersection list above. :test #'(lambda (lst match) (null (set-difference match lst))) ) ; end assoc )) ; end null, not ;; if the above condition is true, print the second element of the ;; match-list (i.e. {transitive, intransitive, ditransitive}) (setf *transitivity* (second (assoc (intersection *subcat-list* '(agent object indobj)) match-list :test #'(lambda (lst match) (null (set-difference match lst))) ) ; end assoc ) ; end second ) ; end setf ) ; end if ;; return transitivity *transitivity* ) ; end function transitivity-match ;;; Function: categorize-verb ;;; ;;; This function would use the list *ClassList* to ;;; categorize an unknown verb. ;;; ;;; The way I would suggest implementing this function is to ;;; have it take the output of subcategorization-test as input ;;; Iterate through that input and use each element with assoc ;;; on the *Found-List* on the list that is returned, access the ;;; appropriate list of attributes (e.g. for superclass). ;;; match the outputs to the lists in *ClassList* ;;; LIST *ClassList* ;;; ;;; This is an example of a possible data structure ;;; to use for categorizing verbs. ;;; (setf *ClassList* (list '(PTRANS1 (agent “causal agent”) (object “physical object”) (to “location”)) '(PTRANS2 (agent “causal agent”) (from “location”) (to “location”)) '(PTRANS3 (agent “causal agent”) (to “location”)) '(MTRANS (agent “causal agent”) (object “abstraction”) (to “entity”)) '(ATRANS (agent “abstraction”) (object “abstraction)) '(MOVE1 (agent “causal agent”) (object “external bodypart”)) '(MOVE2 (agent “causal agent”)) '(MBUILD (agent “causal agent”) (object “abstraction”)) '(INGEST (agent “causal agent”) (object “substance”)) '(GRASP (agent “causal agent”) (object “physical object”) (instrument “external bodypart”)) )) ;;; Function: reflexive-test ;;; ;;; ;;; ;;; ;;; ;;;