Gnus development mailing list
 help / color / mirror / Atom feed
* Re: GroupLens: gnus-gl.el
       [not found] <ravx4ge5@totally-fudged-out-message-id>
@ 1996-02-15  3:53 ` Brad Miller
  1996-02-15 15:31   ` Lance A. Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Brad Miller @ 1996-02-15  3:53 UTC (permalink / raw)
  Cc: (ding) GNUS Mailing List

>>>>> "Lance" == Lance A Brown <labrown@dg-rtp.dg.com> writes:

Lance> Grouplens looks cool, but I don't like how it works right now for two
Lance> reasons.  

Lance> 1.  I want to have MY scores to show up all the time and ITS scores to
Lance>     only  show up when I'm reading a group it supports.  This means
Lance>     that I need to have September Gnus run both the
Lance>     gnus-score-find-bnews function and the Grouplens score function.

For a non GroupLens group, the bbb-build-mid-scores-alist just returns
nil, so there is really hardly any overhead, other than a call to member
when you are reading a non-GroupLens group.

But are you saying that you would like to have two of scores show
up for GroupLens groups?  the score based on your SCORE files, and the
prediction from the Better Bit Bureau?

Lance> 2.  I've tried messing with the gnus-summary-line-format variable in
Lance>     the gnus-select-group-hook so that the Grouplens scores are only
Lance>     displayed when reading groups Grouplens supports but the
Lance>     pre-compilation of the format specs appears to be getting in the
Lance>     way.

I implemented the GroupLens interface to take advantage of the gnus
scoring code, because it was easy, and I didn't think that people would
want to see two scores for one message.  If the consensus is to keep
GroupLens scores separate from gnus scores, I can do that. 

If the problem is in the way that scores are displayed for non-GroupLens
groups, I'm sure I can fix up the user format function to do the right
thing.  You don't need to use my user format function, the regular %i,
%z will show the score too.  Although you may want to mess with the
offset and scale variables to make the GroupLens scores be something
other than 1-5

\Brad
----------------------------------------------------------------------------
Brad Miller                    | e-mail: bmiller@cs.umn.edu
University of Minnesota        | phone:  (612) 626-8396     
Department of Computer Science | www:    http://www.cs.umn.edu/~bmiller
EE/CS 5-244                    | 
----------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GroupLens: gnus-gl.el
  1996-02-15  3:53 ` GroupLens: gnus-gl.el Brad Miller
@ 1996-02-15 15:31   ` Lance A. Brown
  1996-02-15 19:58     ` Grouplens addition "Lance A. Brown"
  0 siblings, 1 reply; 4+ messages in thread
From: Lance A. Brown @ 1996-02-15 15:31 UTC (permalink / raw)
  Cc: (ding) GNUS Mailing List

Brad Miller <bmiller@cs.umn.edu> writes:

> But are you saying that you would like to have two of scores show
> up for GroupLens groups?  the score based on your SCORE files, and the
> prediction from the Better Bit Bureau?

Yes, I'd like to be able to display both the score generated by my
SCORE and ADAPT files and the BBB prediction.  I've been looking at
rewriting gnus-gl.el so that bbb-build-mid-scores-alist can be called
from gnus-select-group-hook and stores its predictions in its own
variable apart from the Sept. Gnus scoring mechanism.  Then I'll
rewrite the user-G function take advantage of the new variable and
I'll be able to see both scores on the summary line.

--[Lance]


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Grouplens addition
  1996-02-15 15:31   ` Lance A. Brown
@ 1996-02-15 19:58     ` "Lance A. Brown"
  1996-02-15 21:31       ` Brad Miller
  0 siblings, 1 reply; 4+ messages in thread
From: "Lance A. Brown" @ 1996-02-15 19:58 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

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]

[-- Attachment #2: Patch for gnus-gl.el --]
[-- Type: text/plain, Size: 2641 bytes --]

*** /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

[-- Attachment #3: Lance Brown Grouplens Gnus rc code --]
[-- Type: text/plain, Size: 2321 bytes --]

;;;
;;; 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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Grouplens addition
  1996-02-15 19:58     ` Grouplens addition "Lance A. Brown"
@ 1996-02-15 21:31       ` Brad Miller
  0 siblings, 0 replies; 4+ messages in thread
From: Brad Miller @ 1996-02-15 21:31 UTC (permalink / raw)
  Cc: (ding) GNUS Mailing List

>>>>> ""Lance" == "Lance A Brown" <labrown@dg-rtp.dg.com> writes:
Thanks!

I'll put this back into the GroupLens base so that others can take
advantage of this too.

\Brad


----------------------------------------------------------------------------
Brad Miller                    | e-mail: bmiller@cs.umn.edu
University of Minnesota        | phone:  (612) 626-8396     
Department of Computer Science | www:    http://www.cs.umn.edu/~bmiller
EE/CS 5-244                    | 
----------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-02-15 21:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ravx4ge5@totally-fudged-out-message-id>
1996-02-15  3:53 ` GroupLens: gnus-gl.el Brad Miller
1996-02-15 15:31   ` Lance A. Brown
1996-02-15 19:58     ` Grouplens addition "Lance A. Brown"
1996-02-15 21:31       ` Brad Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).