- (cond
- ((char-equal #\C c)
- "Upper/lower case")
- ((char-equal #\W c)
- "Word order")
- ((char-equal #\S c)
- "Singular")
- ((char-equal #\P c)
- "Plural")
- ((char-equal #\O c)
- "Other"))))
-
-
-(defgeneric cxt-ancestors (obj))
-(defmethod cxt-ancestors ((con ucon))
- (loop for term in (s#term con)
- append (cxt-ancestors term)))
-
-
-(defmethod cxt-ancestors ((term uterm))
- (loop for str in (s#str term)
- append (cxt-ancestors str)))
-
-(defmethod cxt-ancestors ((str ustr))
- "Return the ancestory contexts of a ustr"
- (let* ((anc (remove-if-not
- (lambda (cxt) (string-equal "ANC" (cxl cxt)))
- (s#cxt str)))
- (num-contexts (if anc
- (apply #'max (mapcar (lambda (cxt) (cxn cxt)) anc))
- 0))
- (anc-lists '()))
- (dotimes (i num-contexts (nreverse anc-lists))
- (let* ((anc-this-cxn (remove-if-not
- (lambda (cxt) (= (1+ i) (cxn cxt))) anc)))
- (push
- (sort anc-this-cxn (lambda (a b) (< (rank a) (rank b))))
- anc-lists)))))