From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/5147 Path: main.gmane.org!not-for-mail From: labrown@dg-rtp.dg.com ("Lance A. Brown") Newsgroups: gmane.emacs.gnus.general Subject: Grouplens addition Date: Thu, 15 Feb 1996 14:58:56 -0500 Message-ID: <27154.824414336@dg-rtp.dg.com> References: <21393.824398286@dg-rtp.dg.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" X-Trace: main.gmane.org 1035145790 31920 80.91.224.250 (20 Oct 2002 20:29:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:29:50 +0000 (UTC) Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by miranova.com (8.7.3/8.6.9) with SMTP id MAA27222 for ; Thu, 15 Feb 1996 12:44:35 -0800 Original-Received: from dg-rtp.dg.com (dg-rtp.rtp.dg.com [128.222.1.2]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Thu, 15 Feb 1996 20:55:54 +0100 Original-Received: from cipher.rtp.dg.com by dg-rtp.dg.com (5.4R3.10/dg-rtp-v02) id AA23196; Thu, 15 Feb 1996 14:55:15 -0500 Original-Received: from dg-rtp.dg.com by cipher.rtp.dg.com (8.6.10/200.12.1.1) id OAA27167; Thu, 15 Feb 1996 14:59:03 -0500 Original-To: bmiller@cs.umn.edu (Brad Miller), "(ding) GNUS Mailing List" In-Reply-To: Your message of "Thu, 15 Feb 1996 10:31:26 EST." <21393.824398286@dg-rtp.dg.com> Content-Id: <26938.824414104.0@dg-rtp.dg.com> Xref: main.gmane.org gmane.emacs.gnus.general:5147 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:5147 ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26938.824414104.1@dg-rtp.dg.com> Here is a patch to gnus-gl.el that adds another user-format function that doesn't rely on having the Grouplens info plugged into the Gnus scoring mechanism. This allows both "normal" SCORE/ADAPT scoring and Grouplens predictions to be displayed in the summary line. No changes to existing code were needed. I am also including the relevant section of my Gnus rc file so you can see how I set up to use this function. Groups that are handled by the BBB have the prediction shown. Groups that aren't show my "normal" summary line. --[Lance] ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26938.824414104.2@dg-rtp.dg.com> Content-Description: Patch for gnus-gl.el *** /tmp/T0a006YJ Thu Feb 15 14:49:43 1996 --- gnus-gl.el Thu Feb 15 14:38:50 1996 *************** *** 493,498 **** --- 493,566 ---- (aset rate-string 5 ?N) (aset rate-string 6 ?A)) rate-string)) + ;; + ;; Gnus user format function that doesn't depend on + ;; bbb-build-mid-scores-alist being used as the score function, but is + ;; instead called from gnus-select-group-hook. -- LAB + (defun gnus-user-format-function-L (header) + (if (not (member grouplens-current-group grouplens-newsgroups)) + ;; Return an empty string + "" + (let* ((rate-string (make-string 12 ? )) + (mid + (aref header + (nth 1 (assoc "message-id" gnus-header-index)))) + (hashent (gethash mid grouplens-current-hashtable)) + (pred (nth 0 hashent)) + (low (nth 1 hashent)) + (high (nth 2 hashent))) + + ;; Init rate-string + (aset rate-string 0 ?|) + (aset rate-string 11 ?|) + + ;; If no entry in BBB hash mark rate string as NA and return + (if (null hashent) + (progn + (aset rate-string 5 ?N) + (aset rate-string 6 ?A) + rate-string) + ;; Otherwise + (cond + ;; prediction-spot + ((equal grouplens-prediction-display 'prediction-spot) + (fmt-prediction-spot rate-string pred)) + + ;; confidence-interval + ((equal grouplens-prediction-display 'confidence-interval) + (fmt-confidence-interval pred low high)) + + ;; prediction-bar + ((equal grouplens-prediction-display 'prediction-bar) + (fmt-prediction-bar rate-string pred)) + + ;; confidence-bar + ((equal grouplens-prediction-display 'confidence-bar) + (format "| %4.2f |" pred)) + + ;; confidence-spot + ((equal grouplens-prediction-display 'confidence-spot) + (format "| %4.2f |" pred)) + + ;; prediction-num + ((equal grouplens-prediction-display 'prediction-num) + (fmt-prediction-num pred)) + + ;; confidence-plus-minus + ((equal grouplens-prediction-display 'confidence-plus-minus) + (fmt-confidence-plus-minus pred low high)) + + (t + (gnus-message 3 "Invalid prediction display type") + (aset rate-string 0 ?|) + (aset rate-string 11 ?|) + rate-string) + ) + ) + ) + ) + ) + (defun grouplens-valid-score (score) (if (equal grouplens-prediction-display 'prediction-num) t ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26938.824414104.3@dg-rtp.dg.com> Content-Description: Lance Brown Grouplens Gnus rc code ;;; ;;; Grouplens Stuff ;;; (require 'gnus-gl) ;;;; In addition, there are a few gnus-*-hooks that need to be set: (add-hook 'gnus-startup-hook 'bbb-login) (add-hook 'gnus-exit-gnus-hook 'bbb-logout) ;;; The above format also assumes that you are using gnus-bbdb You can ;;; just as easily ad %uG to whatever format string you use. Or add ;;; a %i to just see a simple numeric version of the predictions that ;;; uses less space on the summary line. If you use %uG you have several ;;; choices for how things look. See the doc string for the ;;; grouplens-prediction-display variable. (setq grouplens-prediction-display 'confidence-bar) ;;; If you use %uI on your group-line-format you will get (GroupLens ;;; Enhanced) after the names of newsgroups supported by GroupLens. (setq gnus-group-line-format "%M%S%p%5y: %(%g%) %uI\n") ;;; Summary Mode Line Format (setq gnus-summary-line-format "%U%R%4,4i%uL%I%(%[%4L:%-19,19n%]%) %s\n") (define-key gnus-summary-goto-map "n" 'grouplens-next-unread-article) (define-key gnus-summary-mode-map "n" 'grouplens-next-unread-article) (define-key gnus-summary-score-map "r" 'bbb-summary-rate-article) (define-key gnus-summary-mode-map "," 'grouplens-best-unread-article) (add-hook 'gnus-exit-group-hook 'bbb-put-ratings) ;;; In addition there are some GroupLens user variables to set (setq grouplens-pseudonym "Ghost") ;;; If you are using a bbb other than twain.cs.umn.edu you will need to ;; set the grouplens-bbb-host variable, and possibly the ;; grouplens-bbb-port variable. (setq grouplens-newsgroups '("comp.lang.c++" "rec.humor" "rec.food.recipes" "comp.os.linux.announce" "comp.os.linux.answers" "comp.os.linux.development" "comp.os.linux.development.apps" "comp.os.linux.development.system" "comp.os.linux.hardware" "comp.os.linux.misc" "comp.os.linux.networking" "comp.os.linux.setup" "comp.groupware" "mn.general"p "rec.arts.movies" "rec.arts.movies.current-films") ) ;; This sets up the groups for which you will get predictions and ratings. ;; Hook BBB into group select hook (defun lab-bbb-select-hook () (bbb-build-mid-scores-alist gnus-newsgroup-name)) (add-hook 'gnus-select-group-hook 'lab-bbb-select-hook) ------- =_aaaaaaaaaa0--