Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* better gnus-thread-score-function
@ 2003-01-30 15:24 Hubert Canon
       [not found] ` <m3k7gkc7ln.fsf@quimbies.gnus.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Hubert Canon @ 2003-01-30 15:24 UTC (permalink / raw)



Hi all !

[please excuse me english, it is not my mother tongue]

I use adaptive scoring and I sort by total thread score. I didn't find
a suitable gnus-thread-score-function. I used to use '+ but it gives
too much importance to big threads, and 'max is not so good because
one good author in a bad thread lift it up too much. So I tried to do
my own : I wanted to give the thread the mean score.

Here is my try :

(defvar my-gnus-thread-score-function-divisor
;;; we hope that there will not be more than 100000 articles in a thread
  100000)
(defun my-gnus-thread-score-function-nb-articles (x)
  (floor (+ 0.5 (* (- x (floor x))
                   my-gnus-thread-score-function-divisor))))
(defun my-gnus-thread-score-function (article-score &rest subthread-scores)
;;; the result is the mean with the number of articles in the
;;; thread in the fractionnal part.
  (if subthread-scores
      (let ((total-article-number
             (apply '+ 1.0 (mapcar 'my-gnus-thread-score-function-nb-articles
                                   subthread-scores))))
        (+ (ceiling
            (apply '+ article-score subthread-scores)
            total-article-number)
           (/ total-article-number
              my-gnus-thread-score-function-divisor)))
    (+ (float article-score) (/ 1.0 my-gnus-thread-score-function-divisor))))
(setq gnus-thread-score-function 'my-gnus-thread-score-function)


I tested a bit, and it seems to give the expected value.

What do you think ?


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

end of thread, other threads:[~2003-02-07 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-30 15:24 better gnus-thread-score-function Hubert Canon
     [not found] ` <m3k7gkc7ln.fsf@quimbies.gnus.org>
     [not found]   ` <85adhdgwlc.fsf.Hubert.Canon@free.fr>
2003-02-07 11:59     ` Lars Magne Ingebrigtsen

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