Extraction Primitives
(defun extract-feature (tree feature)
(second (assoc feature (cdr tree))))
(defun extract-subtree (tree nonterminal)
(remove-if-not #'(lambda (comp) (numberp (first comp)))
(find nonterminal subtrees :key 'car)))
(2 (OBJ (REF DEFINITE) (COLOR GREEN) (SHAPE SPHERE)
(1 (ART (REF DEFINITE) (ROOT THE) (NUM S)))
(3 (NOUN (ROOT SPHERE) (NUM S)))
(4 (OPT-LOCATION (TYPE ABSOLUTE)
(1 (NOUN (ROOT POSITION)))
(2 (NUMBER (ROOT 3))))))))))