Plaster

common-lisp
(defmethod keywords ((document document) (document-collection document-collection)) (flet ((frob (word) (cons word (term-frequency-inverse-document-frequency document document-collection word)))) (let ((result (loop for word being the hash-keys of (word-count document) collect (frob word)))) (sort result #'> :key #'cdr))))